예제 #1
0
    def __init__(self, req_wrapper=None):
        if req_wrapper is None:
            self.client = RequestWrapper()
        else:
            self.client = req_wrapper
        self.si_uuid = None

        self._allowed_actions = ['provision', 'cancel', 'reprovision']
예제 #2
0
 def __init__(self, req_wrapper=None):
     if req_wrapper is None:
         self.client = RequestWrapper()
     else:
         self.client = req_wrapper
     if 'SI_UUID' in self.client.config:
         self.si_uuid = self.client.config['SI_UUID']
     else:
         self.si_uuid = None
예제 #3
0
 def __init__(self, req_wrapper=None):
     if req_wrapper is None:
         self.client = RequestWrapper()
     else:
         self.client = req_wrapper
     self.si_uuid = None
     self._allowed_actions = [
         'provision', 'cancel', 'reprovision', 'propagate', 'commit',
         'release', 'reinstate', 'verify'
     ]
예제 #4
0
class InstanceApi(object):
    """NOTE: This class is auto generated by the swagger code generator program.

    Do not edit the class manually.
    Ref: https://github.com/swagger-api/swagger-codegen
    """
    def __init__(self, req_wrapper=None):
        if req_wrapper is None:
            self.client = RequestWrapper()
        else:
            self.client = req_wrapper
        self.si_uuid = None
        self._allowed_actions = [
            'provision', 'cancel', 'reprovision', 'propagate', 'commit',
            'release', 'reinstate', 'verify'
        ]

    def instance_new(self, **kwargs):  # noqa: E501
        """Generate new service instance UUID  # noqa: E501

        Retrieves UUID for new instance from backend.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.instance_new(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :return: str
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            data = self.instance_get_with_http_info(**kwargs)
            self.si_uuid = data
            return data  # noqa: E501
        else:
            (data) = self.instance_get_with_http_info(**kwargs)  # noqa: E501
            self.si_uuid = data
            return data

    def instance_get_with_http_info(self, **kwargs):  # noqa: E501
        """Generate new service instance UUID  # noqa: E501

        Retrieves UUID for new instance from backend.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.instance_get_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :return: str
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = []  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method instance_get" % key)
            params[key] = val
        del params['kwargs']

        return self.client.request('GET', '/instance')

    # TODO: check action types and only allow for combined ops
    def instance_operate(self, action, **kwargs):  # noqa: E501
        """Operate on a service instance  # noqa: E501

        Request an operation for specified service instance.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.instance_operate(si_uuid, action, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str si_uuid: service instance UUID (required)
        :param Operation action: Service operation requested
            * `provision` - Composite service to propagate, commit and verify instance.
            * `cancel` - Composite service to cancel, propagate, commit and verify instance.
            * `reprovision` - Composite service to reinstate, propagate, commit and verify instance.
        :param bool sync: Whether to perform the operation in a synchronous/blocking mode.
        :param bool force: Whether to force the operation on a failed instance.
        :param str intent: Intent UUID string or 'last'.
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        if self.si_uuid:
            kwargs['si_uuid'] = self.si_uuid
        if not kwargs['si_uuid'] :
            raise ValueError("Missing the required parameter `si_uuid`")

        if action not in self._allowed_actions:
            raise ValueError(
                f'operate action must of one of {self._allowed_actions}')

        if kwargs.get('async_req'):
            return self.instance_si_uuid_action_put_with_http_info(action, **kwargs)  # noqa: E501
        else:
            (data) = self.instance_si_uuid_action_put_with_http_info(action, **kwargs)  # noqa: E501
            return data

    def instance_si_uuid_action_put_with_http_info(self, action,
                                                   **kwargs):  # noqa: E501
        """Operate on a service instance  # noqa: E501

        Request an operation for specified service instance.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.instance_si_uuid_action_put_with_http_info(si_uuid, action, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str si_uuid: service instance UUID (required)
        :param Operation action: Service operation requested   * `cancel` - Composite service to cancel, propagate, commit and verify instance.   * `release` - Composite service to cancel and propagate in 2-phase commit process.   * `verify` - Begin service verification process. (required)
        :param bool sync: Whether to perform the operation in a synchronous/blocking mode.
        :param bool force: Whether to force the operation on a failed instance.
        :param str intent: Intent UUID string or 'last'.
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['si_uuid', 'action', 'sync', 'force', 'intent']
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method instance_si_uuid_action_put" % key)
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'si_uuid' is set
        if ('si_uuid' not in params or params['si_uuid'] is None):
            raise ValueError(
                "Missing the required parameter `si_uuid` when calling `instance_si_uuid_action_put`"
            )  # noqa: E501
        # verify the required parameter 'action' is set
        if ('action' not in params or params['action'] is None):
            raise ValueError(
                "Missing the required parameter `action` when calling `instance_si_uuid_action_put`"
            )  # noqa: E501

        query_params = []
        if 'sync' in params:
            query_params.append(('sync', params['sync']))
        if 'force' in params:
            query_params.append(('force', params['force']))
        if 'intent' in params:
            query_params.append(('intent', params['intent']))

        return self.client.request('PUT',
                                   '/instance/' + kwargs['si_uuid'] + '/' + action,
                                   query_params=query_params)

    def instance_delete(self, **kwargs):  # noqa: E501
        """Delete a service instance  # noqa: E501

        Deletes the specified service instance.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.instance_delete(si_uuid, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str si_uuid: service instance UUID (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        if self.si_uuid:
            kwargs['si_uuid'] = self.si_uuid
        if not kwargs['si_uuid'] :
            raise ValueError("Missing the required parameter `si_uuid`")

        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.instance_si_uuid_delete_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.instance_si_uuid_delete_with_http_info(**kwargs)  # noqa: E501
            return data

    def instance_si_uuid_delete_with_http_info(self,
                                               **kwargs):  # noqa: E501
        """Delete a service instance  # noqa: E501

        Deletes the specified service instance.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.instance_si_uuid_delete_with_http_info(si_uuid, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str si_uuid: service instance UUID (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['si_uuid']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method instance_si_uuid_delete" % key)
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'si_uuid' is set
        if ('si_uuid' not in params or params['si_uuid'] is None):
            raise ValueError(
                "Missing the required parameter `si_uuid` when calling `instance_si_uuid_delete`"
            )  # noqa: E501

        return self.client.request('DELETE', '/instance/' + kwargs['si_uuid'])

    def instance_create(self, intent, **kwargs):  # noqa: E501
        """Create new service instance and/or add new intent  # noqa: E501

        Creates a new service instance with the given UUID and intent specification or add new intent to existing service instance  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.instance_create(body, si_uuid, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param ServiceIntent body: Service instance creation request object. (required)
        :param str si_uuid: Service instance UUID. (required)
        :return: ServiceIntentResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        if self.si_uuid:
            kwargs['si_uuid'] = self.si_uuid
        if not kwargs['si_uuid'] :
            raise ValueError("Missing the required parameter `si_uuid`")

        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.instance_si_uuid_post_with_http_info(
                intent, **kwargs)  # noqa: E501
        else:
            (data) = self.instance_si_uuid_post_with_http_info(
                intent, **kwargs)  # noqa: E501
            return data

    def instance_si_uuid_post_with_http_info(self, body,
                                             **kwargs):  # noqa: E501
        """Create new service instance and/or add new intent  # noqa: E501

        Creates a new service instance with the given UUID and intent specification or add new intent to existing service instance  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.instance_si_uuid_post_with_http_info(body, si_uuid, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param ServiceIntent body: Service instance creation request object. (required)
        :param str si_uuid: Service instance UUID. (required)
        :return: ServiceIntentResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['body', 'si_uuid', 'sync', 'proceed']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method instance_si_uuid_post" % key)
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'body' is set
        if ('body' not in params or params['body'] is None):
            raise ValueError(
                "Missing the required parameter `body` when calling `instance_si_uuid_post`"
            )  # noqa: E501
        # verify the required parameter 'si_uuid' is set
        if ('si_uuid' not in params or params['si_uuid'] is None):
            raise ValueError(
                "Missing the required parameter `si_uuid` when calling `instance_si_uuid_post`"
            )  # noqa: E501

        path_params = {}
        if 'si_uuid' in params:
            path_params['siUUID'] = params['si_uuid']  # noqa: E501

        query_params = []
        if 'sync' in params:
            query_params.append(('sync', params['sync']))
        # sync is true by default
        if 'proceed' in params:
            query_params.append(('proceed', params['proceed']))

        # Authentication setting
        auth_settings = ['oAuth2Keycloak']  # noqa: E501
        return self.client.request('POST',
                                   '/instance/' + kwargs['si_uuid'],
                                   body_params=body,
                                   query_params=query_params)

    def instance_modify(self, intent, **kwargs):  # noqa: E501
        """Create new service instance and/or add new intent  # noqa: E501

        Creates a new service instance with the given UUID and intent specification or add new intent to existing service instance  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.instance_modify(body, si_uuid, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param ServiceIntent body: Service instance creation request object. (required)
        :param str si_uuid: Service instance UUID. (required)
        :return: ServiceIntentResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        if self.si_uuid:
            kwargs['si_uuid'] = self.si_uuid
        if not kwargs['si_uuid'] :
            raise ValueError("Missing the required parameter `si_uuid`")

        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.instance_si_uuid_modify_post_with_http_info(
                intent, **kwargs)  # noqa: E501
        else:
            (data) = self.instance_si_uuid_modify_post_with_http_info(
                intent, **kwargs)  # noqa: E501
            return data

    def instance_si_uuid_modify_post_with_http_info(self, body,
                                                    **kwargs):  # noqa: E501
        """Create new service instance and/or add new intent  # noqa: E501

        Creates a new service instance with the given UUID and intent specification or add new intent to existing service instance  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.instance_si_uuid_post_with_http_info(body, si_uuid, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param ServiceIntent body: Service instance creation request object. (required)
        :param str si_uuid: Service instance UUID. (required)
        :return: ServiceIntentResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['body', 'si_uuid', 'sync']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method instance_si_uuid_modify_post_with_http_info" %
                    key)
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'body' is set
        if ('body' not in params or params['body'] is None):
            raise ValueError(
                "Missing the required parameter `body` when calling `instance_modify`"
            )  # noqa: E501
        # verify the required parameter 'si_uuid' is set
        if ('si_uuid' not in params or params['si_uuid'] is None):
            raise ValueError(
                "Missing the required parameter `si_uuid` when calling `instance_modify`"
            )  # noqa: E501

        path_params = {}
        if 'si_uuid' in params:
            path_params['siUUID'] = params['si_uuid']  # noqa: E501

        query_params = []
        if 'sync' in params:
            query_params.append(('sync', params['sync']))
        # sync is true by default

        # Authentication setting
        auth_settings = ['oAuth2Keycloak']  # noqa: E501
        return self.client.request('POST',
                                   f'/instance/{kwargs["si_uuid"]}/modify',
                                   body_params=body,
                                   query_params=query_params)

    def instance_get_status(self, **kwargs):  # noqa: E501
        """Get instance status  # noqa: E501
        Retrieves the full instance status.  # noqa: E501
        This method makes a synchronous HTTP request by default.
        :param async_req bool
        :param str si_uuid: Service instance UUID. (required)
        :return: str
                 If the method is called asynchronously,
                 returns the request thread.
        """
        if self.si_uuid:
            kwargs['si_uuid'] = self.si_uuid
        if not kwargs['si_uuid'] :
            raise ValueError("Missing the required parameter `si_uuid`")

        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.instance_si_uuid_status_get_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.instance_si_uuid_status_get_with_http_info(**kwargs)  # noqa: E501
            return data

    def instance_si_uuid_status_get_with_http_info(self,
                                                   **kwargs):  # noqa: E501
        """Get instance status  # noqa: E501
        Retrieves the full instance status.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.instance_si_uuid_status_get_with_http_info(si_uuid, async_req=True)
        >>> result = thread.get()
        :param async_req bool
        :param str si_uuid: Service instance UUID. (required)
        :return: str
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['si_uuid']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method instance_si_uuid_status_get" % key)
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'si_uuid' is set
        if ('si_uuid' not in params or params['si_uuid'] is None):
            raise ValueError(
                "Missing the required parameter `si_uuid` when calling `instance_si_uuid_status_get`"
            )  # noqa: E501

        return self.client.request('GET', f'/instance/{kwargs["si_uuid"]}/status')

    def instance_get_substatus(self, **kwargs):  # noqa: E501
        """Get instance status  # noqa: E501
        Retrieves the full instance status.  # noqa: E501
        This method makes a synchronous HTTP request by default.
        :param async_req bool
        :param str si_uuid: Service instance UUID. (required)
        :return: str
                 If the method is called asynchronously,
                 returns the request thread.
        """
        if self.si_uuid:
            kwargs['si_uuid'] = self.si_uuid
        if not kwargs['si_uuid'] :
            raise ValueError("Missing the required parameter `si_uuid`")

        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.instance_si_uuid_substatus_get_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.instance_si_uuid_substatus_get_with_http_info(**kwargs)  # noqa: E501
            return data

    def instance_si_uuid_substatus_get_with_http_info(self,
                                                      **kwargs):  # noqa: E501
        """Get instance status  # noqa: E501
        Retrieves the full instance status.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.instance_si_uuid_substatus_get_with_http_info(si_uuid, async_req=True)
        >>> result = thread.get()
        :param async_req bool
        :param str si_uuid: Service instance UUID. (required)
        :return: str
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['si_uuid']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method instance_get_substatus" % key)
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'si_uuid' is set
        if ('si_uuid' not in params or params['si_uuid'] is None):
            raise ValueError(
                "Missing the required parameter `si_uuid` when calling `instance_get_substatus`"
            )  # noqa: E501

        return self.client.request('GET', f'/instance/{kwargs["si_uuid"]}/substatus')

    def instance_set_superstate(self, state, **kwargs):  # noqa: E501
        """Get instance status  # noqa: E501
        Retrieves the full instance status.  # noqa: E501
        This method makes a synchronous HTTP request by default.
        :param async_req bool
        :param str si_uuid: Service instance UUID. (required)
        :param str state: superstate. (required)
        :return: str
                 If the method is called asynchronously,
                 returns the request thread.
        """
        if self.si_uuid:
            kwargs['si_uuid'] = self.si_uuid
        if not kwargs['si_uuid'] :
            raise ValueError("Missing the required parameter `si_uuid`")

        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.instance_si_uuid_superstate_put_with_http_info(state, **kwargs)  # noqa: E501
        else:
            (data) = self.instance_si_uuid_superstate_put_with_http_info(state, **kwargs)  # noqa: E501
            return data

    def instance_si_uuid_superstate_put_with_http_info(self, state,
                                                       **kwargs):  # noqa: E501
        """Get instance status  # noqa: E501
        Retrieves the full instance status.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.instance_si_uuid_superstate_get_with_http_info(si_uuid, async_req=True)
        >>> result = thread.get()
        :param async_req bool
        :param str si_uuid: Service instance UUID. (required)
        :return: str
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['si_uuid', 'state']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method instance_get_superstate" % key)
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'si_uuid' is set
        if ('si_uuid' not in params or params['si_uuid'] is None):
            raise ValueError(
                "Missing the required parameter `si_uuid` when calling `instance_set_superstate`"
            )  # noqa: E501
        if ('state' not in params or params['state'] is None):
            raise ValueError(
                "Missing the required parameter `state` when calling `instance_set_superstate`"
            )  # noqa: E501

        return self.client.request('PUT',
                                   f'/instance/{kwargs["si_uuid"]}/superstate/{state}')

    def instance_get_intents(self, **kwargs):  # noqa: E501
        """Retrieve intents by service instance  # noqa: E501

        Queries all service intents belonging to given instance UUID.  # noqa: E501
        This method makes a synchronous HTTP request by default.
        :param async_req bool
        :param str si_uuid: Intent UUID. (required)
        :return: list[IntentExpanded]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        if self.si_uuid:
            kwargs['si_uuid'] = self.si_uuid
        if not kwargs['si_uuid'] :
            raise ValueError("Missing the required parameter `si_uuid`")

        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.intent_instance_si_uuid_get_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.intent_instance_si_uuid_get_with_http_info(**kwargs)  # noqa: E501
            return data

    def intent_instance_si_uuid_get_with_http_info(self,
                                                   **kwargs):  # noqa: E501
        """Retrieve intents by service instance  # noqa: E501

        Queries all service intents belonging to given instance UUID.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.intent_instance_si_uuid_get_with_http_info(si_uuid, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str si_uuid: Intent UUID. (required)
        :return: list[IntentExpanded]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['si_uuid']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method intent_instance_si_uuid_get" % key)
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'si_uuid' is set
        if ('si_uuid' not in params or params['si_uuid'] is None):
            raise ValueError(
                "Missing the required parameter `si_uuid` when calling `intent_instance_si_uuid_get`"
            )  # noqa: E501

        return self.client.request('GET', '/intent/instance/' + kwargs['si_uuid'])

    def profile_list(self, **kwargs):
        """Get skimmed profile data  # noqa: E501

        Retrieves the list of profiles the user is permitted to use without any JSON data.  # noqa: E501
        This method makes a synchronous HTTP request by default.
        :param async_req bool
        :return: list[SlimProfile]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.profile_get_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.profile_get_with_http_info(**kwargs)  # noqa: E501
            return data

    def profile_get_with_http_info(self, **kwargs):
        """Get skimmed profile data  # noqa: E501

        Retrieves the list of profiles the user is permitted to use without any JSON data.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.profile_get_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :return: list[SlimProfile]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = []
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method profile_get" % key)
            params[key] = val
        del params['kwargs']

        return self.client.request('GET', '/profile')

    def profile_describe(self, uuid, **kwargs):  # noqa: E501
        """Get single profile  # noqa: E501

        Retrieves the specified profile.  # noqa: E501
        This method makes a synchronous HTTP request by default.
        :param async_req bool
        :param str uuid: Profile UUID. (required)
        :return: FullProfile
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.profile_uuid_get_with_http_info(uuid,
                                                        **kwargs)  # noqa: E501
        else:
            (data) = self.profile_uuid_get_with_http_info(
                uuid, **kwargs)  # noqa: E501
            return data

    def profile_uuid_get_with_http_info(self, uuid, **kwargs):  # noqa: E501
        """Get single profile  # noqa: E501

        Retrieves the specified profile.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.profile_uuid_get_with_http_info(uuid, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str uuid: Profile UUID. (required)
        :return: FullProfile
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['uuid']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method profile_uuid_get" % key)
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'uuid' is set
        if ('uuid' not in params or params['uuid'] is None):
            raise ValueError(
                "Missing the required parameter `uuid` when calling `profile_uuid_get`"
            )  # noqa: E501

        return self.client.request('GET', '/profile/' + uuid)

    def instance_get_logging(self, **kwargs):  # noqa: E501
        """Retrieve intents by service instance  # noqa: E501

        Queries all service intents belonging to given instance UUID.  # noqa: E501
        This method makes a synchronous HTTP request by default.
        :param async_req bool
        :param str si_uuid: Intent UUID. (required)
        :return: list[IntentExpanded]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        if self.si_uuid:
            kwargs['si_uuid'] = self.si_uuid
        if not kwargs['si_uuid'] :
            raise ValueError("Missing the required parameter `si_uuid`")

        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.logging_logs_si_uuid_get_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.logging_logs_si_uuid_get_with_http_info(**kwargs)  # noqa: E501
            return data

    def logging_logs_si_uuid_get_with_http_info(self,
                                                **kwargs):  # noqa: E501
        """Retrieve intents by service instance  # noqa: E501

        Queries all service intents belonging to given instance UUID.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.logging_logs_si_uuid_get_with_http_info(si_uuid, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str si_uuid: Intent UUID. (required)
        :return: list[IntentExpanded]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['si_uuid']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method logging_logs_si_uuid_get_with_http_info" % key)
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'si_uuid' is set
        if ('si_uuid' not in params or params['si_uuid'] is None):
            raise ValueError(
                "Missing the required parameter `si_uuid` when calling `logging_logs_si_uuid_get_with_http_info`"
            )  # noqa: E501

        return self.client.request('GET', '/logging/logs/' + kwargs['si_uuid'])
예제 #5
0
 def __init__(self, req_wrapper=None):
     if req_wrapper is None:
         self.client = RequestWrapper()
     else:
         self.client = req_wrapper
예제 #6
0
class DiscoverApi(object):
    """NOTE: This class is auto generated by the swagger code generator program.

    Do not edit the class manually.
    Ref: https://github.com/swagger-api/swagger-codegen
    """
    def __init__(self, req_wrapper=None):
        if req_wrapper is None:
            self.client = RequestWrapper()
        else:
            self.client = req_wrapper

    def discover_domain_id_get(self, domain_id, **kwargs):  # noqa: E501
        """Edge points discover and description for a specific domain  # noqa: E501

        List all associated edge points (and capabilities)  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.discover_domain_id_get(domain_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str domain_id: Name of URI of a target domain (required)
        :return: DomainDescription
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.discover_domain_id_get_with_http_info(
                domain_id, **kwargs)  # noqa: E501
        else:
            (data) = self.discover_domain_id_get_with_http_info(
                domain_id, **kwargs)  # noqa: E501
            return data

    def discover_domain_id_get_with_http_info(self, domain_id,
                                              **kwargs):  # noqa: E501
        """Edge points discover and description for a specific domain  # noqa: E501

        List all associated edge points (and capabilities)  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.discover_domain_id_get_with_http_info(domain_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str domain_id: Name of URI of a target domain (required)
        :return: DomainDescription
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['domain_id']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method discover_domain_id_get" % key)
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'domain_id' is set
        if ('domain_id' not in params or params['domain_id'] is None):
            raise ValueError(
                "Missing the required parameter `domain_id` when calling `discover_domain_id_get`"
            )  # noqa: E501

        return self.client.request('GET', f'/discover/{domain_id}')

    def discover_domain_id_peers_get(self, domain_id, **kwargs):  # noqa: E501
        """edge points discover and description of peer domain for a given domain or end-site  # noqa: E501

        List peer domain edge points (and capabilities) that connect this domain (by URI or name)  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.discover_domain_id_peers_get(domain_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str domain_id: Name of URI of a target end-site domain (required)
        :return: DomainDescription
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.discover_domain_id_peers_get_with_http_info(
                domain_id, **kwargs)  # noqa: E501
        else:
            (data) = self.discover_domain_id_peers_get_with_http_info(
                domain_id, **kwargs)  # noqa: E501
            return data

    def discover_domain_id_peers_get_with_http_info(self, domain_id,
                                                    **kwargs):  # noqa: E501
        """edge points discover and description of peer domain for a given domain or end-site  # noqa: E501

        List peer domain edge points (and capabilities) that connect this domain (by URI or name)  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.discover_domain_id_peers_get_with_http_info(domain_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str domain_id: Name of URI of a target end-site domain (required)
        :return: DomainDescription
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['domain_id']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method discover_domain_id_peers_get" %
                                key)
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'domain_id' is set
        if ('domain_id' not in params or params['domain_id'] is None):
            raise ValueError(
                "Missing the required parameter `domain_id` when calling `discover_domain_id_peers_get`"
            )  # noqa: E501

        return self.client.request('GET', f'/discover/{domain_id}/peers')

    def discover_domain_id_ipv6pool_get(self, domain_id,
                                        **kwargs):  # noqa: E501
        """ discover and description of ipv6 subnet pool for a given domain or end-site  # noqa: E501

        List of ipv6 subnet pools for this domain (by URI or name)  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.discover_domain_id_ipv6pool_get(domain_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str domain_id: Name of URI of a target end-site domain (required)
        :return: DomainDescription
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.discover_domain_id_ipv6pool_get_with_http_info(
                domain_id, **kwargs)  # noqa: E501
        else:
            (data) = self.discover_domain_id_ipv6pool_get_with_http_info(
                domain_id, **kwargs)  # noqa: E501
            return data

    def discover_domain_id_ipv6pool_get_with_http_info(self, domain_id,
                                                       **kwargs):  # noqa: E501
        """ discover and description of ipv6 subnet pool for a given domain or end-site  # noqa: E501

        List of ipv6 subnet pools for this domain (by URI or name)  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.discover_domain_id_ipv6pool_get_with_http_info(domain_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str domain_id: Name of URI of a target end-site domain (required)
        :return: DomainDescription
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['domain_id']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method discover_domain_id_ipv6pool_get" %
                                key)
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'domain_id' is set
        if ('domain_id' not in params or params['domain_id'] is None):
            raise ValueError(
                "Missing the required parameter `domain_id` when calling `discover_domain_id_ipv6pool_get`"
            )  # noqa: E501

        return self.client.request('GET', f'/discover/{domain_id}/ipv6pool')

    def discover_domains_get(self, **kwargs):  # noqa: E501
        """Topology domains  # noqa: E501

        List all known domains (and capabilities?)  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.discover_domains_get(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :return: InlineResponse2001
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.discover_domains_get_with_http_info(
                **kwargs)  # noqa: E501
        else:
            (data) = self.discover_domains_get_with_http_info(
                **kwargs)  # noqa: E501
            return data

    def discover_domains_get_with_http_info(self, **kwargs):  # noqa: E501
        """Topology domains  # noqa: E501

        List all known domains (and capabilities?)  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.discover_domains_get_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :return: InlineResponse2001
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = []  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method discover_domains_get" % key)
            params[key] = val
        del params['kwargs']
        return self.client.request('GET', f'/discover/domains')

    def discover_get(self, **kwargs):  # noqa: E501
        """Topology domains, edge points and peers information  # noqa: E501

        List global domain information  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.discover_get(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :return: InlineResponse200
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.discover_get_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.discover_get_with_http_info(**kwargs)  # noqa: E501
            return data

    def discover_get_with_http_info(self, **kwargs):  # noqa: E501
        """Topology domains, edge points and peers information  # noqa: E501

        List global domain information  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.discover_get_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :return: InlineResponse200
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = []  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method discover_get" % key)
            params[key] = val
        del params['kwargs']
        return self.client.request('GET', f'/discover')

    def discover_lookup_name_get(self, name, **kwargs):  # noqa: E501
        """Look up for domain / node / port URI by name  # noqa: E501

        List of URI string  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.discover_lookup_name_get(name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str name: Resource nml:name or mrs:NetworkAddress or 'fqdn' type (required)
        :param str search: search by name, tag or NetworkAddress .
        :param str type: type of tag or NetworkAddress
        :param bool regex: use full name march or regex
        :return: DomainDescription
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.discover_lookup_name_get_with_http_info(
                name, **kwargs)  # noqa: E501
        else:
            (data) = self.discover_lookup_name_get_with_http_info(
                name, **kwargs)  # noqa: E501
            return data

    def discover_lookup_name_get_with_http_info(self, name,
                                                **kwargs):  # noqa: E501
        """Look up for domain / node / port URI by name  # noqa: E501

        List of URI string  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.discover_lookup_name_get_with_http_info(name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str name: Resource nml:name or mrs:NetworkAddress or 'fqdn' type (required)
        :param str search: search by name, tag or NetworkAddress .
        :param str type: type of tag or NetworkAddress
        :param bool regex: use full name march or regex
        :return: DomainDescription
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['name', 'search', 'type', 'regex']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method discover_lookup_name_get" % key)
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'name' is set
        if ('name' not in params or params['name'] is None):
            raise ValueError(
                "Missing the required parameter `name` when calling `discover_lookup_name_get`"
            )  # noqa: E501

        query_params = []
        if 'search' in params:
            query_params.append(('search', params['search']))  # noqa: E501
        if 'type' in params:
            query_params.append(('type', params['type']))  # noqa: E501
        if 'regex' in params:
            query_params.append(('regex', params['regex']))  # noqa: E501

        return self.client.request('GET',
                                   f'/discover/lookup/{name}',
                                   query_params=query_params)

    def discover_lookup_rooturi_get(self, uri, **kwargs):  # noqa: E501
        """Look up for domain root URI by given a resource URI  # noqa: E501

        List of URI string  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.discover_lookup_rooturi_get(uri, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str uri: Resource URI (required)
        :return: URI string
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.discover_lookup_rooturi_get_with_http_info(
                uri, **kwargs)  # noqa: E501
        else:
            (data) = self.discover_lookup_rooturi_get_with_http_info(
                uri, **kwargs)  # noqa: E501
            return data

    def discover_lookup_rooturi_get_with_http_info(self, uri,
                                                   **kwargs):  # noqa: E501
        """Look up for domain root URI by given a resource URI  # noqa: E501

        List of URI string  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.discover_lookup_rooturi_get(uri, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str uri: Resource URI (required)
        :return: URI string
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['uri']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method discover_lookup_name_get" % key)
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'name' is set
        if ('uri' not in params or params['uri'] is None):
            raise ValueError(
                "Missing the required parameter `uri` when calling `discover_lookup_rooturi_get`"
            )  # noqa: E501

        query_params = []

        return self.client.request('GET',
                                   f'/discover/lookup/{uri}/rooturi',
                                   query_params=query_params)

    def discover_service_instances_get(self, **kwargs):  # noqa: E501
        """Service discover and description  # noqa: E501

        List service instances  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.discover_service_instances_get(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str search: search by name substring or regex
        :param bool regex: use substring march or regex
        :return: InlineResponse2002
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.discover_service_instances_get_with_http_info(
                **kwargs)  # noqa: E501
        else:
            (data) = self.discover_service_instances_get_with_http_info(
                **kwargs)  # noqa: E501
            return data

    def discover_service_instances_get_with_http_info(self,
                                                      **kwargs):  # noqa: E501
        """Service discover and description  # noqa: E501

        List service instances  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.discover_service_instances_get_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str search: search by name substring or regex
        :param bool regex: use substring march or regex
        :return: InlineResponse2002
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['search', 'regex']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method discover_service_instances_get" %
                                key)
            params[key] = val
        del params['kwargs']

        query_params = []
        if 'search' in params:
            query_params.append(('search', params['search']))  # noqa: E501
        if 'regex' in params:
            query_params.append(('regex', params['regex']))  # noqa: E501
        return self.client.request('GET',
                                   f'/discover/service/instances',
                                   query_params=query_params)
예제 #7
0
class ProfileApi(object):
    """NOTE: This class is auto generated by the swagger code generator program.

    Do not edit the class manually.
    Ref: https://github.com/swagger-api/swagger-codegen
    """
    def __init__(self, req_wrapper=None):
        if req_wrapper is None:
            self.client = RequestWrapper()
        else:
            self.client = req_wrapper
        if 'SI_UUID' in self.client.config:
            self.si_uuid = self.client.config['SI_UUID']
        else:
            self.si_uuid = None

    def profile_list(self, **kwargs):
        """Get skimmed profile data  # noqa: E501

        Retrieves the list of profiles the user is permitted to use without any JSON data.  # noqa: E501
        This method makes a synchronous HTTP request by default.
        :param async_req bool
        :return: list[SlimProfile]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.profile_get_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.profile_get_with_http_info(**kwargs)  # noqa: E501
            return data

    def profile_get_with_http_info(self, **kwargs):
        """Get skimmed profile data  # noqa: E501

        Retrieves the list of profiles the user is permitted to use without any JSON data.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.profile_get_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :return: list[SlimProfile]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = []
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method profile_get" % key)
            params[key] = val
        del params['kwargs']

        return self.client.request('GET', f'/profile')

    def profile_describe(self, uuid, **kwargs):  # noqa: E501
        """Get single profile  # noqa: E501

        Retrieves the specified profile.  # noqa: E501
        This method makes a synchronous HTTP request by default.
        :param async_req bool
        :param str uuid: Profile UUID. (required)
        :return: FullProfile
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.profile_uuid_get_with_http_info(uuid,
                                                        **kwargs)  # noqa: E501
        else:
            (data) = self.profile_uuid_get_with_http_info(
                uuid, **kwargs)  # noqa: E501
            return data

    def profile_uuid_get_with_http_info(self, uuid, **kwargs):  # noqa: E501
        """Get single profile  # noqa: E501

        Retrieves the specified profile.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.profile_uuid_get_with_http_info(uuid, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str uuid: Profile UUID. (required)
        :return: FullProfile
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['uuid']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method profile_uuid_get" % key)
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'uuid' is set
        if ('uuid' not in params or params['uuid'] is None):
            raise ValueError(
                "Missing the required parameter `uuid` when calling `profile_uuid_get`"
            )  # noqa: E501

        return self.client.request('GET', f'/profile/' + uuid)

    def profile_create(self, body, **kwargs):  # noqa: E501
        """Create a profile  # noqa: E501

        Builds and saves a new profile, using provided starting data.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.profile_create(body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param ProfileManifest body: Profile creation manifest. (required)
        :return: str
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.profile_post_with_http_info(body,
                                                    **kwargs)  # noqa: E501
        else:
            (data) = self.profile_post_with_http_info(body,
                                                      **kwargs)  # noqa: E501
            return data

    def profile_post_with_http_info(self, body, **kwargs):  # noqa: E501
        """Create a profile  # noqa: E501

        Builds and saves a new profile, using provided starting data.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.profile_post_with_http_info(body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param ProfileManifest body: Profile creation manifest. (required)
        :return: str
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['body']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method profile_post" % key)
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'body' is set
        if ('body' not in params or params['body'] is None):
            raise ValueError(
                "Missing the required parameter `body` when calling `profile_post`"
            )  # noqa: E501

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.client.request('POST',
                                   f'/profile',
                                   body_params=body_params)

    def profile_delete(self, uuid, **kwargs):  # noqa: E501
        """Delete profile  # noqa: E501

        Deletes the specified profile.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.profile_delete(uuid, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str uuid: Profile UUID. (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.profile_uuid_delete_with_http_info(
                uuid, **kwargs)  # noqa: E501
        else:
            (data) = self.profile_uuid_delete_with_http_info(
                uuid, **kwargs)  # noqa: E501
            return data

    def profile_uuid_delete_with_http_info(self, uuid, **kwargs):  # noqa: E501
        """Delete profile  # noqa: E501

        Deletes the specified profile.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.profile_uuid_delete_with_http_info(uuid, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str uuid: Profile UUID. (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['uuid']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method profile_uuid_delete" % key)
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'uuid' is set
        if ('uuid' not in params or params['uuid'] is None):
            raise ValueError(
                "Missing the required parameter `uuid` when calling `profile_uuid_delete`"
            )  # noqa: E501

        return self.client.request('DELETE', f'/profile/{uuid}')

    def profile_add_licenses(self, body, uuid, **kwargs):  # noqa: E501
        """Add new license  # noqa: E501

        Assigns a new license to a user, giving them access to execute the specified profile (and potentially edit as well).  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.profile_add_licenses(body, uuid, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param ProfileLicense body: License object. (required)
        :param str uuid: Profile UUID. (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.profile_uuid_licenses_post_with_http_info(
                body, uuid, **kwargs)  # noqa: E501
        else:
            (data) = self.profile_uuid_licenses_post_with_http_info(
                body, uuid, **kwargs)  # noqa: E501
            return data

    def profile_uuid_licenses_post_with_http_info(self, body, uuid,
                                                  **kwargs):  # noqa: E501
        """Add new license  # noqa: E501

        Assigns a new license to a user, giving them access to execute the specified profile (and potentially edit as well).  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.profile_uuid_licenses_post_with_http_info(body, uuid, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param ProfileLicense body: License object. (required)
        :param str uuid: Profile UUID. (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['body', 'uuid']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method profile_uuid_licenses_post" % key)
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'body' is set
        if ('body' not in params or params['body'] is None):
            raise ValueError(
                "Missing the required parameter `body` when calling `profile_uuid_licenses_post`"
            )  # noqa: E501
        # verify the required parameter 'uuid' is set
        if ('uuid' not in params or params['uuid'] is None):
            raise ValueError(
                "Missing the required parameter `uuid` when calling `profile_uuid_licenses_post`"
            )  # noqa: E501

        path_params = {}
        if 'uuid' in params:
            path_params['uuid'] = params['uuid']  # noqa: E501

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.client.request('POST',
                                   f'/profile/{uuid}/licenses',
                                   body_params=body_params)

    def profile_update_licenses(self, body, uuid, **kwargs):  # noqa: E501
        """Edit existing license  # noqa: E501

        Edits an existing license to a user. Setting the remaining field to 0 will delete the license.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.profile_update_licenses(body, uuid, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param ProfileLicense body: License object. (required)
        :param str uuid: Profile UUID. (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.profile_uuid_licenses_put_with_http_info(
                body, uuid, **kwargs)  # noqa: E501
        else:
            (data) = self.profile_uuid_licenses_put_with_http_info(
                body, uuid, **kwargs)  # noqa: E501
            return data

    def profile_uuid_licenses_put_with_http_info(self, body, uuid,
                                                 **kwargs):  # noqa: E501
        """Edit existing license  # noqa: E501

        Edits an existing license to a user. Setting the remaining field to 0 will delete the license.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.profile_uuid_licenses_put_with_http_info(body, uuid, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param ProfileLicense body: License object. (required)
        :param str uuid: Profile UUID. (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['body', 'uuid']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method profile_uuid_licenses_put" % key)
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'body' is set
        if ('body' not in params or params['body'] is None):
            raise ValueError(
                "Missing the required parameter `body` when calling `profile_uuid_licenses_put`"
            )  # noqa: E501
        # verify the required parameter 'uuid' is set
        if ('uuid' not in params or params['uuid'] is None):
            raise ValueError(
                "Missing the required parameter `uuid` when calling `profile_uuid_licenses_put`"
            )  # noqa: E501

        path_params = {}
        if 'uuid' in params:
            path_params['uuid'] = params['uuid']  # noqa: E501

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.client.request('PUT',
                                   f'/profile/{uuid}/licenses',
                                   body_params=body_params)

    def profile_update(self, body, uuid, **kwargs):  # noqa: E501
        """Edit a profile  # noqa: E501

        Submits an updated version of a profile for saving.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.profile_uuid_put(body, uuid, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param ProfileManifest body: Profile creation manifest. (required)
        :param str uuid: Profile UUID. (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.profile_uuid_put_with_http_info(body, uuid,
                                                        **kwargs)  # noqa: E501
        else:
            (data) = self.profile_uuid_put_with_http_info(
                body, uuid, **kwargs)  # noqa: E501
            return data

    def profile_uuid_put_with_http_info(self, body, uuid,
                                        **kwargs):  # noqa: E501
        """Edit a profile  # noqa: E501

        Submits an updated version of a profile for saving.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.profile_uuid_put_with_http_info(body, uuid, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param ProfileManifest body: Profile creation manifest. (required)
        :param str uuid: Profile UUID. (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['body', 'uuid']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method profile_uuid_put" % key)
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'body' is set
        if ('body' not in params or params['body'] is None):
            raise ValueError(
                "Missing the required parameter `body` when calling `profile_uuid_put`"
            )  # noqa: E501
        # verify the required parameter 'uuid' is set
        if ('uuid' not in params or params['uuid'] is None):
            raise ValueError(
                "Missing the required parameter `uuid` when calling `profile_uuid_put`"
            )  # noqa: E501

        path_params = {}
        if 'uuid' in params:
            path_params['uuid'] = params['uuid']  # noqa: E501

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.client.request('PUT',
                                   f'/profile/{uuid}',
                                   body_params=body_params)

    def profile_get_uses(self, uuid, username, **kwargs):  # noqa: E501
        """Get license usage  # noqa: E501

        Retrieves the remaining number of tickets or slots for allocations.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.profile_uuid_uses_username_get(uuid, username, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str uuid: Profile UUID. (required)
        :param str username: Username of licensed user. (required)
        :return: float
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.profile_uuid_uses_username_get_with_http_info(
                uuid, username, **kwargs)  # noqa: E501
        else:
            (data) = self.profile_uuid_uses_username_get_with_http_info(
                uuid, username, **kwargs)  # noqa: E501
            return data

    def profile_uuid_uses_username_get_with_http_info(self, uuid, username,
                                                      **kwargs):  # noqa: E501
        """Get license usage  # noqa: E501

        Retrieves the remaining number of tickets or slots for allocations.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.profile_uuid_uses_username_get_with_http_info(uuid, username, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str uuid: Profile UUID. (required)
        :param str username: Username of licensed user. (required)
        :return: float
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['uuid', 'username']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method profile_uuid_uses_username_get" %
                                key)
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'uuid' is set
        if ('uuid' not in params or params['uuid'] is None):
            raise ValueError(
                "Missing the required parameter `uuid` when calling `profile_uuid_uses_username_get`"
            )  # noqa: E501
        # verify the required parameter 'username' is set
        if ('username' not in params or params['username'] is None):
            raise ValueError(
                "Missing the required parameter `username` when calling `profile_uuid_uses_username_get`"
            )  # noqa: E501

        path_params = {}
        if 'uuid' in params:
            path_params['uuid'] = params['uuid']  # noqa: E501
        if 'username' in params:
            path_params['username'] = params['username']  # noqa: E501

        return self.client.request('GET', f'/profile/{uuid}/uses/{username}')
예제 #8
0
class LoggingApi(object):
    """NOTE: This class is auto generated by the swagger code generator program.

    Do not edit the class manually.
    Ref: https://github.com/swagger-api/swagger-codegen
    """
    def __init__(self, req_wrapper=None):
        if req_wrapper is None:
            self.client = RequestWrapper()
        else:
            self.client = req_wrapper
        if 'SI_UUID' in self.client.config:
            self.si_uuid = self.client.config['SI_UUID']
        else:
            self.si_uuid = None

    def logging_set_archive_days(self, days, **kwargs):  # noqa: E501
        """Archive logs  # noqa: E501

        Archives all logs older than specified number of days.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.logging_set_archive_days(days, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param float days: Number of days. (required)
        :return: str
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.logging_archive_days_put_with_http_info(
                days, **kwargs)  # noqa: E501
        else:
            (data) = self.logging_archive_days_put_with_http_info(
                days, **kwargs)  # noqa: E501
            return data

    def logging_archive_days_put_with_http_info(self, days,
                                                **kwargs):  # noqa: E501
        """Archive logs  # noqa: E501

        Archives all logs older than specified number of days.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.logging_archive_days_put_with_http_info(days, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param float days: Number of days. (required)
        :return: str
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['days']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method logging_archive_days_put" % key)
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'days' is set
        if ('days' not in params or params['days'] is None):
            raise ValueError(
                "Missing the required parameter `days` when calling `logging_archive_days_put`"
            )  # noqa: E501

        path_params = {}
        if 'days' in params:
            path_params['days'] = params['days']  # noqa: E501

        return self.client.request('PUT', f'/logging/archive/{days}')

    def logging_get_config(self, **kwargs):  # noqa: E501
        """Get logging configuration  # noqa: E501

        Retrieves the logging levels for each layer as well as database usage metadata.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.logging_get_config(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :return: LoggingConfiguration
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.logging_config_get_with_http_info(**
                                                          kwargs)  # noqa: E501
        else:
            (data
             ) = self.logging_config_get_with_http_info(**kwargs)  # noqa: E501
            return data

    def logging_config_get_with_http_info(self, **kwargs):  # noqa: E501
        """Get logging configuration  # noqa: E501

        Retrieves the logging levels for each layer as well as database usage metadata.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.logging_config_get_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :return: LoggingConfiguration
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = []  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method logging_config_get" % key)
            params[key] = val
        del params['kwargs']

        return self.client.request('GET', f'/logging/config')

    def logging_set_logger_level(self, logger, level, **kwargs):  # noqa: E501
        """Set logger level  # noqa: E501

        Updates the logging level of the specified layer.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.logging_set_logger_level(logger, level, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str logger: Logging appender layer. (required)
        :param str level: Logging appender level. (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.logging_config_logger_level_put_with_http_info(
                logger, level, **kwargs)  # noqa: E501
        else:
            (data) = self.logging_config_logger_level_put_with_http_info(
                logger, level, **kwargs)  # noqa: E501
            return data

    def logging_config_logger_level_put_with_http_info(self, logger, level,
                                                       **kwargs):  # noqa: E501
        """Set logger level  # noqa: E501

        Updates the logging level of the specified layer.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.logging_config_logger_level_put_with_http_info(logger, level, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str logger: Logging appender layer. (required)
        :param str level: Logging appender level. (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['logger', 'level']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method logging_config_logger_level_put" %
                                key)
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'logger' is set
        if ('logger' not in params or params['logger'] is None):
            raise ValueError(
                "Missing the required parameter `logger` when calling `logging_config_logger_level_put`"
            )  # noqa: E501
        # verify the required parameter 'level' is set
        if ('level' not in params or params['level'] is None):
            raise ValueError(
                "Missing the required parameter `level` when calling `logging_config_logger_level_put`"
            )  # noqa: E501

        path_params = {}
        if 'logger' in params:
            path_params['logger'] = params['logger']  # noqa: E501
        if 'level' in params:
            path_params['level'] = params['level']  # noqa: E501

        return self.client.request('PUT', f'/logging/config/{logger}/{level}')

    def logging_set_filter(self, **kwargs):  # noqa: E501
        """Set logger filter  # noqa: E501

        Updates the logging filter with a new configuration string.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.logging_set_filter(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str body: Configuration string. "Use raw" will filter over the raw logging message before processing, and "pattern" is the regex itself.
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.logging_filter_put_with_http_info(**
                                                          kwargs)  # noqa: E501
        else:
            (data
             ) = self.logging_filter_put_with_http_info(**kwargs)  # noqa: E501
            return data

    def logging_filter_put_with_http_info(self, **kwargs):  # noqa: E501
        """Set logger filter  # noqa: E501

        Updates the logging filter with a new configuration string.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.logging_filter_put_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str body: Configuration string. "Use raw" will filter over the raw logging message before processing, and "pattern" is the regex itself.
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['body']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method logging_filter_put" % key)
            params[key] = val
        del params['kwargs']

        body_params = None
        if 'body' in params:
            body_params = params['body']

        return self.client.request('PUT',
                                   f'/logging/filter',
                                   body_params=body_params)

    def instance_get_logging(self, **kwargs):  # noqa: E501
        """Retrieve intents by service instance  # noqa: E501

        Queries all service intents belonging to given instance UUID.  # noqa: E501
        This method makes a synchronous HTTP request by default.
        :param async_req bool
        :param str si_uuid: Intent UUID. (required)
        :return: list[IntentExpanded]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        if self.si_uuid:
            kwargs['si_uuid'] = self.si_uuid
        if not kwargs['si_uuid']:
            raise ValueError("Missing the required parameter `si_uuid`")

        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.logging_logs_si_uuid_get_with_http_info(
                **kwargs)  # noqa: E501
        else:
            (data) = self.logging_logs_si_uuid_get_with_http_info(
                **kwargs)  # noqa: E501
            return data

    def logging_logs_si_uuid_get_with_http_info(self, **kwargs):  # noqa: E501
        """Retrieve intents by service instance  # noqa: E501

        Queries all service intents belonging to given instance UUID.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.logging_logs_si_uuid_get_with_http_info(si_uuid, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str si_uuid: Intent UUID. (required)
        :return: list[IntentExpanded]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['si_uuid']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method logging_logs_si_uuid_get_with_http_info" % key)
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'si_uuid' is set
        if ('si_uuid' not in params or params['si_uuid'] is None):
            raise ValueError(
                "Missing the required parameter `si_uuid` when calling `logging_logs_si_uuid_get_with_http_info`"
            )  # noqa: E501

        return self.client.request('GET', '/logging/logs/' + kwargs['si_uuid'])
예제 #9
0
class IntentApi(object):
    """NOTE: This class is auto generated by the swagger code generator program.

    Do not edit the class manually.
    Ref: https://github.com/swagger-api/swagger-codegen
    """
    def __init__(self, req_wrapper=None):
        if req_wrapper is None:
            self.client = RequestWrapper()
        else:
            self.client = req_wrapper
        if 'SI_UUID' in self.client.config:
            self.si_uuid = self.client.config['SI_UUID']
        else:
            self.si_uuid = None

    def instance_get_intents(self, **kwargs):  # noqa: E501
        """Retrieve intents by service instance  # noqa: E501

        Queries all service intents belonging to given instance UUID.  # noqa: E501
        This method makes a synchronous HTTP request by default.
        :param async_req bool
        :param str si_uuid: Intent UUID. (required)
        :return: list[IntentExpanded]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        if self.si_uuid:
            kwargs['si_uuid'] = self.si_uuid
        if not kwargs['si_uuid']:
            raise ValueError("Missing the required parameter `si_uuid`")

        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.intent_instance_si_uuid_get_with_http_info(
                **kwargs)  # noqa: E501
        else:
            (data) = self.intent_instance_si_uuid_get_with_http_info(
                **kwargs)  # noqa: E501
            return data

    def intent_instance_si_uuid_get_with_http_info(self,
                                                   **kwargs):  # noqa: E501
        """Retrieve intents by service instance  # noqa: E501

        Queries all service intents belonging to given instance UUID.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.intent_instance_si_uuid_get_with_http_info(si_uuid, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str si_uuid: Intent UUID. (required)
        :return: list[IntentExpanded]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['si_uuid']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method intent_instance_si_uuid_get" % key)
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'si_uuid' is set
        if ('si_uuid' not in params or params['si_uuid'] is None):
            raise ValueError(
                "Missing the required parameter `si_uuid` when calling `intent_instance_si_uuid_get`"
            )  # noqa: E501

        return self.client.request('GET',
                                   '/intent/instance/' + kwargs['si_uuid'])

    def intent_describe(self, uuid, **kwargs):  # noqa: E501
        """Retrieve intent by UUID  # noqa: E501

        Queries service intent with given ID.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.intent_describe(uuid, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str uuid: Intent UUID. (required)
        :return: Intent
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.intent_uuid_get_with_http_info(uuid,
                                                       **kwargs)  # noqa: E501
        else:
            (data) = self.intent_uuid_get_with_http_info(
                uuid, **kwargs)  # noqa: E501
            return data

    def intent_uuid_get_with_http_info(self, uuid, **kwargs):  # noqa: E501
        """Retrieve intent by UUID  # noqa: E501

        Queries service intent with given ID.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.intent_uuid_get_with_http_info(uuid, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str uuid: Intent UUID. (required)
        :return: Intent
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['uuid']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError("Got an unexpected keyword argument '%s'"
                                " to method intent_uuid_get" % key)
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'uuid' is set
        if ('uuid' not in params or params['uuid'] is None):
            raise ValueError(
                "Missing the required parameter `uuid` when calling `intent_uuid_get`"
            )  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'uuid' in params:
            path_params['uuid'] = params['uuid']  # noqa: E501

        # Authentication setting
        auth_settings = ['oAuth2Keycloak']  # noqa: E501

        return self.client.request('GET', '/intent/' + uuid)