|
|
|
@@ -75,24 +75,6 @@ def exception_handler_v20(status_code, error_content):
|
|
|
|
|
message=msg)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class APIParamsCall(object):
|
|
|
|
|
"""A Decorator to add support for format and tenant overriding
|
|
|
|
|
and filters
|
|
|
|
|
"""
|
|
|
|
|
def __init__(self, function):
|
|
|
|
|
self.function = function
|
|
|
|
|
|
|
|
|
|
def __get__(self, instance, owner):
|
|
|
|
|
def with_params(*args, **kwargs):
|
|
|
|
|
_format = instance.format
|
|
|
|
|
if 'format' in kwargs:
|
|
|
|
|
instance.format = kwargs['format']
|
|
|
|
|
ret = self.function(instance, *args, **kwargs)
|
|
|
|
|
instance.format = _format
|
|
|
|
|
return ret
|
|
|
|
|
return with_params
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Client(clientV2_0.Client):
|
|
|
|
|
"""Client for the GBP API.
|
|
|
|
|
|
|
|
|
@@ -193,30 +175,25 @@ class Client(clientV2_0.Client):
|
|
|
|
|
# 8192 Is the default max URI len for eventlet.wsgi.server
|
|
|
|
|
MAX_URI_LEN = 8192
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def list_extensions(self, **_params):
|
|
|
|
|
"""Fetch a list of all exts on server side."""
|
|
|
|
|
return self.get(self.extensions_path, params=_params)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def show_extension(self, ext_alias, **_params):
|
|
|
|
|
"""Fetch a list of all exts on server side."""
|
|
|
|
|
return self.get(self.extension_path % ext_alias, params=_params)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def list_policy_targets(self, retrieve_all=True, **_params):
|
|
|
|
|
"""Fetches a list of all policy targets for a tenant."""
|
|
|
|
|
# Pass filters in "params" argument to do_request
|
|
|
|
|
return self.list('policy_targets', self.policy_targets_path,
|
|
|
|
|
retrieve_all, **_params)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def show_policy_target(self, policy_target, **_params):
|
|
|
|
|
"""Fetches information of a certain policy target."""
|
|
|
|
|
return self.get(self.policy_target_path % (policy_target),
|
|
|
|
|
params=_params)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def list_application_policy_groups(self, retrieve_all=True, **_params):
|
|
|
|
|
"""Fetches a list of all application_policy_groups for a tenant."""
|
|
|
|
|
# Pass filters in "params" argument to do_request
|
|
|
|
@@ -224,19 +201,16 @@ class Client(clientV2_0.Client):
|
|
|
|
|
self.application_policy_groups_path,
|
|
|
|
|
retrieve_all, **_params)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def show_application_policy_group(
|
|
|
|
|
self, application_policy_group, **_params):
|
|
|
|
|
"""Fetches information of a certain application_policy_group."""
|
|
|
|
|
return self.get(self.application_policy_group_path % (
|
|
|
|
|
application_policy_group), params=_params)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def create_application_policy_group(self, body=None):
|
|
|
|
|
"""Creates a new application_policy_group."""
|
|
|
|
|
return self.post(self.application_policy_groups_path, body=body)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def update_application_policy_group(
|
|
|
|
|
self, application_policy_group, body=None):
|
|
|
|
|
"""Updates a application_policy_group."""
|
|
|
|
@@ -244,28 +218,23 @@ class Client(clientV2_0.Client):
|
|
|
|
|
self.application_policy_group_path % (application_policy_group),
|
|
|
|
|
body=body)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def delete_application_policy_group(self, application_policy_group):
|
|
|
|
|
"""Deletes the specified application_policy_group."""
|
|
|
|
|
return self.delete(
|
|
|
|
|
self.application_policy_group_path % (application_policy_group))
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def create_policy_target(self, body=None):
|
|
|
|
|
"""Creates a new policy target."""
|
|
|
|
|
return self.post(self.policy_targets_path, body=body)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def update_policy_target(self, policy_target, body=None):
|
|
|
|
|
"""Updates a policy target."""
|
|
|
|
|
return self.put(self.policy_target_path % (policy_target), body=body)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def delete_policy_target(self, policy_target):
|
|
|
|
|
"""Deletes the specified policy target."""
|
|
|
|
|
return self.delete(self.policy_target_path % (policy_target))
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def list_policy_target_groups(self, retrieve_all=True, **_params):
|
|
|
|
|
"""Fetches a list of all policy target_groups for a tenant."""
|
|
|
|
|
# Pass filters in "params" argument to do_request
|
|
|
|
@@ -273,58 +242,48 @@ class Client(clientV2_0.Client):
|
|
|
|
|
self.policy_target_groups_path, retrieve_all,
|
|
|
|
|
**_params)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def show_policy_target_group(self, policy_target_group, **_params):
|
|
|
|
|
"""Fetches information of a certain policy target_group."""
|
|
|
|
|
return self.get(self.policy_target_group_path % (policy_target_group),
|
|
|
|
|
params=_params)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def create_policy_target_group(self, body=None):
|
|
|
|
|
"""Creates a new policy target_group."""
|
|
|
|
|
return self.post(self.policy_target_groups_path, body=body)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def update_policy_target_group(self, policy_target_group, body=None):
|
|
|
|
|
"""Updates a policy target_group."""
|
|
|
|
|
return self.put(self.policy_target_group_path % (policy_target_group),
|
|
|
|
|
body=body)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def delete_policy_target_group(self, policy_target_group):
|
|
|
|
|
"""Deletes the specified policy target_group."""
|
|
|
|
|
return self.delete(
|
|
|
|
|
self.policy_target_group_path % (policy_target_group))
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def list_l2_policies(self, retrieve_all=True, **_params):
|
|
|
|
|
"""Fetches a list of all l2_policies for a tenant."""
|
|
|
|
|
# Pass filters in "params" argument to do_request
|
|
|
|
|
return self.list('l2_policies', self.l2_policies_path,
|
|
|
|
|
retrieve_all, **_params)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def show_l2_policy(self, l2_policy, **_params):
|
|
|
|
|
"""Fetches information of a certain l2_policy."""
|
|
|
|
|
return self.get(self.l2_policy_path % (l2_policy),
|
|
|
|
|
params=_params)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def create_l2_policy(self, body=None):
|
|
|
|
|
"""Creates a new l2_policy."""
|
|
|
|
|
return self.post(self.l2_policies_path, body=body)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def update_l2_policy(self, l2_policy, body=None):
|
|
|
|
|
"""Updates a l2_policy."""
|
|
|
|
|
return self.put(self.l2_policy_path % (l2_policy), body=body)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def delete_l2_policy(self, l2_policy):
|
|
|
|
|
"""Deletes the specified l2_policy."""
|
|
|
|
|
return self.delete(self.l2_policy_path % (l2_policy))
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def list_network_service_policies(self, retrieve_all=True, **_params):
|
|
|
|
|
"""Fetches a list of all network_service_policies for a tenant."""
|
|
|
|
|
# Pass filters in "params" argument to do_request
|
|
|
|
@@ -332,32 +291,27 @@ class Client(clientV2_0.Client):
|
|
|
|
|
self.network_service_policies_path,
|
|
|
|
|
retrieve_all, **_params)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def show_network_service_policy(self, network_service_policy, **_params):
|
|
|
|
|
"""Fetches information of a certain network_service_policy."""
|
|
|
|
|
return self.get(
|
|
|
|
|
self.network_service_policy_path % (network_service_policy),
|
|
|
|
|
params=_params)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def create_network_service_policy(self, body=None):
|
|
|
|
|
"""Creates a new network_service_policy."""
|
|
|
|
|
return self.post(self.network_service_policies_path, body=body)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def update_network_service_policy(self, network_service_policy, body=None):
|
|
|
|
|
"""Updates a network_service_policy."""
|
|
|
|
|
return self.put(
|
|
|
|
|
self.network_service_policy_path % (network_service_policy),
|
|
|
|
|
body=body)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def delete_network_service_policy(self, network_service_policy):
|
|
|
|
|
"""Deletes the specified network_service_policy."""
|
|
|
|
|
return self.delete(
|
|
|
|
|
self.network_service_policy_path % (network_service_policy))
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def list_external_policies(self, retrieve_all=True, **_params):
|
|
|
|
|
"""Fetches a list of all external_policies for a tenant."""
|
|
|
|
|
# Pass filters in "params" argument to do_request
|
|
|
|
@@ -365,32 +319,27 @@ class Client(clientV2_0.Client):
|
|
|
|
|
self.external_policies_path,
|
|
|
|
|
retrieve_all, **_params)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def show_external_policy(self, external_policy, **_params):
|
|
|
|
|
"""Fetches information of a certain external_policy."""
|
|
|
|
|
return self.get(
|
|
|
|
|
self.external_policy_path % (external_policy),
|
|
|
|
|
params=_params)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def create_external_policy(self, body=None):
|
|
|
|
|
"""Creates a new external_policy."""
|
|
|
|
|
return self.post(self.external_policies_path, body=body)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def update_external_policy(self, external_policy, body=None):
|
|
|
|
|
"""Updates a external_policy."""
|
|
|
|
|
return self.put(
|
|
|
|
|
self.external_policy_path % (external_policy),
|
|
|
|
|
body=body)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def delete_external_policy(self, external_policy):
|
|
|
|
|
"""Deletes the specified external_policy."""
|
|
|
|
|
return self.delete(
|
|
|
|
|
self.external_policy_path % (external_policy))
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def list_external_segments(self, retrieve_all=True, **_params):
|
|
|
|
|
"""Fetches a list of all external_segments for a tenant."""
|
|
|
|
|
# Pass filters in "params" argument to do_request
|
|
|
|
@@ -398,32 +347,27 @@ class Client(clientV2_0.Client):
|
|
|
|
|
self.external_segments_path,
|
|
|
|
|
retrieve_all, **_params)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def show_external_segment(self, external_segment, **_params):
|
|
|
|
|
"""Fetches information of a certain external_segment."""
|
|
|
|
|
return self.get(
|
|
|
|
|
self.external_segment_path % (external_segment),
|
|
|
|
|
params=_params)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def create_external_segment(self, body=None):
|
|
|
|
|
"""Creates a new external_segment."""
|
|
|
|
|
return self.post(self.external_segments_path, body=body)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def update_external_segment(self, external_segment, body=None):
|
|
|
|
|
"""Updates a external_segment."""
|
|
|
|
|
return self.put(
|
|
|
|
|
self.external_segment_path % (external_segment),
|
|
|
|
|
body=body)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def delete_external_segment(self, external_segment):
|
|
|
|
|
"""Deletes the specified external_segment."""
|
|
|
|
|
return self.delete(
|
|
|
|
|
self.external_segment_path % (external_segment))
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def list_nat_pools(self, retrieve_all=True, **_params):
|
|
|
|
|
"""Fetches a list of all nat_pools for a tenant."""
|
|
|
|
|
# Pass filters in "params" argument to do_request
|
|
|
|
@@ -431,169 +375,139 @@ class Client(clientV2_0.Client):
|
|
|
|
|
self.nat_pools_path,
|
|
|
|
|
retrieve_all, **_params)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def show_nat_pool(self, nat_pool, **_params):
|
|
|
|
|
"""Fetches information of a certain nat_pool."""
|
|
|
|
|
return self.get(self.nat_pool_path % (nat_pool), params=_params)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def create_nat_pool(self, body=None):
|
|
|
|
|
"""Creates a new nat_pool."""
|
|
|
|
|
return self.post(self.nat_pools_path, body=body)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def update_nat_pool(self, nat_pool, body=None):
|
|
|
|
|
"""Updates a nat_pool."""
|
|
|
|
|
return self.put(self.nat_pool_path % (nat_pool), body=body)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def delete_nat_pool(self, nat_pool):
|
|
|
|
|
"""Deletes the specified nat_pool."""
|
|
|
|
|
return self.delete(self.nat_pool_path % (nat_pool))
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def list_l3_policies(self, retrieve_all=True, **_params):
|
|
|
|
|
"""Fetches a list of all l3_policies for a tenant."""
|
|
|
|
|
# Pass filters in "params" argument to do_request
|
|
|
|
|
return self.list('l3_policies', self.l3_policies_path,
|
|
|
|
|
retrieve_all, **_params)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def show_l3_policy(self, l3_policy, **_params):
|
|
|
|
|
"""Fetches information of a certain l3_policy."""
|
|
|
|
|
return self.get(self.l3_policy_path % (l3_policy),
|
|
|
|
|
params=_params)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def create_l3_policy(self, body=None):
|
|
|
|
|
"""Creates a new l3_policy."""
|
|
|
|
|
return self.post(self.l3_policies_path, body=body)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def update_l3_policy(self, l3_policy, body=None):
|
|
|
|
|
"""Updates a l3_policy."""
|
|
|
|
|
return self.put(self.l3_policy_path % (l3_policy),
|
|
|
|
|
body=body)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def delete_l3_policy(self, l3_policy):
|
|
|
|
|
"""Deletes the specified l3_policy."""
|
|
|
|
|
return self.delete(self.l3_policy_path % (l3_policy))
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def list_policy_classifiers(self, retrieve_all=True, **_params):
|
|
|
|
|
"""Fetches a list of all policy_classifiers for a tenant."""
|
|
|
|
|
# Pass filters in "params" argument to do_request
|
|
|
|
|
return self.list('policy_classifiers', self.policy_classifiers_path,
|
|
|
|
|
retrieve_all, **_params)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def show_policy_classifier(self, policy_classifier, **_params):
|
|
|
|
|
"""Fetches information of a certain policy_classifier."""
|
|
|
|
|
return self.get(self.policy_classifier_path % (policy_classifier),
|
|
|
|
|
params=_params)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def create_policy_classifier(self, body=None):
|
|
|
|
|
"""Creates a new policy_classifier."""
|
|
|
|
|
return self.post(self.policy_classifiers_path, body=body)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def update_policy_classifier(self, policy_classifier, body=None):
|
|
|
|
|
"""Updates a policy_classifier."""
|
|
|
|
|
return self.put(self.policy_classifier_path % (policy_classifier),
|
|
|
|
|
body=body)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def delete_policy_classifier(self, policy_classifier):
|
|
|
|
|
"""Deletes the specified policy_classifier."""
|
|
|
|
|
return self.delete(self.policy_classifier_path % (policy_classifier))
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def list_policy_actions(self, retrieve_all=True, **_params):
|
|
|
|
|
"""Fetches a list of all policy_actions for a tenant."""
|
|
|
|
|
# Pass filters in "params" argument to do_request
|
|
|
|
|
return self.list('policy_actions', self.policy_actions_path,
|
|
|
|
|
retrieve_all, **_params)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def show_policy_action(self, policy_action, **_params):
|
|
|
|
|
"""Fetches information of a certain policy_action."""
|
|
|
|
|
return self.get(self.policy_action_path % (policy_action),
|
|
|
|
|
params=_params)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def create_policy_action(self, body=None):
|
|
|
|
|
"""Creates a new policy_action."""
|
|
|
|
|
return self.post(self.policy_actions_path, body=body)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def update_policy_action(self, policy_action, body=None):
|
|
|
|
|
"""Updates a policy_action."""
|
|
|
|
|
return self.put(self.policy_action_path % (policy_action), body=body)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def delete_policy_action(self, policy_action):
|
|
|
|
|
"""Deletes the specified policy_action."""
|
|
|
|
|
return self.delete(self.policy_action_path % (policy_action))
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def list_policy_rules(self, retrieve_all=True, **_params):
|
|
|
|
|
"""Fetches a list of all policy_rules for a tenant."""
|
|
|
|
|
# Pass filters in "params" argument to do_request
|
|
|
|
|
return self.list('policy_rules', self.policy_rules_path, retrieve_all,
|
|
|
|
|
**_params)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def show_policy_rule(self, policy_rule, **_params):
|
|
|
|
|
"""Fetches information of a certain policy_rule."""
|
|
|
|
|
return self.get(self.policy_rule_path % (policy_rule), params=_params)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def create_policy_rule(self, body=None):
|
|
|
|
|
"""Creates a new policy_rule."""
|
|
|
|
|
return self.post(self.policy_rules_path, body=body)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def update_policy_rule(self, policy_rule, body=None):
|
|
|
|
|
"""Updates a policy_rule."""
|
|
|
|
|
return self.put(self.policy_rule_path % (policy_rule), body=body)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def delete_policy_rule(self, policy_rule):
|
|
|
|
|
"""Deletes the specified policy_rule."""
|
|
|
|
|
return self.delete(self.policy_rule_path % (policy_rule))
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def list_policy_rule_sets(self, retrieve_all=True, **_params):
|
|
|
|
|
"""Fetches a list of all Policy Rule Sets for a tenant."""
|
|
|
|
|
# Pass filters in "params" argument to do_request
|
|
|
|
|
return self.list('policy_rule_sets', self.policy_rule_sets_path,
|
|
|
|
|
retrieve_all, **_params)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def show_policy_rule_set(self, policy_rule_set, **_params):
|
|
|
|
|
"""Fetches information of a certain Policy Rule Set."""
|
|
|
|
|
return self.get(self.policy_rule_set_path % (policy_rule_set),
|
|
|
|
|
params=_params)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def create_policy_rule_set(self, body=None):
|
|
|
|
|
"""Creates a new Policy Rule Set."""
|
|
|
|
|
return self.post(self.policy_rule_sets_path, body=body)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def update_policy_rule_set(self, policy_rule_set, body=None):
|
|
|
|
|
"""Updates a Policy Rule Set."""
|
|
|
|
|
return self.put(self.policy_rule_set_path % (policy_rule_set),
|
|
|
|
|
body=body)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def delete_policy_rule_set(self, policy_rule_set):
|
|
|
|
|
"""Deletes the specified Policy Rule Set."""
|
|
|
|
|
return self.delete(self.policy_rule_set_path % (policy_rule_set))
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def list_service_profiles(self, retrieve_all=True, **_params):
|
|
|
|
|
|
|
|
|
|
"""Fetches a list of all service profiles for a tenant."""
|
|
|
|
@@ -602,29 +516,24 @@ class Client(clientV2_0.Client):
|
|
|
|
|
return self.list('service_profiles', self.service_profiles_path,
|
|
|
|
|
retrieve_all, **_params)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def show_service_profile(self, service_profile, **_params):
|
|
|
|
|
"""Fetches information of a certain service profile."""
|
|
|
|
|
return self.get(self.service_profile_path % (service_profile),
|
|
|
|
|
params=_params)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def create_service_profile(self, body=None):
|
|
|
|
|
"""Creates a new service profile."""
|
|
|
|
|
return self.post(self.service_profiles_path, body=body)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def update_service_profile(self, service_profile, body=None):
|
|
|
|
|
"""Updates a service profile."""
|
|
|
|
|
return self.put(self.service_profile_path % (service_profile),
|
|
|
|
|
body=body)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def delete_service_profile(self, service_profile):
|
|
|
|
|
"""Deletes the specified service profile."""
|
|
|
|
|
return self.delete(self.service_profile_path % (service_profile))
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def list_servicechain_nodes(self, retrieve_all=True, **_params):
|
|
|
|
|
|
|
|
|
|
"""Fetches a list of all service chain nodes for a tenant."""
|
|
|
|
@@ -633,29 +542,24 @@ class Client(clientV2_0.Client):
|
|
|
|
|
return self.list('servicechain_nodes', self.servicechain_nodes_path,
|
|
|
|
|
retrieve_all, **_params)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def show_servicechain_node(self, servicechain_node, **_params):
|
|
|
|
|
"""Fetches information of a certain service chain node."""
|
|
|
|
|
return self.get(self.servicechain_node_path % (servicechain_node),
|
|
|
|
|
params=_params)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def create_servicechain_node(self, body=None):
|
|
|
|
|
"""Creates a new service chain node."""
|
|
|
|
|
return self.post(self.servicechain_nodes_path, body=body)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def update_servicechain_node(self, servicechain_node, body=None):
|
|
|
|
|
"""Updates a service chain node."""
|
|
|
|
|
return self.put(self.servicechain_node_path % (servicechain_node),
|
|
|
|
|
body=body)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def delete_servicechain_node(self, servicechain_node):
|
|
|
|
|
"""Deletes the specified service chain node."""
|
|
|
|
|
return self.delete(self.servicechain_node_path % (servicechain_node))
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def list_servicechain_specs(self, retrieve_all=True, **_params):
|
|
|
|
|
"""Fetches a list of all service chain specs for a tenant."""
|
|
|
|
|
# Pass filters in "params" argument to do_request
|
|
|
|
@@ -663,29 +567,24 @@ class Client(clientV2_0.Client):
|
|
|
|
|
return self.list('servicechain_specs', self.servicechain_specs_path,
|
|
|
|
|
retrieve_all, **_params)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def show_servicechain_spec(self, servicechain_spec, **_params):
|
|
|
|
|
"""Fetches information of a certain service chain spec."""
|
|
|
|
|
return self.get(self.servicechain_spec_path % (servicechain_spec),
|
|
|
|
|
params=_params)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def create_servicechain_spec(self, body=None):
|
|
|
|
|
"""Creates a new service chain spec."""
|
|
|
|
|
return self.post(self.servicechain_specs_path, body=body)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def update_servicechain_spec(self, servicechain_spec, body=None):
|
|
|
|
|
"""Updates a service chain spec."""
|
|
|
|
|
return self.put(self.servicechain_spec_path % (servicechain_spec),
|
|
|
|
|
body=body)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def delete_servicechain_spec(self, servicechain_spec):
|
|
|
|
|
"""Deletes the specified service chain spec."""
|
|
|
|
|
return self.delete(self.servicechain_spec_path % (servicechain_spec))
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def list_servicechain_instances(self, retrieve_all=True, **_params):
|
|
|
|
|
"""Fetches a list of all service chain instances for a tenant."""
|
|
|
|
|
# Pass filters in "params" argument to do_request
|
|
|
|
@@ -694,24 +593,20 @@ class Client(clientV2_0.Client):
|
|
|
|
|
self.servicechain_instances_path,
|
|
|
|
|
retrieve_all, **_params)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def show_servicechain_instance(self, servicechain_instance, **_params):
|
|
|
|
|
"""Fetches information of a certain service chain instance."""
|
|
|
|
|
return self.get(self.servicechain_instance_path %
|
|
|
|
|
(servicechain_instance), params=_params)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def create_servicechain_instance(self, body=None):
|
|
|
|
|
"""Creates a new service chain instance."""
|
|
|
|
|
return self.post(self.servicechain_instances_path, body=body)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def update_servicechain_instance(self, servicechain_instance, body=None):
|
|
|
|
|
"""Updates a service chain instance."""
|
|
|
|
|
return self.put(self.servicechain_instance_path %
|
|
|
|
|
(servicechain_instance), body=body)
|
|
|
|
|
|
|
|
|
|
@APIParamsCall
|
|
|
|
|
def delete_servicechain_instance(self, servicechain_instance):
|
|
|
|
|
"""Deletes the specified service chain instance."""
|
|
|
|
|
return self.delete(self.servicechain_instance_path %
|
|
|
|
|