huaweicloud-sdk-python-v3/huaweicloud-sdk-apig/huaweicloudsdkapig/v2/apig_client.py

4400 lines
160 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# coding: utf-8
from __future__ import absolute_import
import datetime
import re
import importlib
import six
from huaweicloudsdkcore.client import Client, ClientBuilder
from huaweicloudsdkcore.exceptions import exceptions
from huaweicloudsdkcore.utils import http_utils
from huaweicloudsdkcore.sdk_stream_request import SdkStreamRequest
class ApigClient(Client):
"""
:param configuration: .Configuration object for this client
:param pool_threads: The number of threads to use for async requests
to the API. More threads means more concurrent API requests.
"""
PRIMITIVE_TYPES = (float, bool, bytes, six.text_type) + six.integer_types
NATIVE_TYPES_MAPPING = {
'int': int,
'long': int if six.PY3 else long,
'float': float,
'str': str,
'bool': bool,
'date': datetime.date,
'datetime': datetime.datetime,
'object': object,
}
def __init__(self):
super(ApigClient, self).__init__()
self.model_package = importlib.import_module("huaweicloudsdkapig.v2.model")
self.preset_headers = {'User-Agent': 'HuaweiCloud-SDK-Python'}
@classmethod
def new_builder(cls, clazz=None):
if clazz is None:
return ClientBuilder(cls)
if clazz.__name__ != "ApigClient":
raise TypeError("client type error, support client type is ApigClient")
return ClientBuilder(clazz)
def associate_certificate_v2(self, request):
"""绑定域名证书
如果创建API时“定义API请求”使用HTTPS请求协议那么在独立域名中需要添加SSL证书。 本章节主要介绍为特定域名绑定证书。
:param AssociateCertificateV2Request request
:return: AssociateCertificateV2Response
"""
return self.associate_certificate_v2_with_http_info(request)
def associate_certificate_v2_with_http_info(self, request):
"""绑定域名证书
如果创建API时“定义API请求”使用HTTPS请求协议那么在独立域名中需要添加SSL证书。 本章节主要介绍为特定域名绑定证书。
:param AssociateCertificateV2Request request
:return: AssociateCertificateV2Response
"""
all_params = ['instance_id', 'domain_id', 'group_id', 'associate_certificate_v2_request_body']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
if 'domain_id' in local_var_params:
path_params['domain_id'] = local_var_params['domain_id']
if 'group_id' in local_var_params:
path_params['group_id'] = local_var_params['group_id']
query_params = []
header_params = {}
form_params = {}
body_params = None
if 'body' in local_var_params:
body_params = local_var_params['body']
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json;charset=UTF-8'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/api-groups/{group_id}/domains/{domain_id}/certificate',
method='POST',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='AssociateCertificateV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def associate_domain_v2(self, request):
"""绑定域名
用户自定义的域名需要CNAME到API分组的子域名上才能生效具体方法请参见[增加CNAME类型记录集](https://support.huaweicloud.com/usermanual-dns/dns_usermanual_0010.html)。 每个API分组下最多可绑定5个域名。绑定域名后用户可通过自定义域名调用API。
:param AssociateDomainV2Request request
:return: AssociateDomainV2Response
"""
return self.associate_domain_v2_with_http_info(request)
def associate_domain_v2_with_http_info(self, request):
"""绑定域名
用户自定义的域名需要CNAME到API分组的子域名上才能生效具体方法请参见[增加CNAME类型记录集](https://support.huaweicloud.com/usermanual-dns/dns_usermanual_0010.html)。 每个API分组下最多可绑定5个域名。绑定域名后用户可通过自定义域名调用API。
:param AssociateDomainV2Request request
:return: AssociateDomainV2Response
"""
all_params = ['instance_id', 'group_id', 'associate_domain_v2_request_body']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
if 'group_id' in local_var_params:
path_params['group_id'] = local_var_params['group_id']
query_params = []
header_params = {}
form_params = {}
body_params = None
if 'body' in local_var_params:
body_params = local_var_params['body']
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json;charset=UTF-8'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/api-groups/{group_id}/domains',
method='POST',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='AssociateDomainV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def associate_signature_key_v2(self, request):
"""绑定签名密钥
签名密钥创建后需要绑定到API才能生效。 将签名密钥绑定到API后则API网关请求后端服务时就会使用这个签名密钥进行加密签名后端服务可以校验这个签名来验证请求来源。 将指定的签名密钥绑定到一个或多个已发布的API上。同一个API发布到不同的环境可以绑定不同的签名密钥一个API在发布到特定环境后只能绑定一个签名密钥。
:param AssociateSignatureKeyV2Request request
:return: AssociateSignatureKeyV2Response
"""
return self.associate_signature_key_v2_with_http_info(request)
def associate_signature_key_v2_with_http_info(self, request):
"""绑定签名密钥
签名密钥创建后需要绑定到API才能生效。 将签名密钥绑定到API后则API网关请求后端服务时就会使用这个签名密钥进行加密签名后端服务可以校验这个签名来验证请求来源。 将指定的签名密钥绑定到一个或多个已发布的API上。同一个API发布到不同的环境可以绑定不同的签名密钥一个API在发布到特定环境后只能绑定一个签名密钥。
:param AssociateSignatureKeyV2Request request
:return: AssociateSignatureKeyV2Response
"""
all_params = ['instance_id', 'associate_signature_key_v2_request_body']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
query_params = []
header_params = {}
form_params = {}
body_params = None
if 'body' in local_var_params:
body_params = local_var_params['body']
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json;charset=UTF-8'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/sign-bindings',
method='POST',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='AssociateSignatureKeyV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def create_environment_v2(self, request):
"""创建环境
在实际的生产中API提供者可能有多个环境如开发环境、测试环境、生产环境等用户可以自由将API发布到某个环境供调用者调用。 对于不同的环境API的版本、请求地址甚至于包括请求消息等均有可能不同。如某个APIv1.0的版本为稳定版本发布到了生产环境供生产使用同时该API正处于迭代中v1.1的版本是开发人员交付测试人员进行测试的版本发布在测试环境上而v1.2的版本目前开发团队正处于开发过程中,可以发布到开发环境进行自测等。 为此API网关提供多环境管理功能使租户能够最大化的模拟实际场景低成本的接入API网关。
:param CreateEnvironmentV2Request request
:return: CreateEnvironmentV2Response
"""
return self.create_environment_v2_with_http_info(request)
def create_environment_v2_with_http_info(self, request):
"""创建环境
在实际的生产中API提供者可能有多个环境如开发环境、测试环境、生产环境等用户可以自由将API发布到某个环境供调用者调用。 对于不同的环境API的版本、请求地址甚至于包括请求消息等均有可能不同。如某个APIv1.0的版本为稳定版本发布到了生产环境供生产使用同时该API正处于迭代中v1.1的版本是开发人员交付测试人员进行测试的版本发布在测试环境上而v1.2的版本目前开发团队正处于开发过程中,可以发布到开发环境进行自测等。 为此API网关提供多环境管理功能使租户能够最大化的模拟实际场景低成本的接入API网关。
:param CreateEnvironmentV2Request request
:return: CreateEnvironmentV2Response
"""
all_params = ['instance_id', 'create_environment_v2_request_body']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
query_params = []
header_params = {}
form_params = {}
body_params = None
if 'body' in local_var_params:
body_params = local_var_params['body']
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json;charset=UTF-8'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/envs',
method='POST',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='CreateEnvironmentV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def create_environment_variable_v2(self, request):
"""新建变量
将API发布到不同的环境后对于不同的环境可能会有不同的环境变量比如API的服务部署地址请求的版本号等。 用户可以定义不同的环境变量用户在定义API时在API的定义中使用这些变量当调用API时API网关会将这些变量替换成真实的变量值以达到不同环境的区分效果。 环境变量定义在API分组上该分组下的所有API都可以使用这些变量。 > 1.环境变量的变量名称必须保持唯一,即一个分组在同一个环境上不能有两个同名的变量 2.环境变量区分大小写即变量ABC与变量abc是两个不同的变量 3.设置了环境变量后使用到该变量的API的调试功能将不可使用。 4.定义了环境变量后,使用到环境变量的地方应该以对称的#标识环境变量当API发布到相应的环境后会对环境变量的值进行替换定义的API的URL为https://#address#:8080环境变量address在RELEASE环境上的值为192.168.1.5则API发布到RELEASE环境后的真实的URL为https://192.168.1.5:8080。
:param CreateEnvironmentVariableV2Request request
:return: CreateEnvironmentVariableV2Response
"""
return self.create_environment_variable_v2_with_http_info(request)
def create_environment_variable_v2_with_http_info(self, request):
"""新建变量
将API发布到不同的环境后对于不同的环境可能会有不同的环境变量比如API的服务部署地址请求的版本号等。 用户可以定义不同的环境变量用户在定义API时在API的定义中使用这些变量当调用API时API网关会将这些变量替换成真实的变量值以达到不同环境的区分效果。 环境变量定义在API分组上该分组下的所有API都可以使用这些变量。 > 1.环境变量的变量名称必须保持唯一,即一个分组在同一个环境上不能有两个同名的变量 2.环境变量区分大小写即变量ABC与变量abc是两个不同的变量 3.设置了环境变量后使用到该变量的API的调试功能将不可使用。 4.定义了环境变量后,使用到环境变量的地方应该以对称的#标识环境变量当API发布到相应的环境后会对环境变量的值进行替换定义的API的URL为https://#address#:8080环境变量address在RELEASE环境上的值为192.168.1.5则API发布到RELEASE环境后的真实的URL为https://192.168.1.5:8080。
:param CreateEnvironmentVariableV2Request request
:return: CreateEnvironmentVariableV2Response
"""
all_params = ['instance_id', 'create_environment_variable_v2_request_body']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
query_params = []
header_params = {}
form_params = {}
body_params = None
if 'body' in local_var_params:
body_params = local_var_params['body']
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json;charset=UTF-8'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/env-variables',
method='POST',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='CreateEnvironmentVariableV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def create_request_throttling_policy_v2(self, request):
"""创建流控策略
当API上线后系统会默认给每个API提供一个流控策略API提供者可以根据自身API的服务能力及负载情况变更这个流控策略。 流控策略即限制API在一定长度的时间内能够允许被访问的最大次数。
:param CreateRequestThrottlingPolicyV2Request request
:return: CreateRequestThrottlingPolicyV2Response
"""
return self.create_request_throttling_policy_v2_with_http_info(request)
def create_request_throttling_policy_v2_with_http_info(self, request):
"""创建流控策略
当API上线后系统会默认给每个API提供一个流控策略API提供者可以根据自身API的服务能力及负载情况变更这个流控策略。 流控策略即限制API在一定长度的时间内能够允许被访问的最大次数。
:param CreateRequestThrottlingPolicyV2Request request
:return: CreateRequestThrottlingPolicyV2Response
"""
all_params = ['instance_id', 'create_request_throttling_policy_v2_request_body']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
query_params = []
header_params = {}
form_params = {}
body_params = None
if 'body' in local_var_params:
body_params = local_var_params['body']
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json;charset=UTF-8'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/throttles',
method='POST',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='CreateRequestThrottlingPolicyV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def create_signature_key_v2(self, request):
"""创建签名密钥
为了保护API的安全性建议租户为API的访问提供一套保护机制即租户开放的API需要对请求来源进行认证不符合认证的请求直接拒绝访问。 其中签名密钥就是API安全保护机制的一种。 租户创建一个签名密钥并将签名密钥与API进行绑定则API网关在请求这个API时就会使用绑定的签名密钥对请求参数进行数据加密生成签名。当租户的后端服务收到请求时可以校验这个签名如果签名校验不通过则该请求不是API网关发出的请求租户可以拒绝这个请求从而保证API的安全性避免API被未知来源的请求攻击。
:param CreateSignatureKeyV2Request request
:return: CreateSignatureKeyV2Response
"""
return self.create_signature_key_v2_with_http_info(request)
def create_signature_key_v2_with_http_info(self, request):
"""创建签名密钥
为了保护API的安全性建议租户为API的访问提供一套保护机制即租户开放的API需要对请求来源进行认证不符合认证的请求直接拒绝访问。 其中签名密钥就是API安全保护机制的一种。 租户创建一个签名密钥并将签名密钥与API进行绑定则API网关在请求这个API时就会使用绑定的签名密钥对请求参数进行数据加密生成签名。当租户的后端服务收到请求时可以校验这个签名如果签名校验不通过则该请求不是API网关发出的请求租户可以拒绝这个请求从而保证API的安全性避免API被未知来源的请求攻击。
:param CreateSignatureKeyV2Request request
:return: CreateSignatureKeyV2Response
"""
all_params = ['instance_id', 'create_signature_key_v2_request_body']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
query_params = []
header_params = {}
form_params = {}
body_params = None
if 'body' in local_var_params:
body_params = local_var_params['body']
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json;charset=UTF-8'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/signs',
method='POST',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='CreateSignatureKeyV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def create_special_throttling_configuration_v2(self, request):
"""创建特殊设置
流控策略可以限制一段时间内可以访问API的最大次数也可以限制一段时间内单个租户和单个APP可以访问API的最大次数。 如果想要对某个特定的APP进行特殊设置例如设置所有APP每分钟的访问次数为500次但想设置APP1每分钟的访问次数为800次可以通过在流控策略中设置特殊APP来实现该功能。 为流控策略添加一个特殊设置的对象可以是APP也可以是租户。
:param CreateSpecialThrottlingConfigurationV2Request request
:return: CreateSpecialThrottlingConfigurationV2Response
"""
return self.create_special_throttling_configuration_v2_with_http_info(request)
def create_special_throttling_configuration_v2_with_http_info(self, request):
"""创建特殊设置
流控策略可以限制一段时间内可以访问API的最大次数也可以限制一段时间内单个租户和单个APP可以访问API的最大次数。 如果想要对某个特定的APP进行特殊设置例如设置所有APP每分钟的访问次数为500次但想设置APP1每分钟的访问次数为800次可以通过在流控策略中设置特殊APP来实现该功能。 为流控策略添加一个特殊设置的对象可以是APP也可以是租户。
:param CreateSpecialThrottlingConfigurationV2Request request
:return: CreateSpecialThrottlingConfigurationV2Response
"""
all_params = ['instance_id', 'throttle_id', 'create_special_throttling_configuration_v2_request_body']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
if 'throttle_id' in local_var_params:
path_params['throttle_id'] = local_var_params['throttle_id']
query_params = []
header_params = {}
form_params = {}
body_params = None
if 'body' in local_var_params:
body_params = local_var_params['body']
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json;charset=UTF-8'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/throttles/{throttle_id}/throttle-specials',
method='POST',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='CreateSpecialThrottlingConfigurationV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def delete_environment_v2(self, request):
"""删除环境
删除指定的环境。 该操作将导致此API在指定的环境无法被访问可能会影响相当一部分应用和用户。请确保已经告知用户或者确认需要强制下线。
:param DeleteEnvironmentV2Request request
:return: DeleteEnvironmentV2Response
"""
return self.delete_environment_v2_with_http_info(request)
def delete_environment_v2_with_http_info(self, request):
"""删除环境
删除指定的环境。 该操作将导致此API在指定的环境无法被访问可能会影响相当一部分应用和用户。请确保已经告知用户或者确认需要强制下线。
:param DeleteEnvironmentV2Request request
:return: DeleteEnvironmentV2Response
"""
all_params = ['instance_id', 'env_id']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
if 'env_id' in local_var_params:
path_params['env_id'] = local_var_params['env_id']
query_params = []
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/envs/{env_id}',
method='DELETE',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='DeleteEnvironmentV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def delete_environment_variable_v2(self, request):
"""删除变量
删除指定的环境变量。
:param DeleteEnvironmentVariableV2Request request
:return: DeleteEnvironmentVariableV2Response
"""
return self.delete_environment_variable_v2_with_http_info(request)
def delete_environment_variable_v2_with_http_info(self, request):
"""删除变量
删除指定的环境变量。
:param DeleteEnvironmentVariableV2Request request
:return: DeleteEnvironmentVariableV2Response
"""
all_params = ['instance_id', 'env_variable_id']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
if 'env_variable_id' in local_var_params:
path_params['env_variable_id'] = local_var_params['env_variable_id']
query_params = []
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/env-variables/{env_variable_id}',
method='DELETE',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='DeleteEnvironmentVariableV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def delete_request_throttling_policy_v2(self, request):
"""删除流控策略
删除指定的流控策略,以及该流控策略与API的所有绑定关系。
:param DeleteRequestThrottlingPolicyV2Request request
:return: DeleteRequestThrottlingPolicyV2Response
"""
return self.delete_request_throttling_policy_v2_with_http_info(request)
def delete_request_throttling_policy_v2_with_http_info(self, request):
"""删除流控策略
删除指定的流控策略,以及该流控策略与API的所有绑定关系。
:param DeleteRequestThrottlingPolicyV2Request request
:return: DeleteRequestThrottlingPolicyV2Response
"""
all_params = ['instance_id', 'throttle_id']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
if 'throttle_id' in local_var_params:
path_params['throttle_id'] = local_var_params['throttle_id']
query_params = []
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/throttles/{throttle_id}',
method='DELETE',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='DeleteRequestThrottlingPolicyV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def delete_signature_key_v2(self, request):
"""删除签名密钥
删除指定的签名密钥,删除签名密钥时,其配置的绑定关系会一并删除,相应的签名密钥会失效。
:param DeleteSignatureKeyV2Request request
:return: DeleteSignatureKeyV2Response
"""
return self.delete_signature_key_v2_with_http_info(request)
def delete_signature_key_v2_with_http_info(self, request):
"""删除签名密钥
删除指定的签名密钥,删除签名密钥时,其配置的绑定关系会一并删除,相应的签名密钥会失效。
:param DeleteSignatureKeyV2Request request
:return: DeleteSignatureKeyV2Response
"""
all_params = ['instance_id', 'sign_id']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
if 'sign_id' in local_var_params:
path_params['sign_id'] = local_var_params['sign_id']
query_params = []
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/signs/{sign_id}',
method='DELETE',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='DeleteSignatureKeyV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def delete_special_throttling_configuration_v2(self, request):
"""删除特殊设置
删除某个流控策略的某个特殊配置。
:param DeleteSpecialThrottlingConfigurationV2Request request
:return: DeleteSpecialThrottlingConfigurationV2Response
"""
return self.delete_special_throttling_configuration_v2_with_http_info(request)
def delete_special_throttling_configuration_v2_with_http_info(self, request):
"""删除特殊设置
删除某个流控策略的某个特殊配置。
:param DeleteSpecialThrottlingConfigurationV2Request request
:return: DeleteSpecialThrottlingConfigurationV2Response
"""
all_params = ['instance_id', 'throttle_id', 'strategy_id']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
if 'throttle_id' in local_var_params:
path_params['throttle_id'] = local_var_params['throttle_id']
if 'strategy_id' in local_var_params:
path_params['strategy_id'] = local_var_params['strategy_id']
query_params = []
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/throttles/{throttle_id}/throttle-specials/{strategy_id}',
method='DELETE',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='DeleteSpecialThrottlingConfigurationV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def disassociate_certificate_v2(self, request):
"""删除域名证书
如果域名证书不再需要或者已过期,则可以删除证书内容。
:param DisassociateCertificateV2Request request
:return: DisassociateCertificateV2Response
"""
return self.disassociate_certificate_v2_with_http_info(request)
def disassociate_certificate_v2_with_http_info(self, request):
"""删除域名证书
如果域名证书不再需要或者已过期,则可以删除证书内容。
:param DisassociateCertificateV2Request request
:return: DisassociateCertificateV2Response
"""
all_params = ['instance_id', 'domain_id', 'group_id', 'certificate_id']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
if 'domain_id' in local_var_params:
path_params['domain_id'] = local_var_params['domain_id']
if 'group_id' in local_var_params:
path_params['group_id'] = local_var_params['group_id']
if 'certificate_id' in local_var_params:
path_params['certificate_id'] = local_var_params['certificate_id']
query_params = []
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/api-groups/{group_id}/domains/{domain_id}/certificate/{certificate_id}',
method='DELETE',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='DisassociateCertificateV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def disassociate_domain_v2(self, request):
"""解绑域名
如果API分组不再需要绑定某个自定义域名则可以为此API分组解绑此域名。
:param DisassociateDomainV2Request request
:return: DisassociateDomainV2Response
"""
return self.disassociate_domain_v2_with_http_info(request)
def disassociate_domain_v2_with_http_info(self, request):
"""解绑域名
如果API分组不再需要绑定某个自定义域名则可以为此API分组解绑此域名。
:param DisassociateDomainV2Request request
:return: DisassociateDomainV2Response
"""
all_params = ['instance_id', 'domain_id', 'group_id']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
if 'domain_id' in local_var_params:
path_params['domain_id'] = local_var_params['domain_id']
if 'group_id' in local_var_params:
path_params['group_id'] = local_var_params['group_id']
query_params = []
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/api-groups/{group_id}/domains/{domain_id}',
method='DELETE',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='DisassociateDomainV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def disassociate_signature_key_v2(self, request):
"""解除绑定
解除API与签名密钥的绑定关系。
:param DisassociateSignatureKeyV2Request request
:return: DisassociateSignatureKeyV2Response
"""
return self.disassociate_signature_key_v2_with_http_info(request)
def disassociate_signature_key_v2_with_http_info(self, request):
"""解除绑定
解除API与签名密钥的绑定关系。
:param DisassociateSignatureKeyV2Request request
:return: DisassociateSignatureKeyV2Response
"""
all_params = ['instance_id', 'sign_bindings_id']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
if 'sign_bindings_id' in local_var_params:
path_params['sign_bindings_id'] = local_var_params['sign_bindings_id']
query_params = []
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/sign-bindings/{sign_bindings_id}',
method='DELETE',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='DisassociateSignatureKeyV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def list_api_groups_quantities_v2(self, request):
"""查询API分组概况
查询租户名下的API分组概况。
:param ListApiGroupsQuantitiesV2Request request
:return: ListApiGroupsQuantitiesV2Response
"""
return self.list_api_groups_quantities_v2_with_http_info(request)
def list_api_groups_quantities_v2_with_http_info(self, request):
"""查询API分组概况
查询租户名下的API分组概况。
:param ListApiGroupsQuantitiesV2Request request
:return: ListApiGroupsQuantitiesV2Response
"""
all_params = ['instance_id']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
query_params = []
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/resources/outline/groups',
method='GET',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='ListApiGroupsQuantitiesV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def list_api_quantities_v2(self, request):
"""查询API概况
查询租户名下的API概况已发布到RELEASE环境的API个数未发布到RELEASE环境的API个数。
:param ListApiQuantitiesV2Request request
:return: ListApiQuantitiesV2Response
"""
return self.list_api_quantities_v2_with_http_info(request)
def list_api_quantities_v2_with_http_info(self, request):
"""查询API概况
查询租户名下的API概况已发布到RELEASE环境的API个数未发布到RELEASE环境的API个数。
:param ListApiQuantitiesV2Request request
:return: ListApiQuantitiesV2Response
"""
all_params = ['instance_id']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
query_params = []
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/resources/outline/apis',
method='GET',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='ListApiQuantitiesV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def list_apis_binded_to_signature_key_v2(self, request):
"""查看签名密钥绑定的API列表
查询某个签名密钥上已经绑定的API列表。
:param ListApisBindedToSignatureKeyV2Request request
:return: ListApisBindedToSignatureKeyV2Response
"""
return self.list_apis_binded_to_signature_key_v2_with_http_info(request)
def list_apis_binded_to_signature_key_v2_with_http_info(self, request):
"""查看签名密钥绑定的API列表
查询某个签名密钥上已经绑定的API列表。
:param ListApisBindedToSignatureKeyV2Request request
:return: ListApisBindedToSignatureKeyV2Response
"""
all_params = ['instance_id', 'sign_id', 'env_id', 'api_id', 'api_name', 'group_id', 'offset', 'limit']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
query_params = []
if 'sign_id' in local_var_params:
query_params.append(('sign_id', local_var_params['sign_id']))
if 'env_id' in local_var_params:
query_params.append(('env_id', local_var_params['env_id']))
if 'api_id' in local_var_params:
query_params.append(('api_id', local_var_params['api_id']))
if 'api_name' in local_var_params:
query_params.append(('api_name', local_var_params['api_name']))
if 'group_id' in local_var_params:
query_params.append(('group_id', local_var_params['group_id']))
if 'offset' in local_var_params:
query_params.append(('offset', local_var_params['offset']))
if 'limit' in local_var_params:
query_params.append(('limit', local_var_params['limit']))
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/sign-bindings/binded-apis',
method='GET',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='ListApisBindedToSignatureKeyV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def list_apis_not_bound_with_signature_key_v2(self, request):
"""查看签名密钥未绑定的API列表
查询所有未绑定到该签名密钥上的API列表。需要API已经发布未发布的API不予展示。
:param ListApisNotBoundWithSignatureKeyV2Request request
:return: ListApisNotBoundWithSignatureKeyV2Response
"""
return self.list_apis_not_bound_with_signature_key_v2_with_http_info(request)
def list_apis_not_bound_with_signature_key_v2_with_http_info(self, request):
"""查看签名密钥未绑定的API列表
查询所有未绑定到该签名密钥上的API列表。需要API已经发布未发布的API不予展示。
:param ListApisNotBoundWithSignatureKeyV2Request request
:return: ListApisNotBoundWithSignatureKeyV2Response
"""
all_params = ['instance_id', 'sign_id', 'env_id', 'api_id', 'api_name', 'group_id', 'offset', 'limit']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
query_params = []
if 'sign_id' in local_var_params:
query_params.append(('sign_id', local_var_params['sign_id']))
if 'env_id' in local_var_params:
query_params.append(('env_id', local_var_params['env_id']))
if 'api_id' in local_var_params:
query_params.append(('api_id', local_var_params['api_id']))
if 'api_name' in local_var_params:
query_params.append(('api_name', local_var_params['api_name']))
if 'group_id' in local_var_params:
query_params.append(('group_id', local_var_params['group_id']))
if 'offset' in local_var_params:
query_params.append(('offset', local_var_params['offset']))
if 'limit' in local_var_params:
query_params.append(('limit', local_var_params['limit']))
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/sign-bindings/unbinded-apis',
method='GET',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='ListApisNotBoundWithSignatureKeyV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def list_app_quantities_v2(self, request):
"""查询APP概况
查询租户名下的APP概况已进行API访问授权的APP个数未进行API访问授权的APP个数。
:param ListAppQuantitiesV2Request request
:return: ListAppQuantitiesV2Response
"""
return self.list_app_quantities_v2_with_http_info(request)
def list_app_quantities_v2_with_http_info(self, request):
"""查询APP概况
查询租户名下的APP概况已进行API访问授权的APP个数未进行API访问授权的APP个数。
:param ListAppQuantitiesV2Request request
:return: ListAppQuantitiesV2Response
"""
all_params = ['instance_id']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
query_params = []
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/resources/outline/apps',
method='GET',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='ListAppQuantitiesV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def list_environment_variables_v2(self, request):
"""查询变量列表
查询分组下的所有环境变量的列表。
:param ListEnvironmentVariablesV2Request request
:return: ListEnvironmentVariablesV2Response
"""
return self.list_environment_variables_v2_with_http_info(request)
def list_environment_variables_v2_with_http_info(self, request):
"""查询变量列表
查询分组下的所有环境变量的列表。
:param ListEnvironmentVariablesV2Request request
:return: ListEnvironmentVariablesV2Response
"""
all_params = ['instance_id', 'group_id', 'env_id', 'variable_name', 'offset', 'limit', 'precise_search']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
query_params = []
if 'group_id' in local_var_params:
query_params.append(('group_id', local_var_params['group_id']))
if 'env_id' in local_var_params:
query_params.append(('env_id', local_var_params['env_id']))
if 'variable_name' in local_var_params:
query_params.append(('variable_name', local_var_params['variable_name']))
if 'offset' in local_var_params:
query_params.append(('offset', local_var_params['offset']))
if 'limit' in local_var_params:
query_params.append(('limit', local_var_params['limit']))
if 'precise_search' in local_var_params:
query_params.append(('precise_search', local_var_params['precise_search']))
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/env-variables',
method='GET',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='ListEnvironmentVariablesV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def list_environments_v2(self, request):
"""查询环境列表
查询符合条件的环境列表。
:param ListEnvironmentsV2Request request
:return: ListEnvironmentsV2Response
"""
return self.list_environments_v2_with_http_info(request)
def list_environments_v2_with_http_info(self, request):
"""查询环境列表
查询符合条件的环境列表。
:param ListEnvironmentsV2Request request
:return: ListEnvironmentsV2Response
"""
all_params = ['instance_id', 'name', 'offset', 'limit']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
query_params = []
if 'name' in local_var_params:
query_params.append(('name', local_var_params['name']))
if 'offset' in local_var_params:
query_params.append(('offset', local_var_params['offset']))
if 'limit' in local_var_params:
query_params.append(('limit', local_var_params['limit']))
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/envs',
method='GET',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='ListEnvironmentsV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def list_request_throttling_policy_v2(self, request):
"""查询流控策略列表
查询所有流控策略的信息。
:param ListRequestThrottlingPolicyV2Request request
:return: ListRequestThrottlingPolicyV2Response
"""
return self.list_request_throttling_policy_v2_with_http_info(request)
def list_request_throttling_policy_v2_with_http_info(self, request):
"""查询流控策略列表
查询所有流控策略的信息。
:param ListRequestThrottlingPolicyV2Request request
:return: ListRequestThrottlingPolicyV2Response
"""
all_params = ['instance_id', 'id', 'name', 'offset', 'limit', 'precise_search']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
query_params = []
if 'id' in local_var_params:
query_params.append(('id', local_var_params['id']))
if 'name' in local_var_params:
query_params.append(('name', local_var_params['name']))
if 'offset' in local_var_params:
query_params.append(('offset', local_var_params['offset']))
if 'limit' in local_var_params:
query_params.append(('limit', local_var_params['limit']))
if 'precise_search' in local_var_params:
query_params.append(('precise_search', local_var_params['precise_search']))
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/throttles',
method='GET',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='ListRequestThrottlingPolicyV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def list_signature_keys_binded_to_api_v2(self, request):
"""查看API绑定的签名密钥列表
查询某个API绑定的签名密钥列表。每个API在每个环境上应该最多只会绑定一个签名密钥。
:param ListSignatureKeysBindedToApiV2Request request
:return: ListSignatureKeysBindedToApiV2Response
"""
return self.list_signature_keys_binded_to_api_v2_with_http_info(request)
def list_signature_keys_binded_to_api_v2_with_http_info(self, request):
"""查看API绑定的签名密钥列表
查询某个API绑定的签名密钥列表。每个API在每个环境上应该最多只会绑定一个签名密钥。
:param ListSignatureKeysBindedToApiV2Request request
:return: ListSignatureKeysBindedToApiV2Response
"""
all_params = ['instance_id', 'api_id', 'sign_id', 'sign_name', 'env_id', 'offset', 'limit']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
query_params = []
if 'api_id' in local_var_params:
query_params.append(('api_id', local_var_params['api_id']))
if 'sign_id' in local_var_params:
query_params.append(('sign_id', local_var_params['sign_id']))
if 'sign_name' in local_var_params:
query_params.append(('sign_name', local_var_params['sign_name']))
if 'env_id' in local_var_params:
query_params.append(('env_id', local_var_params['env_id']))
if 'offset' in local_var_params:
query_params.append(('offset', local_var_params['offset']))
if 'limit' in local_var_params:
query_params.append(('limit', local_var_params['limit']))
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/sign-bindings/binded-signs',
method='GET',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='ListSignatureKeysBindedToApiV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def list_signature_keys_v2(self, request):
"""查询签名密钥列表
查询所有签名密钥的信息。
:param ListSignatureKeysV2Request request
:return: ListSignatureKeysV2Response
"""
return self.list_signature_keys_v2_with_http_info(request)
def list_signature_keys_v2_with_http_info(self, request):
"""查询签名密钥列表
查询所有签名密钥的信息。
:param ListSignatureKeysV2Request request
:return: ListSignatureKeysV2Response
"""
all_params = ['instance_id', 'id', 'name', 'offset', 'limit', 'precise_search']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
query_params = []
if 'id' in local_var_params:
query_params.append(('id', local_var_params['id']))
if 'name' in local_var_params:
query_params.append(('name', local_var_params['name']))
if 'offset' in local_var_params:
query_params.append(('offset', local_var_params['offset']))
if 'limit' in local_var_params:
query_params.append(('limit', local_var_params['limit']))
if 'precise_search' in local_var_params:
query_params.append(('precise_search', local_var_params['precise_search']))
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/signs',
method='GET',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='ListSignatureKeysV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def list_special_throttling_configurations_v2(self, request):
"""查看特殊设置列表
查看给流控策略设置的特殊配置。
:param ListSpecialThrottlingConfigurationsV2Request request
:return: ListSpecialThrottlingConfigurationsV2Response
"""
return self.list_special_throttling_configurations_v2_with_http_info(request)
def list_special_throttling_configurations_v2_with_http_info(self, request):
"""查看特殊设置列表
查看给流控策略设置的特殊配置。
:param ListSpecialThrottlingConfigurationsV2Request request
:return: ListSpecialThrottlingConfigurationsV2Response
"""
all_params = ['instance_id', 'throttle_id', 'object_type', 'app_name', 'offset', 'limit']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
if 'throttle_id' in local_var_params:
path_params['throttle_id'] = local_var_params['throttle_id']
query_params = []
if 'object_type' in local_var_params:
query_params.append(('object_type', local_var_params['object_type']))
if 'app_name' in local_var_params:
query_params.append(('app_name', local_var_params['app_name']))
if 'offset' in local_var_params:
query_params.append(('offset', local_var_params['offset']))
if 'limit' in local_var_params:
query_params.append(('limit', local_var_params['limit']))
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/throttles/{throttle_id}/throttle-specials',
method='GET',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='ListSpecialThrottlingConfigurationsV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def show_details_of_domain_name_certificate_v2(self, request):
"""查看域名证书
查看域名下绑定的证书详情。
:param ShowDetailsOfDomainNameCertificateV2Request request
:return: ShowDetailsOfDomainNameCertificateV2Response
"""
return self.show_details_of_domain_name_certificate_v2_with_http_info(request)
def show_details_of_domain_name_certificate_v2_with_http_info(self, request):
"""查看域名证书
查看域名下绑定的证书详情。
:param ShowDetailsOfDomainNameCertificateV2Request request
:return: ShowDetailsOfDomainNameCertificateV2Response
"""
all_params = ['instance_id', 'domain_id', 'group_id', 'certificate_id']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
if 'domain_id' in local_var_params:
path_params['domain_id'] = local_var_params['domain_id']
if 'group_id' in local_var_params:
path_params['group_id'] = local_var_params['group_id']
if 'certificate_id' in local_var_params:
path_params['certificate_id'] = local_var_params['certificate_id']
query_params = []
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/api-groups/{group_id}/domains/{domain_id}/certificate/{certificate_id}',
method='GET',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='ShowDetailsOfDomainNameCertificateV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def show_details_of_environment_variable_v2(self, request):
"""查看变量详情
查看指定的环境变量的详情。
:param ShowDetailsOfEnvironmentVariableV2Request request
:return: ShowDetailsOfEnvironmentVariableV2Response
"""
return self.show_details_of_environment_variable_v2_with_http_info(request)
def show_details_of_environment_variable_v2_with_http_info(self, request):
"""查看变量详情
查看指定的环境变量的详情。
:param ShowDetailsOfEnvironmentVariableV2Request request
:return: ShowDetailsOfEnvironmentVariableV2Response
"""
all_params = ['instance_id', 'env_variable_id']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
if 'env_variable_id' in local_var_params:
path_params['env_variable_id'] = local_var_params['env_variable_id']
query_params = []
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/env-variables/{env_variable_id}',
method='GET',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='ShowDetailsOfEnvironmentVariableV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def show_details_of_request_throttling_policy_v2(self, request):
"""查看流控策略详情
查看指定流控策略的详细信息。
:param ShowDetailsOfRequestThrottlingPolicyV2Request request
:return: ShowDetailsOfRequestThrottlingPolicyV2Response
"""
return self.show_details_of_request_throttling_policy_v2_with_http_info(request)
def show_details_of_request_throttling_policy_v2_with_http_info(self, request):
"""查看流控策略详情
查看指定流控策略的详细信息。
:param ShowDetailsOfRequestThrottlingPolicyV2Request request
:return: ShowDetailsOfRequestThrottlingPolicyV2Response
"""
all_params = ['instance_id', 'throttle_id']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
if 'throttle_id' in local_var_params:
path_params['throttle_id'] = local_var_params['throttle_id']
query_params = []
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/throttles/{throttle_id}',
method='GET',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='ShowDetailsOfRequestThrottlingPolicyV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def update_environment_v2(self, request):
"""修改环境
修改指定环境的信息。其中可修改的属性为name、remark其它属性不可修改。
:param UpdateEnvironmentV2Request request
:return: UpdateEnvironmentV2Response
"""
return self.update_environment_v2_with_http_info(request)
def update_environment_v2_with_http_info(self, request):
"""修改环境
修改指定环境的信息。其中可修改的属性为name、remark其它属性不可修改。
:param UpdateEnvironmentV2Request request
:return: UpdateEnvironmentV2Response
"""
all_params = ['instance_id', 'env_id', 'update_environment_v2_request_body']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
if 'env_id' in local_var_params:
path_params['env_id'] = local_var_params['env_id']
query_params = []
header_params = {}
form_params = {}
body_params = None
if 'body' in local_var_params:
body_params = local_var_params['body']
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json;charset=UTF-8'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/envs/{env_id}',
method='PUT',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='UpdateEnvironmentV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def update_request_throttling_policy_v2(self, request):
"""修改流控策略
修改指定流控策略的详细信息。
:param UpdateRequestThrottlingPolicyV2Request request
:return: UpdateRequestThrottlingPolicyV2Response
"""
return self.update_request_throttling_policy_v2_with_http_info(request)
def update_request_throttling_policy_v2_with_http_info(self, request):
"""修改流控策略
修改指定流控策略的详细信息。
:param UpdateRequestThrottlingPolicyV2Request request
:return: UpdateRequestThrottlingPolicyV2Response
"""
all_params = ['instance_id', 'throttle_id', 'update_request_throttling_policy_v2_request_body']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
if 'throttle_id' in local_var_params:
path_params['throttle_id'] = local_var_params['throttle_id']
query_params = []
header_params = {}
form_params = {}
body_params = None
if 'body' in local_var_params:
body_params = local_var_params['body']
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json;charset=UTF-8'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/throttles/{throttle_id}',
method='PUT',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='UpdateRequestThrottlingPolicyV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def update_signature_key_v2(self, request):
"""修改签名密钥
修改指定签名密钥的详细信息。
:param UpdateSignatureKeyV2Request request
:return: UpdateSignatureKeyV2Response
"""
return self.update_signature_key_v2_with_http_info(request)
def update_signature_key_v2_with_http_info(self, request):
"""修改签名密钥
修改指定签名密钥的详细信息。
:param UpdateSignatureKeyV2Request request
:return: UpdateSignatureKeyV2Response
"""
all_params = ['instance_id', 'sign_id', 'update_signature_key_v2_request_body']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
if 'sign_id' in local_var_params:
path_params['sign_id'] = local_var_params['sign_id']
query_params = []
header_params = {}
form_params = {}
body_params = None
if 'body' in local_var_params:
body_params = local_var_params['body']
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json;charset=UTF-8'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/signs/{sign_id}',
method='PUT',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='UpdateSignatureKeyV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def update_special_throttling_configuration_v2(self, request):
"""修改特殊设置
修改某个流控策略下的某个特殊设置。
:param UpdateSpecialThrottlingConfigurationV2Request request
:return: UpdateSpecialThrottlingConfigurationV2Response
"""
return self.update_special_throttling_configuration_v2_with_http_info(request)
def update_special_throttling_configuration_v2_with_http_info(self, request):
"""修改特殊设置
修改某个流控策略下的某个特殊设置。
:param UpdateSpecialThrottlingConfigurationV2Request request
:return: UpdateSpecialThrottlingConfigurationV2Response
"""
all_params = ['instance_id', 'throttle_id', 'strategy_id', 'update_special_throttling_configuration_v2_request_body']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
if 'throttle_id' in local_var_params:
path_params['throttle_id'] = local_var_params['throttle_id']
if 'strategy_id' in local_var_params:
path_params['strategy_id'] = local_var_params['strategy_id']
query_params = []
header_params = {}
form_params = {}
body_params = None
if 'body' in local_var_params:
body_params = local_var_params['body']
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json;charset=UTF-8'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/throttles/{throttle_id}/throttle-specials/{strategy_id}',
method='PUT',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='UpdateSpecialThrottlingConfigurationV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def associate_request_throttling_policy_v2(self, request):
"""绑定流控策略
将流控策略应用于API则所有对该API的访问将会受到该流控策略的限制。 当一定时间内的访问次数超过流控策略设置的API最大访问次数限制后后续的访问将会被拒绝从而能够较好的保护后端API免受异常流量的冲击保障服务的稳定运行。 为指定的API绑定流控策略绑定时需要指定在哪个环境上生效。同一个API发布到不同的环境可以绑定不同的流控策略一个API在发布到特定环境后只能绑定一个默认的流控策略。
:param AssociateRequestThrottlingPolicyV2Request request
:return: AssociateRequestThrottlingPolicyV2Response
"""
return self.associate_request_throttling_policy_v2_with_http_info(request)
def associate_request_throttling_policy_v2_with_http_info(self, request):
"""绑定流控策略
将流控策略应用于API则所有对该API的访问将会受到该流控策略的限制。 当一定时间内的访问次数超过流控策略设置的API最大访问次数限制后后续的访问将会被拒绝从而能够较好的保护后端API免受异常流量的冲击保障服务的稳定运行。 为指定的API绑定流控策略绑定时需要指定在哪个环境上生效。同一个API发布到不同的环境可以绑定不同的流控策略一个API在发布到特定环境后只能绑定一个默认的流控策略。
:param AssociateRequestThrottlingPolicyV2Request request
:return: AssociateRequestThrottlingPolicyV2Response
"""
all_params = ['instance_id', 'associate_request_throttling_policy_v2_request_body']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
query_params = []
header_params = {}
form_params = {}
body_params = None
if 'body' in local_var_params:
body_params = local_var_params['body']
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json;charset=UTF-8'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/throttle-bindings',
method='POST',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='AssociateRequestThrottlingPolicyV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def batch_disassociate_throttling_policy_v2(self, request):
"""批量解绑流控策略
批量解除API与流控策略的绑定关系
:param BatchDisassociateThrottlingPolicyV2Request request
:return: BatchDisassociateThrottlingPolicyV2Response
"""
return self.batch_disassociate_throttling_policy_v2_with_http_info(request)
def batch_disassociate_throttling_policy_v2_with_http_info(self, request):
"""批量解绑流控策略
批量解除API与流控策略的绑定关系
:param BatchDisassociateThrottlingPolicyV2Request request
:return: BatchDisassociateThrottlingPolicyV2Response
"""
all_params = ['instance_id', 'action', 'batch_disassociate_throttling_policy_v2_request_body']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
query_params = []
if 'action' in local_var_params:
query_params.append(('action', local_var_params['action']))
header_params = {}
form_params = {}
body_params = None
if 'body' in local_var_params:
body_params = local_var_params['body']
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json;charset=UTF-8'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/throttle-bindings',
method='PUT',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='BatchDisassociateThrottlingPolicyV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def create_api_group_v2(self, request):
"""创建API分组
API分组是API的管理单元一个API分组等同于一个服务入口创建API分组时返回一个子域名作为访问入口。建议一个API分组下的API具有一定的相关性。
:param CreateApiGroupV2Request request
:return: CreateApiGroupV2Response
"""
return self.create_api_group_v2_with_http_info(request)
def create_api_group_v2_with_http_info(self, request):
"""创建API分组
API分组是API的管理单元一个API分组等同于一个服务入口创建API分组时返回一个子域名作为访问入口。建议一个API分组下的API具有一定的相关性。
:param CreateApiGroupV2Request request
:return: CreateApiGroupV2Response
"""
all_params = ['instance_id', 'create_api_group_v2_request_body']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
query_params = []
header_params = {}
form_params = {}
body_params = None
if 'body' in local_var_params:
body_params = local_var_params['body']
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json;charset=UTF-8'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/api-groups',
method='POST',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='CreateApiGroupV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def create_api_v2(self, request):
"""注册API
添加一个APIAPI即一个服务接口具体的服务能力。 API分为两部分第一部分为面向API使用者的API接口定义了使用者如何调用这个API。第二部分面向API提供者由API提供者定义这个API的真实的后端情况定义了API网关如何去访问真实的后端服务。API的真实后端服务目前支持三种类型传统的HTTP/HTTPS形式的web后端、函数工作流、MOCK。
:param CreateApiV2Request request
:return: CreateApiV2Response
"""
return self.create_api_v2_with_http_info(request)
def create_api_v2_with_http_info(self, request):
"""注册API
添加一个APIAPI即一个服务接口具体的服务能力。 API分为两部分第一部分为面向API使用者的API接口定义了使用者如何调用这个API。第二部分面向API提供者由API提供者定义这个API的真实的后端情况定义了API网关如何去访问真实的后端服务。API的真实后端服务目前支持三种类型传统的HTTP/HTTPS形式的web后端、函数工作流、MOCK。
:param CreateApiV2Request request
:return: CreateApiV2Response
"""
all_params = ['instance_id', 'create_api_v2_request_body']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
query_params = []
header_params = {}
form_params = {}
body_params = None
if 'body' in local_var_params:
body_params = local_var_params['body']
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json;charset=UTF-8'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/apis',
method='POST',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='CreateApiV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def create_or_delete_publish_record_for_api_v2(self, request):
"""发布或下线API
对API进行发布或下线。 发布操作是将一个指定的API发布到一个指定的环境API只有发布后才能够被调用且只能在该环境上才能被调用。未发布的API无法被调用。 下线操作是将API从某个已发布的环境上下线下线后API将无法再被调用。
:param CreateOrDeletePublishRecordForApiV2Request request
:return: CreateOrDeletePublishRecordForApiV2Response
"""
return self.create_or_delete_publish_record_for_api_v2_with_http_info(request)
def create_or_delete_publish_record_for_api_v2_with_http_info(self, request):
"""发布或下线API
对API进行发布或下线。 发布操作是将一个指定的API发布到一个指定的环境API只有发布后才能够被调用且只能在该环境上才能被调用。未发布的API无法被调用。 下线操作是将API从某个已发布的环境上下线下线后API将无法再被调用。
:param CreateOrDeletePublishRecordForApiV2Request request
:return: CreateOrDeletePublishRecordForApiV2Response
"""
all_params = ['instance_id', 'create_or_delete_publish_record_for_api_v2_request_body']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
query_params = []
header_params = {}
form_params = {}
body_params = None
if 'body' in local_var_params:
body_params = local_var_params['body']
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json;charset=UTF-8'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/apis/action',
method='POST',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='CreateOrDeletePublishRecordForApiV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def delete_api_group_v2(self, request):
"""删除API分组
删除指定的API分组。 删除时会一并删除直接或间接关联到该分组下的所有资源包括API、独立域名、SSL证书、上架信息、分组下所有API的授权信息、编排信息、白名单配置、认证增强信息等等。并会将外部域名与子域名的绑定关系进行解除取决于域名cname方式
:param DeleteApiGroupV2Request request
:return: DeleteApiGroupV2Response
"""
return self.delete_api_group_v2_with_http_info(request)
def delete_api_group_v2_with_http_info(self, request):
"""删除API分组
删除指定的API分组。 删除时会一并删除直接或间接关联到该分组下的所有资源包括API、独立域名、SSL证书、上架信息、分组下所有API的授权信息、编排信息、白名单配置、认证增强信息等等。并会将外部域名与子域名的绑定关系进行解除取决于域名cname方式
:param DeleteApiGroupV2Request request
:return: DeleteApiGroupV2Response
"""
all_params = ['instance_id', 'group_id']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
if 'group_id' in local_var_params:
path_params['group_id'] = local_var_params['group_id']
query_params = []
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/api-groups/{group_id}',
method='DELETE',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='DeleteApiGroupV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def delete_api_v2(self, request):
"""删除API
删除指定的API。 删除API时会删除该API所有相关的资源信息或绑定关系如API的发布记录绑定的后端服务对APP的授权信息等。
:param DeleteApiV2Request request
:return: DeleteApiV2Response
"""
return self.delete_api_v2_with_http_info(request)
def delete_api_v2_with_http_info(self, request):
"""删除API
删除指定的API。 删除API时会删除该API所有相关的资源信息或绑定关系如API的发布记录绑定的后端服务对APP的授权信息等。
:param DeleteApiV2Request request
:return: DeleteApiV2Response
"""
all_params = ['instance_id', 'api_id']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
if 'api_id' in local_var_params:
path_params['api_id'] = local_var_params['api_id']
query_params = []
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/apis/{api_id}',
method='DELETE',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='DeleteApiV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def disassociate_request_throttling_policy_v2(self, request):
"""解除API与流控策略的绑定关系
解除API与流控策略的绑定关系。
:param DisassociateRequestThrottlingPolicyV2Request request
:return: DisassociateRequestThrottlingPolicyV2Response
"""
return self.disassociate_request_throttling_policy_v2_with_http_info(request)
def disassociate_request_throttling_policy_v2_with_http_info(self, request):
"""解除API与流控策略的绑定关系
解除API与流控策略的绑定关系。
:param DisassociateRequestThrottlingPolicyV2Request request
:return: DisassociateRequestThrottlingPolicyV2Response
"""
all_params = ['instance_id', 'throttle_binding_id']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
if 'throttle_binding_id' in local_var_params:
path_params['throttle_binding_id'] = local_var_params['throttle_binding_id']
query_params = []
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/throttle-bindings/{throttle_binding_id}',
method='DELETE',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='DisassociateRequestThrottlingPolicyV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def list_api_groups_v2(self, request):
"""查询分组列表
查询API分组列表。 如果是租户操作,则查询该租户下所有的分组;如果是管理员操作,则查询的是所有租户的分组。
:param ListApiGroupsV2Request request
:return: ListApiGroupsV2Response
"""
return self.list_api_groups_v2_with_http_info(request)
def list_api_groups_v2_with_http_info(self, request):
"""查询分组列表
查询API分组列表。 如果是租户操作,则查询该租户下所有的分组;如果是管理员操作,则查询的是所有租户的分组。
:param ListApiGroupsV2Request request
:return: ListApiGroupsV2Response
"""
all_params = ['instance_id', 'id', 'name', 'offset', 'limit', 'precise_search']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
query_params = []
if 'id' in local_var_params:
query_params.append(('id', local_var_params['id']))
if 'name' in local_var_params:
query_params.append(('name', local_var_params['name']))
if 'offset' in local_var_params:
query_params.append(('offset', local_var_params['offset']))
if 'limit' in local_var_params:
query_params.append(('limit', local_var_params['limit']))
if 'precise_search' in local_var_params:
query_params.append(('precise_search', local_var_params['precise_search']))
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/api-groups',
method='GET',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='ListApiGroupsV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def list_apis_binded_to_request_throttling_policy_v2(self, request):
"""查看流控策略绑定的API列表
查询某个流控策略上已经绑定的API列表。
:param ListApisBindedToRequestThrottlingPolicyV2Request request
:return: ListApisBindedToRequestThrottlingPolicyV2Response
"""
return self.list_apis_binded_to_request_throttling_policy_v2_with_http_info(request)
def list_apis_binded_to_request_throttling_policy_v2_with_http_info(self, request):
"""查看流控策略绑定的API列表
查询某个流控策略上已经绑定的API列表。
:param ListApisBindedToRequestThrottlingPolicyV2Request request
:return: ListApisBindedToRequestThrottlingPolicyV2Response
"""
all_params = ['instance_id', 'throttle_id', 'env_id', 'group_id', 'api_id', 'api_name', 'offset', 'limit']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
query_params = []
if 'throttle_id' in local_var_params:
query_params.append(('throttle_id', local_var_params['throttle_id']))
if 'env_id' in local_var_params:
query_params.append(('env_id', local_var_params['env_id']))
if 'group_id' in local_var_params:
query_params.append(('group_id', local_var_params['group_id']))
if 'api_id' in local_var_params:
query_params.append(('api_id', local_var_params['api_id']))
if 'api_name' in local_var_params:
query_params.append(('api_name', local_var_params['api_name']))
if 'offset' in local_var_params:
query_params.append(('offset', local_var_params['offset']))
if 'limit' in local_var_params:
query_params.append(('limit', local_var_params['limit']))
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/throttle-bindings/binded-apis',
method='GET',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='ListApisBindedToRequestThrottlingPolicyV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def list_apis_unbinded_to_request_throttling_policy_v2(self, request):
"""查看流控策略未绑定的API列表
查询所有未绑定到该流控策略上的自有API列表。需要API已经发布未发布的API不予展示。
:param ListApisUnbindedToRequestThrottlingPolicyV2Request request
:return: ListApisUnbindedToRequestThrottlingPolicyV2Response
"""
return self.list_apis_unbinded_to_request_throttling_policy_v2_with_http_info(request)
def list_apis_unbinded_to_request_throttling_policy_v2_with_http_info(self, request):
"""查看流控策略未绑定的API列表
查询所有未绑定到该流控策略上的自有API列表。需要API已经发布未发布的API不予展示。
:param ListApisUnbindedToRequestThrottlingPolicyV2Request request
:return: ListApisUnbindedToRequestThrottlingPolicyV2Response
"""
all_params = ['instance_id', 'throttle_id', 'env_id', 'group_id', 'api_id', 'api_name', 'offset', 'limit']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
query_params = []
if 'throttle_id' in local_var_params:
query_params.append(('throttle_id', local_var_params['throttle_id']))
if 'env_id' in local_var_params:
query_params.append(('env_id', local_var_params['env_id']))
if 'group_id' in local_var_params:
query_params.append(('group_id', local_var_params['group_id']))
if 'api_id' in local_var_params:
query_params.append(('api_id', local_var_params['api_id']))
if 'api_name' in local_var_params:
query_params.append(('api_name', local_var_params['api_name']))
if 'offset' in local_var_params:
query_params.append(('offset', local_var_params['offset']))
if 'limit' in local_var_params:
query_params.append(('limit', local_var_params['limit']))
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/throttle-bindings/unbinded-apis',
method='GET',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='ListApisUnbindedToRequestThrottlingPolicyV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def list_apis_v2(self, request):
"""查询API列表
查看API列表返回API详细信息、发布信息等但不能查看到后端服务信息。
:param ListApisV2Request request
:return: ListApisV2Response
"""
return self.list_apis_v2_with_http_info(request)
def list_apis_v2_with_http_info(self, request):
"""查询API列表
查看API列表返回API详细信息、发布信息等但不能查看到后端服务信息。
:param ListApisV2Request request
:return: ListApisV2Response
"""
all_params = ['instance_id', 'id', 'name', 'group_id', 'req_protocol', 'req_method', 'req_uri', 'auth_type', 'env_id', 'type', 'offset', 'limit', 'precise_search']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
query_params = []
if 'id' in local_var_params:
query_params.append(('id', local_var_params['id']))
if 'name' in local_var_params:
query_params.append(('name', local_var_params['name']))
if 'group_id' in local_var_params:
query_params.append(('group_id', local_var_params['group_id']))
if 'req_protocol' in local_var_params:
query_params.append(('req_protocol', local_var_params['req_protocol']))
if 'req_method' in local_var_params:
query_params.append(('req_method', local_var_params['req_method']))
if 'req_uri' in local_var_params:
query_params.append(('req_uri', local_var_params['req_uri']))
if 'auth_type' in local_var_params:
query_params.append(('auth_type', local_var_params['auth_type']))
if 'env_id' in local_var_params:
query_params.append(('env_id', local_var_params['env_id']))
if 'type' in local_var_params:
query_params.append(('type', local_var_params['type']))
if 'offset' in local_var_params:
query_params.append(('offset', local_var_params['offset']))
if 'limit' in local_var_params:
query_params.append(('limit', local_var_params['limit']))
if 'precise_search' in local_var_params:
query_params.append(('precise_search', local_var_params['precise_search']))
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/apis',
method='GET',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='ListApisV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def list_request_throttling_policies_binded_to_api_v2(self, request):
"""查看API绑定的流控策略列表
查询某个API绑定的流控策略列表。每个环境上应该最多只有一个流控策略。
:param ListRequestThrottlingPoliciesBindedToApiV2Request request
:return: ListRequestThrottlingPoliciesBindedToApiV2Response
"""
return self.list_request_throttling_policies_binded_to_api_v2_with_http_info(request)
def list_request_throttling_policies_binded_to_api_v2_with_http_info(self, request):
"""查看API绑定的流控策略列表
查询某个API绑定的流控策略列表。每个环境上应该最多只有一个流控策略。
:param ListRequestThrottlingPoliciesBindedToApiV2Request request
:return: ListRequestThrottlingPoliciesBindedToApiV2Response
"""
all_params = ['instance_id', 'api_id', 'throttle_id', 'throttle_name', 'env_id', 'offset', 'limit']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
query_params = []
if 'api_id' in local_var_params:
query_params.append(('api_id', local_var_params['api_id']))
if 'throttle_id' in local_var_params:
query_params.append(('throttle_id', local_var_params['throttle_id']))
if 'throttle_name' in local_var_params:
query_params.append(('throttle_name', local_var_params['throttle_name']))
if 'env_id' in local_var_params:
query_params.append(('env_id', local_var_params['env_id']))
if 'offset' in local_var_params:
query_params.append(('offset', local_var_params['offset']))
if 'limit' in local_var_params:
query_params.append(('limit', local_var_params['limit']))
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/throttle-bindings/binded-throttles',
method='GET',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='ListRequestThrottlingPoliciesBindedToApiV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def show_details_of_api_group_v2(self, request):
"""查询分组详情
查询指定分组的详细信息。
:param ShowDetailsOfApiGroupV2Request request
:return: ShowDetailsOfApiGroupV2Response
"""
return self.show_details_of_api_group_v2_with_http_info(request)
def show_details_of_api_group_v2_with_http_info(self, request):
"""查询分组详情
查询指定分组的详细信息。
:param ShowDetailsOfApiGroupV2Request request
:return: ShowDetailsOfApiGroupV2Response
"""
all_params = ['instance_id', 'group_id']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
if 'group_id' in local_var_params:
path_params['group_id'] = local_var_params['group_id']
query_params = []
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/api-groups/{group_id}',
method='GET',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='ShowDetailsOfApiGroupV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def show_details_of_api_v2(self, request):
"""查询API详情
查看指定的API的详细信息。
:param ShowDetailsOfApiV2Request request
:return: ShowDetailsOfApiV2Response
"""
return self.show_details_of_api_v2_with_http_info(request)
def show_details_of_api_v2_with_http_info(self, request):
"""查询API详情
查看指定的API的详细信息。
:param ShowDetailsOfApiV2Request request
:return: ShowDetailsOfApiV2Response
"""
all_params = ['instance_id', 'api_id']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
if 'api_id' in local_var_params:
path_params['api_id'] = local_var_params['api_id']
query_params = []
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/apis/{api_id}',
method='GET',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='ShowDetailsOfApiV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def update_api_group_v2(self, request):
"""修改API分组
修改API分组属性。其中name和remark可修改其他属性不可修改。
:param UpdateApiGroupV2Request request
:return: UpdateApiGroupV2Response
"""
return self.update_api_group_v2_with_http_info(request)
def update_api_group_v2_with_http_info(self, request):
"""修改API分组
修改API分组属性。其中name和remark可修改其他属性不可修改。
:param UpdateApiGroupV2Request request
:return: UpdateApiGroupV2Response
"""
all_params = ['instance_id', 'group_id', 'update_api_group_v2_request_body']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
if 'group_id' in local_var_params:
path_params['group_id'] = local_var_params['group_id']
query_params = []
header_params = {}
form_params = {}
body_params = None
if 'body' in local_var_params:
body_params = local_var_params['body']
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json;charset=UTF-8'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/api-groups/{group_id}',
method='PUT',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='UpdateApiGroupV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def update_api_v2(self, request):
"""修改API
修改指定API的信息包括后端服务信息。
:param UpdateApiV2Request request
:return: UpdateApiV2Response
"""
return self.update_api_v2_with_http_info(request)
def update_api_v2_with_http_info(self, request):
"""修改API
修改指定API的信息包括后端服务信息。
:param UpdateApiV2Request request
:return: UpdateApiV2Response
"""
all_params = ['instance_id', 'api_id', 'update_api_v2_request_body']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
if 'api_id' in local_var_params:
path_params['api_id'] = local_var_params['api_id']
query_params = []
header_params = {}
form_params = {}
body_params = None
if 'body' in local_var_params:
body_params = local_var_params['body']
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json;charset=UTF-8'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/apis/{api_id}',
method='PUT',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='UpdateApiV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def canceling_authorization_v2(self, request):
"""解除授权
解除API对APP的授权关系。解除授权后APP将不再能够调用该API。
:param CancelingAuthorizationV2Request request
:return: CancelingAuthorizationV2Response
"""
return self.canceling_authorization_v2_with_http_info(request)
def canceling_authorization_v2_with_http_info(self, request):
"""解除授权
解除API对APP的授权关系。解除授权后APP将不再能够调用该API。
:param CancelingAuthorizationV2Request request
:return: CancelingAuthorizationV2Response
"""
all_params = ['instance_id', 'app_auth_id']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
if 'app_auth_id' in local_var_params:
path_params['app_auth_id'] = local_var_params['app_auth_id']
query_params = []
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/app-auths/{app_auth_id}',
method='DELETE',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='CancelingAuthorizationV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def check_app_v2(self, request):
"""校验APP
校验app是否存在非APP所有者可以调用该接口校验APP是否真实存在。这个接口只展示app的基本信息id 、name、 remark其他信息不显示。
:param CheckAppV2Request request
:return: CheckAppV2Response
"""
return self.check_app_v2_with_http_info(request)
def check_app_v2_with_http_info(self, request):
"""校验APP
校验app是否存在非APP所有者可以调用该接口校验APP是否真实存在。这个接口只展示app的基本信息id 、name、 remark其他信息不显示。
:param CheckAppV2Request request
:return: CheckAppV2Response
"""
all_params = ['instance_id', 'app_id']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
if 'app_id' in local_var_params:
path_params['app_id'] = local_var_params['app_id']
query_params = []
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/apps/validation/{app_id}',
method='GET',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='CheckAppV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def create_an_app_v2(self, request):
"""创建APP
APP即应用是一个可以访问API的身份标识。将API授权给APP后APP即可调用API。 创建一个APP。
:param CreateAnAppV2Request request
:return: CreateAnAppV2Response
"""
return self.create_an_app_v2_with_http_info(request)
def create_an_app_v2_with_http_info(self, request):
"""创建APP
APP即应用是一个可以访问API的身份标识。将API授权给APP后APP即可调用API。 创建一个APP。
:param CreateAnAppV2Request request
:return: CreateAnAppV2Response
"""
all_params = ['instance_id', 'create_an_app_v2_request_body']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
query_params = []
header_params = {}
form_params = {}
body_params = None
if 'body' in local_var_params:
body_params = local_var_params['body']
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json;charset=UTF-8'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/apps',
method='POST',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='CreateAnAppV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def create_authorizing_apps_v2(self, request):
"""APP授权
APP创建成功后还不能访问API如果想要访问某个环境上的API需要将该API在该环境上授权给APP。授权成功后APP即可访问该环境上的这个API。
:param CreateAuthorizingAppsV2Request request
:return: CreateAuthorizingAppsV2Response
"""
return self.create_authorizing_apps_v2_with_http_info(request)
def create_authorizing_apps_v2_with_http_info(self, request):
"""APP授权
APP创建成功后还不能访问API如果想要访问某个环境上的API需要将该API在该环境上授权给APP。授权成功后APP即可访问该环境上的这个API。
:param CreateAuthorizingAppsV2Request request
:return: CreateAuthorizingAppsV2Response
"""
all_params = ['instance_id', 'create_authorizing_apps_v2_request_body']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
query_params = []
header_params = {}
form_params = {}
body_params = None
if 'body' in local_var_params:
body_params = local_var_params['body']
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json;charset=UTF-8'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/app-auths',
method='POST',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='CreateAuthorizingAppsV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def delete_app_v2(self, request):
"""删除APP
删除指定的APP。 APP删除后将无法再调用任何API其中云市场自动创建的APP无法被删除。
:param DeleteAppV2Request request
:return: DeleteAppV2Response
"""
return self.delete_app_v2_with_http_info(request)
def delete_app_v2_with_http_info(self, request):
"""删除APP
删除指定的APP。 APP删除后将无法再调用任何API其中云市场自动创建的APP无法被删除。
:param DeleteAppV2Request request
:return: DeleteAppV2Response
"""
all_params = ['instance_id', 'app_id']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
if 'app_id' in local_var_params:
path_params['app_id'] = local_var_params['app_id']
query_params = []
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/apps/{app_id}',
method='DELETE',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='DeleteAppV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def list_apis_binded_to_app_v2(self, request):
"""查看APP已绑定的API列表
查询APP已经绑定的API列表。
:param ListApisBindedToAppV2Request request
:return: ListApisBindedToAppV2Response
"""
return self.list_apis_binded_to_app_v2_with_http_info(request)
def list_apis_binded_to_app_v2_with_http_info(self, request):
"""查看APP已绑定的API列表
查询APP已经绑定的API列表。
:param ListApisBindedToAppV2Request request
:return: ListApisBindedToAppV2Response
"""
all_params = ['instance_id', 'app_id', 'api_id', 'api_name', 'group_id', 'group_name', 'env_id', 'offset', 'limit']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
query_params = []
if 'app_id' in local_var_params:
query_params.append(('app_id', local_var_params['app_id']))
if 'api_id' in local_var_params:
query_params.append(('api_id', local_var_params['api_id']))
if 'api_name' in local_var_params:
query_params.append(('api_name', local_var_params['api_name']))
if 'group_id' in local_var_params:
query_params.append(('group_id', local_var_params['group_id']))
if 'group_name' in local_var_params:
query_params.append(('group_name', local_var_params['group_name']))
if 'env_id' in local_var_params:
query_params.append(('env_id', local_var_params['env_id']))
if 'offset' in local_var_params:
query_params.append(('offset', local_var_params['offset']))
if 'limit' in local_var_params:
query_params.append(('limit', local_var_params['limit']))
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/app-auths/binded-apis',
method='GET',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='ListApisBindedToAppV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def list_apis_unbinded_to_app_v2(self, request):
"""查看APP未绑定的API列表
查询指定环境上某个APP未绑定的API列表包括自有API和从云市场购买的API。
:param ListApisUnbindedToAppV2Request request
:return: ListApisUnbindedToAppV2Response
"""
return self.list_apis_unbinded_to_app_v2_with_http_info(request)
def list_apis_unbinded_to_app_v2_with_http_info(self, request):
"""查看APP未绑定的API列表
查询指定环境上某个APP未绑定的API列表包括自有API和从云市场购买的API。
:param ListApisUnbindedToAppV2Request request
:return: ListApisUnbindedToAppV2Response
"""
all_params = ['instance_id', 'app_id', 'env_id', 'group_id', 'api_id', 'api_name', 'offset', 'limit']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
query_params = []
if 'app_id' in local_var_params:
query_params.append(('app_id', local_var_params['app_id']))
if 'env_id' in local_var_params:
query_params.append(('env_id', local_var_params['env_id']))
if 'group_id' in local_var_params:
query_params.append(('group_id', local_var_params['group_id']))
if 'api_id' in local_var_params:
query_params.append(('api_id', local_var_params['api_id']))
if 'api_name' in local_var_params:
query_params.append(('api_name', local_var_params['api_name']))
if 'offset' in local_var_params:
query_params.append(('offset', local_var_params['offset']))
if 'limit' in local_var_params:
query_params.append(('limit', local_var_params['limit']))
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/app-auths/unbinded-apis',
method='GET',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='ListApisUnbindedToAppV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def list_apps_binded_to_api_v2(self, request):
"""查看API已绑定的APP列表
查询API绑定的APP列表。
:param ListAppsBindedToApiV2Request request
:return: ListAppsBindedToApiV2Response
"""
return self.list_apps_binded_to_api_v2_with_http_info(request)
def list_apps_binded_to_api_v2_with_http_info(self, request):
"""查看API已绑定的APP列表
查询API绑定的APP列表。
:param ListAppsBindedToApiV2Request request
:return: ListAppsBindedToApiV2Response
"""
all_params = ['instance_id', 'api_id', 'app_name', 'app_id', 'env_id', 'offset', 'limit']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
query_params = []
if 'api_id' in local_var_params:
query_params.append(('api_id', local_var_params['api_id']))
if 'app_name' in local_var_params:
query_params.append(('app_name', local_var_params['app_name']))
if 'app_id' in local_var_params:
query_params.append(('app_id', local_var_params['app_id']))
if 'env_id' in local_var_params:
query_params.append(('env_id', local_var_params['env_id']))
if 'offset' in local_var_params:
query_params.append(('offset', local_var_params['offset']))
if 'limit' in local_var_params:
query_params.append(('limit', local_var_params['limit']))
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/app-auths/binded-apps',
method='GET',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='ListAppsBindedToApiV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def list_apps_v2(self, request):
"""查询APP列表
查询APP列表。
:param ListAppsV2Request request
:return: ListAppsV2Response
"""
return self.list_apps_v2_with_http_info(request)
def list_apps_v2_with_http_info(self, request):
"""查询APP列表
查询APP列表。
:param ListAppsV2Request request
:return: ListAppsV2Response
"""
all_params = ['instance_id', 'id', 'name', 'status', 'app_key', 'creator', 'offset', 'limit', 'precise_search']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
query_params = []
if 'id' in local_var_params:
query_params.append(('id', local_var_params['id']))
if 'name' in local_var_params:
query_params.append(('name', local_var_params['name']))
if 'status' in local_var_params:
query_params.append(('status', local_var_params['status']))
if 'app_key' in local_var_params:
query_params.append(('app_key', local_var_params['app_key']))
if 'creator' in local_var_params:
query_params.append(('creator', local_var_params['creator']))
if 'offset' in local_var_params:
query_params.append(('offset', local_var_params['offset']))
if 'limit' in local_var_params:
query_params.append(('limit', local_var_params['limit']))
if 'precise_search' in local_var_params:
query_params.append(('precise_search', local_var_params['precise_search']))
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/apps',
method='GET',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='ListAppsV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def resetting_app_secret_v2(self, request):
"""重置密钥
重置指定APP的密钥。
:param ResettingAppSecretV2Request request
:return: ResettingAppSecretV2Response
"""
return self.resetting_app_secret_v2_with_http_info(request)
def resetting_app_secret_v2_with_http_info(self, request):
"""重置密钥
重置指定APP的密钥。
:param ResettingAppSecretV2Request request
:return: ResettingAppSecretV2Response
"""
all_params = ['instance_id', 'app_id', 'resetting_app_secret_v2_request_body']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
if 'app_id' in local_var_params:
path_params['app_id'] = local_var_params['app_id']
query_params = []
header_params = {}
form_params = {}
body_params = None
if 'body' in local_var_params:
body_params = local_var_params['body']
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json;charset=UTF-8'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/apps/secret/{app_id}',
method='PUT',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='ResettingAppSecretV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def show_details_of_app_v2(self, request):
"""查看APP详情
查看指定APP的详细信息。
:param ShowDetailsOfAppV2Request request
:return: ShowDetailsOfAppV2Response
"""
return self.show_details_of_app_v2_with_http_info(request)
def show_details_of_app_v2_with_http_info(self, request):
"""查看APP详情
查看指定APP的详细信息。
:param ShowDetailsOfAppV2Request request
:return: ShowDetailsOfAppV2Response
"""
all_params = ['instance_id', 'app_id']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
if 'app_id' in local_var_params:
path_params['app_id'] = local_var_params['app_id']
query_params = []
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/apps/{app_id}',
method='GET',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='ShowDetailsOfAppV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def update_app_v2(self, request):
"""修改APP
修改指定APP的信息。其中可修改的属性为name、remark当支持用户自定义key和secret的开关开启时app_key和app_secret也支持修改其它属性不可修改。
:param UpdateAppV2Request request
:return: UpdateAppV2Response
"""
return self.update_app_v2_with_http_info(request)
def update_app_v2_with_http_info(self, request):
"""修改APP
修改指定APP的信息。其中可修改的属性为name、remark当支持用户自定义key和secret的开关开启时app_key和app_secret也支持修改其它属性不可修改。
:param UpdateAppV2Request request
:return: UpdateAppV2Response
"""
all_params = ['instance_id', 'app_id', 'update_app_v2_request_body']
local_var_params = {}
for attr in request.attribute_map:
if hasattr(request, attr):
local_var_params[attr] = getattr(request, attr)
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
if 'app_id' in local_var_params:
path_params['app_id'] = local_var_params['app_id']
query_params = []
header_params = {}
form_params = {}
body_params = None
if 'body' in local_var_params:
body_params = local_var_params['body']
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json;charset=UTF-8'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/apigw/instances/{instance_id}/apps/{app_id}',
method='PUT',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='UpdateAppV2Response',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def call_api(self, resource_path, method, path_params=None, query_params=None, header_params=None, body=None,
post_params=None, response_type=None, response_headers=None, auth_settings=None,
collection_formats=None, request_type=None):
"""Makes the HTTP request and returns deserialized data.
:param resource_path: Path to method endpoint.
:param method: Method to call.
:param path_params: Path parameters in the url.
:param query_params: Query parameters in the url.
:param header_params: Header parameters to be placed in the request header.
:param body: Request body.
:param post_params dict: Request post form parameters,
for `application/x-www-form-urlencoded`, `multipart/form-data`.
:param auth_settings list: Auth Settings names for the request.
:param response_type: Response data type.
:param response_headers: Header should be added to response data.
:param collection_formats: dict of collection formats for path, query,
header, and post parameters.
:param request_type: Request data type.
:return:
Return the response directly.
"""
return self.do_http_request(
method=method,
resource_path=resource_path,
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body,
post_params=post_params,
response_type=response_type,
response_headers=response_headers,
collection_formats=collection_formats,
request_type=request_type)