2020-07-15 09:30:15 +00:00
|
|
|
|
# coding: utf-8
|
|
|
|
|
|
|
|
|
|
from __future__ import absolute_import
|
|
|
|
|
|
|
|
|
|
import datetime
|
|
|
|
|
import re
|
|
|
|
|
import importlib
|
|
|
|
|
|
|
|
|
|
import six
|
|
|
|
|
|
2020-07-30 11:19:13 +00:00
|
|
|
|
from huaweicloudsdkcore.client import Client, ClientBuilder
|
2020-07-15 09:30:15 +00:00
|
|
|
|
from huaweicloudsdkcore.exceptions import exceptions
|
|
|
|
|
from huaweicloudsdkcore.utils import http_utils
|
|
|
|
|
from huaweicloudsdkcore.sdk_stream_request import SdkStreamRequest
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class EpsClient(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(EpsClient, self).__init__()
|
|
|
|
|
self.model_package = importlib.import_module("huaweicloudsdkeps.v1.model")
|
|
|
|
|
self.preset_headers = {'User-Agent': 'HuaweiCloud-SDK-Python'}
|
|
|
|
|
|
2020-07-30 11:19:13 +00:00
|
|
|
|
@staticmethod
|
|
|
|
|
def new_builder(clazz):
|
|
|
|
|
return ClientBuilder(clazz, "GlobalCredentials")
|
2020-07-15 09:30:15 +00:00
|
|
|
|
|
2020-10-31 09:07:36 +00:00
|
|
|
|
def create_enterprise_project(self, request):
|
2020-07-15 09:30:15 +00:00
|
|
|
|
"""创建企业项目
|
|
|
|
|
|
|
|
|
|
创建企业项目。
|
|
|
|
|
|
2020-10-31 09:07:36 +00:00
|
|
|
|
:param CreateEnterpriseProjectRequest request
|
|
|
|
|
:return: CreateEnterpriseProjectResponse
|
2020-07-15 09:30:15 +00:00
|
|
|
|
"""
|
2020-10-31 09:07:36 +00:00
|
|
|
|
return self.create_enterprise_project_with_http_info(request)
|
2020-07-15 09:30:15 +00:00
|
|
|
|
|
2020-10-31 09:07:36 +00:00
|
|
|
|
def create_enterprise_project_with_http_info(self, request):
|
2020-07-15 09:30:15 +00:00
|
|
|
|
"""创建企业项目
|
|
|
|
|
|
|
|
|
|
创建企业项目。
|
|
|
|
|
|
2020-10-31 09:07:36 +00:00
|
|
|
|
:param CreateEnterpriseProjectRequest request
|
|
|
|
|
:return: CreateEnterpriseProjectResponse
|
2020-07-15 09:30:15 +00:00
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
all_params = ['create_ep']
|
|
|
|
|
local_var_params = {}
|
|
|
|
|
for attr in request.attribute_map:
|
|
|
|
|
if hasattr(request, attr):
|
|
|
|
|
local_var_params[attr] = getattr(request, attr)
|
|
|
|
|
|
|
|
|
|
collection_formats = {}
|
|
|
|
|
|
|
|
|
|
path_params = {}
|
|
|
|
|
|
|
|
|
|
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()
|
|
|
|
|
|
2020-10-31 09:07:36 +00:00
|
|
|
|
response_headers = []
|
|
|
|
|
|
2020-07-15 09:30:15 +00:00
|
|
|
|
header_params['Content-Type'] = http_utils.select_header_content_type(
|
2020-08-28 10:16:33 +00:00
|
|
|
|
['application/json;charset=UTF-8'])
|
2020-07-15 09:30:15 +00:00
|
|
|
|
|
|
|
|
|
auth_settings = []
|
|
|
|
|
|
|
|
|
|
return self.call_api(
|
|
|
|
|
resource_path='/v1.0/enterprise-projects',
|
|
|
|
|
method='POST',
|
|
|
|
|
path_params=path_params,
|
|
|
|
|
query_params=query_params,
|
|
|
|
|
header_params=header_params,
|
|
|
|
|
body=body_params,
|
|
|
|
|
post_params=form_params,
|
2020-10-31 09:07:36 +00:00
|
|
|
|
response_type='CreateEnterpriseProjectResponse',
|
|
|
|
|
response_headers=response_headers,
|
2020-07-15 09:30:15 +00:00
|
|
|
|
auth_settings=auth_settings,
|
|
|
|
|
collection_formats=collection_formats,
|
|
|
|
|
request_type=request.__class__.__name__)
|
|
|
|
|
|
2020-07-30 11:19:13 +00:00
|
|
|
|
|
2020-10-31 09:07:36 +00:00
|
|
|
|
def disable_enterprise_project(self, request):
|
2020-07-15 09:30:15 +00:00
|
|
|
|
"""停用企业项目
|
|
|
|
|
|
|
|
|
|
停用企业项目。
|
|
|
|
|
|
2020-10-31 09:07:36 +00:00
|
|
|
|
:param DisableEnterpriseProjectRequest request
|
|
|
|
|
:return: DisableEnterpriseProjectResponse
|
2020-07-15 09:30:15 +00:00
|
|
|
|
"""
|
2020-10-31 09:07:36 +00:00
|
|
|
|
return self.disable_enterprise_project_with_http_info(request)
|
2020-07-15 09:30:15 +00:00
|
|
|
|
|
2020-10-31 09:07:36 +00:00
|
|
|
|
def disable_enterprise_project_with_http_info(self, request):
|
2020-07-15 09:30:15 +00:00
|
|
|
|
"""停用企业项目
|
|
|
|
|
|
|
|
|
|
停用企业项目。
|
|
|
|
|
|
2020-10-31 09:07:36 +00:00
|
|
|
|
:param DisableEnterpriseProjectRequest request
|
|
|
|
|
:return: DisableEnterpriseProjectResponse
|
2020-07-15 09:30:15 +00:00
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
all_params = ['enterprise_project_id', 'action']
|
|
|
|
|
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 'enterprise_project_id' in local_var_params:
|
|
|
|
|
path_params['enterprise_project_id'] = local_var_params['enterprise_project_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()
|
|
|
|
|
|
2020-10-31 09:07:36 +00:00
|
|
|
|
response_headers = []
|
|
|
|
|
|
2020-07-15 09:30:15 +00:00
|
|
|
|
header_params['Content-Type'] = http_utils.select_header_content_type(
|
2020-08-28 10:16:33 +00:00
|
|
|
|
['application/json;charset=UTF-8'])
|
2020-07-15 09:30:15 +00:00
|
|
|
|
|
|
|
|
|
auth_settings = []
|
|
|
|
|
|
|
|
|
|
return self.call_api(
|
|
|
|
|
resource_path='/v1.0/enterprise-projects/{enterprise_project_id}/action',
|
|
|
|
|
method='POST',
|
|
|
|
|
path_params=path_params,
|
|
|
|
|
query_params=query_params,
|
|
|
|
|
header_params=header_params,
|
|
|
|
|
body=body_params,
|
|
|
|
|
post_params=form_params,
|
2020-10-31 09:07:36 +00:00
|
|
|
|
response_type='DisableEnterpriseProjectResponse',
|
|
|
|
|
response_headers=response_headers,
|
2020-07-15 09:30:15 +00:00
|
|
|
|
auth_settings=auth_settings,
|
|
|
|
|
collection_formats=collection_formats,
|
|
|
|
|
request_type=request.__class__.__name__)
|
|
|
|
|
|
2020-07-30 11:19:13 +00:00
|
|
|
|
|
2020-10-31 09:07:36 +00:00
|
|
|
|
def enable_enterprise_project(self, request):
|
2020-07-15 09:30:15 +00:00
|
|
|
|
"""启用企业项目
|
|
|
|
|
|
|
|
|
|
启用企业项目。
|
|
|
|
|
|
2020-10-31 09:07:36 +00:00
|
|
|
|
:param EnableEnterpriseProjectRequest request
|
|
|
|
|
:return: EnableEnterpriseProjectResponse
|
2020-07-15 09:30:15 +00:00
|
|
|
|
"""
|
2020-10-31 09:07:36 +00:00
|
|
|
|
return self.enable_enterprise_project_with_http_info(request)
|
2020-07-15 09:30:15 +00:00
|
|
|
|
|
2020-10-31 09:07:36 +00:00
|
|
|
|
def enable_enterprise_project_with_http_info(self, request):
|
2020-07-15 09:30:15 +00:00
|
|
|
|
"""启用企业项目
|
|
|
|
|
|
|
|
|
|
启用企业项目。
|
|
|
|
|
|
2020-10-31 09:07:36 +00:00
|
|
|
|
:param EnableEnterpriseProjectRequest request
|
|
|
|
|
:return: EnableEnterpriseProjectResponse
|
2020-07-15 09:30:15 +00:00
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
all_params = ['enterprise_project_id', 'action']
|
|
|
|
|
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 'enterprise_project_id' in local_var_params:
|
|
|
|
|
path_params['enterprise_project_id'] = local_var_params['enterprise_project_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()
|
|
|
|
|
|
2020-10-31 09:07:36 +00:00
|
|
|
|
response_headers = []
|
|
|
|
|
|
2020-07-15 09:30:15 +00:00
|
|
|
|
header_params['Content-Type'] = http_utils.select_header_content_type(
|
2020-08-28 10:16:33 +00:00
|
|
|
|
['application/json;charset=UTF-8'])
|
2020-07-15 09:30:15 +00:00
|
|
|
|
|
|
|
|
|
auth_settings = []
|
|
|
|
|
|
|
|
|
|
return self.call_api(
|
|
|
|
|
resource_path='/v1.0/enterprise-projects/{enterprise_project_id}/action',
|
|
|
|
|
method='POST',
|
|
|
|
|
path_params=path_params,
|
|
|
|
|
query_params=query_params,
|
|
|
|
|
header_params=header_params,
|
|
|
|
|
body=body_params,
|
|
|
|
|
post_params=form_params,
|
2020-10-31 09:07:36 +00:00
|
|
|
|
response_type='EnableEnterpriseProjectResponse',
|
|
|
|
|
response_headers=response_headers,
|
2020-07-15 09:30:15 +00:00
|
|
|
|
auth_settings=auth_settings,
|
|
|
|
|
collection_formats=collection_formats,
|
|
|
|
|
request_type=request.__class__.__name__)
|
|
|
|
|
|
2020-07-30 11:19:13 +00:00
|
|
|
|
|
2020-07-15 09:30:15 +00:00
|
|
|
|
def list_api_versions(self, request):
|
|
|
|
|
"""查询API版本列表
|
|
|
|
|
|
|
|
|
|
查询企业项目的API版本列表。
|
|
|
|
|
|
|
|
|
|
:param ListApiVersionsRequest request
|
|
|
|
|
:return: ListApiVersionsResponse
|
|
|
|
|
"""
|
|
|
|
|
return self.list_api_versions_with_http_info(request)
|
|
|
|
|
|
|
|
|
|
def list_api_versions_with_http_info(self, request):
|
|
|
|
|
"""查询API版本列表
|
|
|
|
|
|
|
|
|
|
查询企业项目的API版本列表。
|
|
|
|
|
|
|
|
|
|
:param ListApiVersionsRequest request
|
|
|
|
|
:return: ListApiVersionsResponse
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
all_params = []
|
|
|
|
|
local_var_params = {}
|
|
|
|
|
for attr in request.attribute_map:
|
|
|
|
|
if hasattr(request, attr):
|
|
|
|
|
local_var_params[attr] = getattr(request, attr)
|
|
|
|
|
|
|
|
|
|
collection_formats = {}
|
|
|
|
|
|
|
|
|
|
path_params = {}
|
|
|
|
|
|
|
|
|
|
query_params = []
|
|
|
|
|
|
|
|
|
|
header_params = {}
|
|
|
|
|
|
|
|
|
|
form_params = {}
|
|
|
|
|
|
|
|
|
|
body_params = None
|
|
|
|
|
if isinstance(request, SdkStreamRequest):
|
|
|
|
|
body_params = request.get_file_stream()
|
|
|
|
|
|
2020-10-31 09:07:36 +00:00
|
|
|
|
response_headers = []
|
|
|
|
|
|
2020-12-15 11:55:36 +00:00
|
|
|
|
header_params['Content-Type'] = http_utils.select_header_content_type(
|
|
|
|
|
['application/json'])
|
2020-07-15 09:30:15 +00:00
|
|
|
|
|
|
|
|
|
auth_settings = []
|
|
|
|
|
|
|
|
|
|
return self.call_api(
|
|
|
|
|
resource_path='/',
|
|
|
|
|
method='GET',
|
|
|
|
|
path_params=path_params,
|
|
|
|
|
query_params=query_params,
|
|
|
|
|
header_params=header_params,
|
|
|
|
|
body=body_params,
|
|
|
|
|
post_params=form_params,
|
|
|
|
|
response_type='ListApiVersionsResponse',
|
2020-10-31 09:07:36 +00:00
|
|
|
|
response_headers=response_headers,
|
2020-07-15 09:30:15 +00:00
|
|
|
|
auth_settings=auth_settings,
|
|
|
|
|
collection_formats=collection_formats,
|
|
|
|
|
request_type=request.__class__.__name__)
|
|
|
|
|
|
2020-07-30 11:19:13 +00:00
|
|
|
|
|
2020-10-31 09:07:36 +00:00
|
|
|
|
def list_enterprise_project(self, request):
|
2020-07-15 09:30:15 +00:00
|
|
|
|
"""查询企业项目列表
|
|
|
|
|
|
|
|
|
|
查询当前用户已授权的企业项目列表,用户可以使用企业项目绑定资源。
|
|
|
|
|
|
2020-10-31 09:07:36 +00:00
|
|
|
|
:param ListEnterpriseProjectRequest request
|
|
|
|
|
:return: ListEnterpriseProjectResponse
|
2020-07-15 09:30:15 +00:00
|
|
|
|
"""
|
2020-10-31 09:07:36 +00:00
|
|
|
|
return self.list_enterprise_project_with_http_info(request)
|
2020-07-15 09:30:15 +00:00
|
|
|
|
|
2020-10-31 09:07:36 +00:00
|
|
|
|
def list_enterprise_project_with_http_info(self, request):
|
2020-07-15 09:30:15 +00:00
|
|
|
|
"""查询企业项目列表
|
|
|
|
|
|
|
|
|
|
查询当前用户已授权的企业项目列表,用户可以使用企业项目绑定资源。
|
|
|
|
|
|
2020-10-31 09:07:36 +00:00
|
|
|
|
:param ListEnterpriseProjectRequest request
|
|
|
|
|
:return: ListEnterpriseProjectResponse
|
2020-07-15 09:30:15 +00:00
|
|
|
|
"""
|
|
|
|
|
|
2020-10-31 09:07:36 +00:00
|
|
|
|
all_params = ['offset', 'id', 'limit', 'name', 'sort_dir', 'sort_key', 'status']
|
2020-07-15 09:30:15 +00:00
|
|
|
|
local_var_params = {}
|
|
|
|
|
for attr in request.attribute_map:
|
|
|
|
|
if hasattr(request, attr):
|
|
|
|
|
local_var_params[attr] = getattr(request, attr)
|
|
|
|
|
|
|
|
|
|
collection_formats = {}
|
|
|
|
|
|
|
|
|
|
path_params = {}
|
|
|
|
|
|
|
|
|
|
query_params = []
|
|
|
|
|
if 'id' in local_var_params:
|
|
|
|
|
query_params.append(('id', local_var_params['id']))
|
|
|
|
|
if 'limit' in local_var_params:
|
|
|
|
|
query_params.append(('limit', local_var_params['limit']))
|
2020-10-31 09:07:36 +00:00
|
|
|
|
if 'name' in local_var_params:
|
|
|
|
|
query_params.append(('name', local_var_params['name']))
|
2020-07-15 09:30:15 +00:00
|
|
|
|
if 'offset' in local_var_params:
|
|
|
|
|
query_params.append(('offset', local_var_params['offset']))
|
|
|
|
|
if 'sort_dir' in local_var_params:
|
|
|
|
|
query_params.append(('sort_dir', local_var_params['sort_dir']))
|
2020-10-31 09:07:36 +00:00
|
|
|
|
if 'sort_key' in local_var_params:
|
|
|
|
|
query_params.append(('sort_key', local_var_params['sort_key']))
|
|
|
|
|
if 'status' in local_var_params:
|
|
|
|
|
query_params.append(('status', local_var_params['status']))
|
2020-07-15 09:30:15 +00:00
|
|
|
|
|
|
|
|
|
header_params = {}
|
|
|
|
|
|
|
|
|
|
form_params = {}
|
|
|
|
|
|
|
|
|
|
body_params = None
|
|
|
|
|
if isinstance(request, SdkStreamRequest):
|
|
|
|
|
body_params = request.get_file_stream()
|
|
|
|
|
|
2020-10-31 09:07:36 +00:00
|
|
|
|
response_headers = []
|
|
|
|
|
|
2020-12-15 11:55:36 +00:00
|
|
|
|
header_params['Content-Type'] = http_utils.select_header_content_type(
|
|
|
|
|
['application/json'])
|
2020-07-15 09:30:15 +00:00
|
|
|
|
|
|
|
|
|
auth_settings = []
|
|
|
|
|
|
|
|
|
|
return self.call_api(
|
|
|
|
|
resource_path='/v1.0/enterprise-projects',
|
|
|
|
|
method='GET',
|
|
|
|
|
path_params=path_params,
|
|
|
|
|
query_params=query_params,
|
|
|
|
|
header_params=header_params,
|
|
|
|
|
body=body_params,
|
|
|
|
|
post_params=form_params,
|
2020-10-31 09:07:36 +00:00
|
|
|
|
response_type='ListEnterpriseProjectResponse',
|
|
|
|
|
response_headers=response_headers,
|
2020-07-15 09:30:15 +00:00
|
|
|
|
auth_settings=auth_settings,
|
|
|
|
|
collection_formats=collection_formats,
|
|
|
|
|
request_type=request.__class__.__name__)
|
|
|
|
|
|
2020-07-30 11:19:13 +00:00
|
|
|
|
|
2020-07-15 09:30:15 +00:00
|
|
|
|
def migrate_resource(self, request):
|
|
|
|
|
"""迁移资源
|
|
|
|
|
|
|
|
|
|
迁移资源到目标企业项目。
|
|
|
|
|
|
|
|
|
|
:param MigrateResourceRequest request
|
|
|
|
|
:return: MigrateResourceResponse
|
|
|
|
|
"""
|
|
|
|
|
return self.migrate_resource_with_http_info(request)
|
|
|
|
|
|
|
|
|
|
def migrate_resource_with_http_info(self, request):
|
|
|
|
|
"""迁移资源
|
|
|
|
|
|
|
|
|
|
迁移资源到目标企业项目。
|
|
|
|
|
|
|
|
|
|
:param MigrateResourceRequest request
|
|
|
|
|
:return: MigrateResourceResponse
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
all_params = ['enterprise_project_id', 'req_migrate_resource']
|
|
|
|
|
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 'enterprise_project_id' in local_var_params:
|
|
|
|
|
path_params['enterprise_project_id'] = local_var_params['enterprise_project_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()
|
|
|
|
|
|
2020-10-31 09:07:36 +00:00
|
|
|
|
response_headers = []
|
|
|
|
|
|
2020-07-15 09:30:15 +00:00
|
|
|
|
header_params['Content-Type'] = http_utils.select_header_content_type(
|
2020-08-28 10:16:33 +00:00
|
|
|
|
['application/json;charset=UTF-8'])
|
2020-07-15 09:30:15 +00:00
|
|
|
|
|
|
|
|
|
auth_settings = []
|
|
|
|
|
|
|
|
|
|
return self.call_api(
|
|
|
|
|
resource_path='/v1.0/enterprise-projects/{enterprise_project_id}/resources-migrate',
|
|
|
|
|
method='POST',
|
|
|
|
|
path_params=path_params,
|
|
|
|
|
query_params=query_params,
|
|
|
|
|
header_params=header_params,
|
|
|
|
|
body=body_params,
|
|
|
|
|
post_params=form_params,
|
|
|
|
|
response_type='MigrateResourceResponse',
|
2020-10-31 09:07:36 +00:00
|
|
|
|
response_headers=response_headers,
|
2020-07-15 09:30:15 +00:00
|
|
|
|
auth_settings=auth_settings,
|
|
|
|
|
collection_formats=collection_formats,
|
|
|
|
|
request_type=request.__class__.__name__)
|
|
|
|
|
|
2020-07-30 11:19:13 +00:00
|
|
|
|
|
2020-10-31 09:07:36 +00:00
|
|
|
|
def modify_enterprise_project(self, request):
|
2020-07-15 09:30:15 +00:00
|
|
|
|
"""修改企业项目
|
|
|
|
|
|
|
|
|
|
修改企业项目。当前仅支持修改名称和描述。
|
|
|
|
|
|
2020-10-31 09:07:36 +00:00
|
|
|
|
:param ModifyEnterpriseProjectRequest request
|
|
|
|
|
:return: ModifyEnterpriseProjectResponse
|
2020-07-15 09:30:15 +00:00
|
|
|
|
"""
|
2020-10-31 09:07:36 +00:00
|
|
|
|
return self.modify_enterprise_project_with_http_info(request)
|
2020-07-15 09:30:15 +00:00
|
|
|
|
|
2020-10-31 09:07:36 +00:00
|
|
|
|
def modify_enterprise_project_with_http_info(self, request):
|
2020-07-15 09:30:15 +00:00
|
|
|
|
"""修改企业项目
|
|
|
|
|
|
|
|
|
|
修改企业项目。当前仅支持修改名称和描述。
|
|
|
|
|
|
2020-10-31 09:07:36 +00:00
|
|
|
|
:param ModifyEnterpriseProjectRequest request
|
|
|
|
|
:return: ModifyEnterpriseProjectResponse
|
2020-07-15 09:30:15 +00:00
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
all_params = ['enterprise_project_id', 'modify_ep']
|
|
|
|
|
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 'enterprise_project_id' in local_var_params:
|
|
|
|
|
path_params['enterprise_project_id'] = local_var_params['enterprise_project_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()
|
|
|
|
|
|
2020-10-31 09:07:36 +00:00
|
|
|
|
response_headers = []
|
|
|
|
|
|
2020-07-15 09:30:15 +00:00
|
|
|
|
header_params['Content-Type'] = http_utils.select_header_content_type(
|
2020-08-28 10:16:33 +00:00
|
|
|
|
['application/json;charset=UTF-8'])
|
2020-07-15 09:30:15 +00:00
|
|
|
|
|
|
|
|
|
auth_settings = []
|
|
|
|
|
|
|
|
|
|
return self.call_api(
|
|
|
|
|
resource_path='/v1.0/enterprise-projects/{enterprise_project_id}',
|
|
|
|
|
method='PUT',
|
|
|
|
|
path_params=path_params,
|
|
|
|
|
query_params=query_params,
|
|
|
|
|
header_params=header_params,
|
|
|
|
|
body=body_params,
|
|
|
|
|
post_params=form_params,
|
2020-10-31 09:07:36 +00:00
|
|
|
|
response_type='ModifyEnterpriseProjectResponse',
|
|
|
|
|
response_headers=response_headers,
|
2020-07-15 09:30:15 +00:00
|
|
|
|
auth_settings=auth_settings,
|
|
|
|
|
collection_formats=collection_formats,
|
|
|
|
|
request_type=request.__class__.__name__)
|
|
|
|
|
|
2020-07-30 11:19:13 +00:00
|
|
|
|
|
2020-07-15 09:30:15 +00:00
|
|
|
|
def show_api_version(self, request):
|
|
|
|
|
"""查询API版本号详情
|
|
|
|
|
|
|
|
|
|
查询指定的企业项目API版本号详情
|
|
|
|
|
|
|
|
|
|
:param ShowApiVersionRequest request
|
|
|
|
|
:return: ShowApiVersionResponse
|
|
|
|
|
"""
|
|
|
|
|
return self.show_api_version_with_http_info(request)
|
|
|
|
|
|
|
|
|
|
def show_api_version_with_http_info(self, request):
|
|
|
|
|
"""查询API版本号详情
|
|
|
|
|
|
|
|
|
|
查询指定的企业项目API版本号详情
|
|
|
|
|
|
|
|
|
|
:param ShowApiVersionRequest request
|
|
|
|
|
:return: ShowApiVersionResponse
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
all_params = ['api_version']
|
|
|
|
|
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 'api_version' in local_var_params:
|
|
|
|
|
path_params['api_version'] = local_var_params['api_version']
|
|
|
|
|
|
|
|
|
|
query_params = []
|
|
|
|
|
|
|
|
|
|
header_params = {}
|
|
|
|
|
|
|
|
|
|
form_params = {}
|
|
|
|
|
|
|
|
|
|
body_params = None
|
|
|
|
|
if isinstance(request, SdkStreamRequest):
|
|
|
|
|
body_params = request.get_file_stream()
|
|
|
|
|
|
2020-10-31 09:07:36 +00:00
|
|
|
|
response_headers = []
|
|
|
|
|
|
2020-12-15 11:55:36 +00:00
|
|
|
|
header_params['Content-Type'] = http_utils.select_header_content_type(
|
|
|
|
|
['application/json'])
|
2020-07-15 09:30:15 +00:00
|
|
|
|
|
|
|
|
|
auth_settings = []
|
|
|
|
|
|
|
|
|
|
return self.call_api(
|
|
|
|
|
resource_path='/{api_version}',
|
|
|
|
|
method='GET',
|
|
|
|
|
path_params=path_params,
|
|
|
|
|
query_params=query_params,
|
|
|
|
|
header_params=header_params,
|
|
|
|
|
body=body_params,
|
|
|
|
|
post_params=form_params,
|
|
|
|
|
response_type='ShowApiVersionResponse',
|
2020-10-31 09:07:36 +00:00
|
|
|
|
response_headers=response_headers,
|
2020-07-15 09:30:15 +00:00
|
|
|
|
auth_settings=auth_settings,
|
|
|
|
|
collection_formats=collection_formats,
|
|
|
|
|
request_type=request.__class__.__name__)
|
|
|
|
|
|
2020-07-30 11:19:13 +00:00
|
|
|
|
|
2020-10-31 09:07:36 +00:00
|
|
|
|
def show_enterprise_project(self, request):
|
2020-07-15 09:30:15 +00:00
|
|
|
|
"""查询企业项目详情
|
|
|
|
|
|
|
|
|
|
查询企业项目详情。
|
|
|
|
|
|
2020-10-31 09:07:36 +00:00
|
|
|
|
:param ShowEnterpriseProjectRequest request
|
|
|
|
|
:return: ShowEnterpriseProjectResponse
|
2020-07-15 09:30:15 +00:00
|
|
|
|
"""
|
2020-10-31 09:07:36 +00:00
|
|
|
|
return self.show_enterprise_project_with_http_info(request)
|
2020-07-15 09:30:15 +00:00
|
|
|
|
|
2020-10-31 09:07:36 +00:00
|
|
|
|
def show_enterprise_project_with_http_info(self, request):
|
2020-07-15 09:30:15 +00:00
|
|
|
|
"""查询企业项目详情
|
|
|
|
|
|
|
|
|
|
查询企业项目详情。
|
|
|
|
|
|
2020-10-31 09:07:36 +00:00
|
|
|
|
:param ShowEnterpriseProjectRequest request
|
|
|
|
|
:return: ShowEnterpriseProjectResponse
|
2020-07-15 09:30:15 +00:00
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
all_params = ['enterprise_project_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 'enterprise_project_id' in local_var_params:
|
|
|
|
|
path_params['enterprise_project_id'] = local_var_params['enterprise_project_id']
|
|
|
|
|
|
|
|
|
|
query_params = []
|
|
|
|
|
|
|
|
|
|
header_params = {}
|
|
|
|
|
|
|
|
|
|
form_params = {}
|
|
|
|
|
|
|
|
|
|
body_params = None
|
|
|
|
|
if isinstance(request, SdkStreamRequest):
|
|
|
|
|
body_params = request.get_file_stream()
|
|
|
|
|
|
2020-10-31 09:07:36 +00:00
|
|
|
|
response_headers = []
|
|
|
|
|
|
2020-12-15 11:55:36 +00:00
|
|
|
|
header_params['Content-Type'] = http_utils.select_header_content_type(
|
|
|
|
|
['application/json'])
|
2020-07-15 09:30:15 +00:00
|
|
|
|
|
|
|
|
|
auth_settings = []
|
|
|
|
|
|
|
|
|
|
return self.call_api(
|
|
|
|
|
resource_path='/v1.0/enterprise-projects/{enterprise_project_id}',
|
|
|
|
|
method='GET',
|
|
|
|
|
path_params=path_params,
|
|
|
|
|
query_params=query_params,
|
|
|
|
|
header_params=header_params,
|
|
|
|
|
body=body_params,
|
|
|
|
|
post_params=form_params,
|
2020-10-31 09:07:36 +00:00
|
|
|
|
response_type='ShowEnterpriseProjectResponse',
|
|
|
|
|
response_headers=response_headers,
|
2020-07-15 09:30:15 +00:00
|
|
|
|
auth_settings=auth_settings,
|
|
|
|
|
collection_formats=collection_formats,
|
|
|
|
|
request_type=request.__class__.__name__)
|
|
|
|
|
|
2020-07-30 11:19:13 +00:00
|
|
|
|
|
2020-10-31 09:07:36 +00:00
|
|
|
|
def show_enterprise_project_quota(self, request):
|
2020-07-15 09:30:15 +00:00
|
|
|
|
"""查询企业项目配额
|
|
|
|
|
|
|
|
|
|
查询企业项目的配额信息。
|
|
|
|
|
|
2020-10-31 09:07:36 +00:00
|
|
|
|
:param ShowEnterpriseProjectQuotaRequest request
|
|
|
|
|
:return: ShowEnterpriseProjectQuotaResponse
|
2020-07-15 09:30:15 +00:00
|
|
|
|
"""
|
2020-10-31 09:07:36 +00:00
|
|
|
|
return self.show_enterprise_project_quota_with_http_info(request)
|
2020-07-15 09:30:15 +00:00
|
|
|
|
|
2020-10-31 09:07:36 +00:00
|
|
|
|
def show_enterprise_project_quota_with_http_info(self, request):
|
2020-07-15 09:30:15 +00:00
|
|
|
|
"""查询企业项目配额
|
|
|
|
|
|
|
|
|
|
查询企业项目的配额信息。
|
|
|
|
|
|
2020-10-31 09:07:36 +00:00
|
|
|
|
:param ShowEnterpriseProjectQuotaRequest request
|
|
|
|
|
:return: ShowEnterpriseProjectQuotaResponse
|
2020-07-15 09:30:15 +00:00
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
all_params = []
|
|
|
|
|
local_var_params = {}
|
|
|
|
|
for attr in request.attribute_map:
|
|
|
|
|
if hasattr(request, attr):
|
|
|
|
|
local_var_params[attr] = getattr(request, attr)
|
|
|
|
|
|
|
|
|
|
collection_formats = {}
|
|
|
|
|
|
|
|
|
|
path_params = {}
|
|
|
|
|
|
|
|
|
|
query_params = []
|
|
|
|
|
|
|
|
|
|
header_params = {}
|
|
|
|
|
|
|
|
|
|
form_params = {}
|
|
|
|
|
|
|
|
|
|
body_params = None
|
|
|
|
|
if isinstance(request, SdkStreamRequest):
|
|
|
|
|
body_params = request.get_file_stream()
|
|
|
|
|
|
2020-10-31 09:07:36 +00:00
|
|
|
|
response_headers = []
|
|
|
|
|
|
2020-12-15 11:55:36 +00:00
|
|
|
|
header_params['Content-Type'] = http_utils.select_header_content_type(
|
|
|
|
|
['application/json'])
|
2020-07-15 09:30:15 +00:00
|
|
|
|
|
|
|
|
|
auth_settings = []
|
|
|
|
|
|
|
|
|
|
return self.call_api(
|
|
|
|
|
resource_path='/v1.0/enterprise-projects/quotas',
|
|
|
|
|
method='GET',
|
|
|
|
|
path_params=path_params,
|
|
|
|
|
query_params=query_params,
|
|
|
|
|
header_params=header_params,
|
|
|
|
|
body=body_params,
|
|
|
|
|
post_params=form_params,
|
2020-10-31 09:07:36 +00:00
|
|
|
|
response_type='ShowEnterpriseProjectQuotaResponse',
|
|
|
|
|
response_headers=response_headers,
|
2020-07-15 09:30:15 +00:00
|
|
|
|
auth_settings=auth_settings,
|
|
|
|
|
collection_formats=collection_formats,
|
|
|
|
|
request_type=request.__class__.__name__)
|
|
|
|
|
|
2020-07-30 11:19:13 +00:00
|
|
|
|
|
2020-10-31 09:07:36 +00:00
|
|
|
|
def show_resource_bind_enterprise_project(self, request):
|
2020-07-15 09:30:15 +00:00
|
|
|
|
"""查询企业项目绑定的资源列表
|
|
|
|
|
|
|
|
|
|
查询企业项目下绑定的资源详情。
|
|
|
|
|
|
2020-10-31 09:07:36 +00:00
|
|
|
|
:param ShowResourceBindEnterpriseProjectRequest request
|
|
|
|
|
:return: ShowResourceBindEnterpriseProjectResponse
|
2020-07-15 09:30:15 +00:00
|
|
|
|
"""
|
2020-10-31 09:07:36 +00:00
|
|
|
|
return self.show_resource_bind_enterprise_project_with_http_info(request)
|
2020-07-15 09:30:15 +00:00
|
|
|
|
|
2020-10-31 09:07:36 +00:00
|
|
|
|
def show_resource_bind_enterprise_project_with_http_info(self, request):
|
2020-07-15 09:30:15 +00:00
|
|
|
|
"""查询企业项目绑定的资源列表
|
|
|
|
|
|
|
|
|
|
查询企业项目下绑定的资源详情。
|
|
|
|
|
|
2020-10-31 09:07:36 +00:00
|
|
|
|
:param ShowResourceBindEnterpriseProjectRequest request
|
|
|
|
|
:return: ShowResourceBindEnterpriseProjectResponse
|
2020-07-15 09:30:15 +00:00
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
all_params = ['enterprise_project_id', 'req_ep_resouce']
|
|
|
|
|
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 'enterprise_project_id' in local_var_params:
|
|
|
|
|
path_params['enterprise_project_id'] = local_var_params['enterprise_project_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()
|
|
|
|
|
|
2020-10-31 09:07:36 +00:00
|
|
|
|
response_headers = []
|
|
|
|
|
|
2020-07-15 09:30:15 +00:00
|
|
|
|
header_params['Content-Type'] = http_utils.select_header_content_type(
|
2020-08-28 10:16:33 +00:00
|
|
|
|
['application/json;charset=UTF-8'])
|
2020-07-15 09:30:15 +00:00
|
|
|
|
|
|
|
|
|
auth_settings = []
|
|
|
|
|
|
|
|
|
|
return self.call_api(
|
|
|
|
|
resource_path='/v1.0/enterprise-projects/{enterprise_project_id}/resources/filter',
|
|
|
|
|
method='POST',
|
|
|
|
|
path_params=path_params,
|
|
|
|
|
query_params=query_params,
|
|
|
|
|
header_params=header_params,
|
|
|
|
|
body=body_params,
|
|
|
|
|
post_params=form_params,
|
2020-10-31 09:07:36 +00:00
|
|
|
|
response_type='ShowResourceBindEnterpriseProjectResponse',
|
|
|
|
|
response_headers=response_headers,
|
2020-07-15 09:30:15 +00:00
|
|
|
|
auth_settings=auth_settings,
|
|
|
|
|
collection_formats=collection_formats,
|
|
|
|
|
request_type=request.__class__.__name__)
|
|
|
|
|
|
|
|
|
|
|
2020-10-31 09:07:36 +00:00
|
|
|
|
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):
|
2020-07-15 09:30:15 +00:00
|
|
|
|
"""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.
|
2020-10-31 09:07:36 +00:00
|
|
|
|
:param header_params: Header parameters to be placed in the request header.
|
2020-07-15 09:30:15 +00:00
|
|
|
|
: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.
|
2020-10-31 09:07:36 +00:00
|
|
|
|
:param response_headers: Header should be added to response data.
|
2020-07-15 09:30:15 +00:00
|
|
|
|
:param collection_formats: dict of collection formats for path, query,
|
|
|
|
|
header, and post parameters.
|
2020-10-31 09:07:36 +00:00
|
|
|
|
:param request_type: Request data type.
|
2020-07-15 09:30:15 +00:00
|
|
|
|
: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,
|
2020-10-31 09:07:36 +00:00
|
|
|
|
response_headers=response_headers,
|
2020-07-15 09:30:15 +00:00
|
|
|
|
collection_formats=collection_formats,
|
|
|
|
|
request_type=request_type)
|