class CreateCustomer(resource2.Resource): base_path = "%(domain_id)s/partner/customer-mgr/customer" service = bss_service.BssService() allow_create = True # User domain ID domain_id = resource2.URI('domain_id') # request # Account name. domainName = resource2.Body('domainName') # Email address. email = resource2.Body('email') mobilePhone = resource2.Body('mobilePhone') countryCode = resource2.Body('countryCode') # Verification code. verificationCode = resource2.Body('verificationCode') # Unique ID of the user on the third-party system, which is assigned by the partner. xAccountId = resource2.Body('xAccountId') # Platform ID assigned by Huawei to a partner. xAccountType = resource2.Body('xAccountType') password = resource2.Body('password') # Two-letter ID representing the country/region of the customer. domainArea = resource2.Body('domainArea') # Indicates whether to disable the marketing message sending function. isCloseMarketMs = resource2.Body('isCloseMarketMs') # response domainId = resource2.Body('domainId') # Account name. domainName = resource2.Body('domainName') # Status code. error_code = resource2.Body('error_code') # Error description. error_msg = resource2.Body('error_msg')
class SendVerificationcode(resource2.Resource): base_path = "%(domain_id)s/partner/common-mgr/verificationcode" service = bss_service.BssService() allow_create = True # User domain ID domain_id = resource2.URI('domain_id') # request receiverType = resource2.Body('receiverType', type=int) timeout = resource2.Body('timeout', type=int) # Email address. email = resource2.Body('email') mobilePhone = resource2.Body('mobilePhone') countryCode = resource2.Body('countryCode') lang = resource2.Body('lang') scene = resource2.Body('scene') # Customer ID. customerId = resource2.Body('customerId') def create(self, session, prepend_key=True): endpoint_override = self.service.get_endpoint_override() request = self._prepare_request(requires_id=False, prepend_key=prepend_key) response = session.post(request.uri, endpoint_filter=self.service, endpoint_override=endpoint_override, json=request.body, headers=request.headers) if (response.status_code == 204): return self self._translate_response(response) return self
class QueryRealnameAuth(resource2.Resource): base_path = "%(domain_id)s/partner/customer-mgr/realname-auth/result" service = bss_service.BssService() allow_get = True # User domain ID domain_id = resource2.URI('domain_id') # request # Customer ID. customerId = resource2.Body('customerId') reviewResult = resource2.Body('reviewResult') opinion = resource2.Body('opinion', type=list) # Status code. error_code = resource2.Body('error_code') # Error description. error_msg = resource2.Body('error_msg') def get(self, session, requires_id=False): request = self._prepare_request(requires_id=False) endpoint_override = self.service.get_endpoint_override() service = self.get_service_filter(self, session) query_dict = {'customerId': self.customerId} query_str = urlencode(query_dict, doseq=True) url = request.uri + '?' + query_str response = session.get(url, endpoint_filter=self.service, microversion=service.microversion, endpoint_override=endpoint_override) self._translate_response(response) return self
class IndividualRealnameAuth(resource2.Resource): base_path = "%(domain_id)s/partner/customer-mgr/realname-auth/individual" service = bss_service.BssService() allow_create = True # User domain ID domain_id = resource2.URI('domain_id') # request # Customer ID. customerId = resource2.Body('customerId') # Authentication method. identifyType = resource2.Body('identifyType') # Certificate type. verifiedType = resource2.Body('verifiedType') # Attachment URL for individual certificate authentication. The URL must be entered in sequence. verifiedFileURL = resource2.Body('verifiedFileURL', type=list) # Real-name authentication name. name = resource2.Body('name') # Enterprise certificate number. verifiedNumber = resource2.Body('verifiedNumber') # Change type. changeType = resource2.Body('changeType') # Platform ID assigned by Huawei to a partner. xaccountType = resource2.Body('xaccountType') bankCardInfo = resource2.Body('bankCardInfo') # response # Whether to transfer to manual review. isReview = resource2.Body('isReview') # Error list. errorItems = resource2.Body('errorItems', type=list) # Status code. error_code = resource2.Body('error_code') # Error description. error_msg = resource2.Body('error_msg')
class CancelOrder(resource2.Resource): base_path = "%(domain_id)s/customer/order-mgr/orders/actions" service = bss_service.BssService() allow_create = True put_create = True # User domain ID domain_id = resource2.URI('domain_id') action_id = resource2.URI('action_id') # request # Order ID. orderId = resource2.Body('orderId') # Status code. error_code = resource2.Body('error_code') # Error description. error_msg = resource2.Body('error_msg') def create(self, session, prepend_key=True,**parms): endpoint_override = self.service.get_endpoint_override() service = self.get_service_filter(self, session) request = self._prepare_request(requires_id=False, prepend_key=prepend_key) response = session.put(request.uri, endpoint_filter=self.service, endpoint_override=endpoint_override, json=request.body, headers=request.headers, microversion=service.microversion,params={"action_id":self.action_id}) self._translate_response(response) return self
class QueryBillResRecords(resource2.Resource): base_path = "%(domain_id)s/customer/account-mgr/bill/res-records" service = bss_service.BssService() allow_get = True # User domain ID domain_id = resource2.URI('domain_id') # request # Expenditure month. cycle = resource2.Body('cycle') # Cloud service type code. cloudServiceTypeCode = resource2.Body('cloudServiceTypeCode') # Resource type code. For example, the VM resource type code of ECS is hws.resource.type.vm. resourceTypeCode = resource2.Body('resourceTypeCode') # Cloud service region code, for example, cn-north-1. regionCode = resource2.Body('regionCode') # Resource instance ID. resInstanceId = resource2.Body('resInstanceId') # Billing mode. payMethod = resource2.Body('payMethod') # Enterprise project ID. enterpriseProjectId = resource2.Body('enterpriseProjectId') offset = resource2.Body('offset') limit = resource2.Body('limit') # response # currency currency = resource2.Body('currency') totalCount = resource2.Body('totalCount') monthlyRecords = resource2.Body('monthlyRecords', type=list) # Status code. error_code = resource2.Body('error_code') # Error description. error_msg = resource2.Body('error_msg') def get(self, session, requires_id=False): request = self._prepare_request(requires_id=False) endpoint_override = self.service.get_endpoint_override() service = self.get_service_filter(self, session) xstr = lambda s: '' if s is None else str(s) query_dict = { 'cycle': xstr(self.cycle), 'cloudServiceTypeCode': xstr(self.cloudServiceTypeCode), 'resourceTypeCode': xstr(self.resourceTypeCode), 'regionCode': xstr(self.regionCode), 'resInstanceId': xstr(self.resInstanceId), 'payMethod': xstr(self.payMethod), 'enterpriseProjectId': xstr(self.enterpriseProjectId), 'offset': xstr(self.offset), 'limit': xstr(self.limit) } query_str = urlencode(query_dict, doseq=True) url = request.uri + "?" + query_str response = session.get(url, endpoint_filter=self.service, microversion=service.microversion, endpoint_override=endpoint_override) self._translate_response(response) return self
class QueryOrderList(resource2.Resource): base_path = "%(domain_id)s/common/order-mgr/orders/detail" service = bss_service.BssService() allow_get = True allow_list = True _query_mapping = resource2.QueryParameters( 'order_id', 'customer_id', 'create_time_begin', 'create_time_end', 'status', 'order_type', 'service_type', 'page_size', 'page_index', 'sort', 'payment_time_begin', 'payment_time_end') # request # User domain ID domain_id = resource2.URI('domain_id') order_id = resource2.Body('order_id') customer_id = resource2.Body('customer_id') create_time_begin = resource2.Body('create_time_begin') create_time_end = resource2.Body('create_time_end') service_type = resource2.Body('service_type') # 0: The account name, mobile number, or email address does not exist. # 1: The account name, mobile number, or email address already exists. status = resource2.Body('status') order_type = resource2.Body('order_type') page_size = resource2.Body('page_size') page_index = resource2.Body('page_index') sort = resource2.Body('sort') payment_time_begin = resource2.Body('payment_time_begin') payment_time_end = resource2.Body('payment_time_end') # response # Status code. error_code = resource2.Body('error_code') # Error description. error_msg = resource2.Body('error_msg') data = resource2.Body('data')
class QueryCustomerList(resource2.Resource): base_path = "%(domain_id)s/partner/customer-mgr/query" service = bss_service.BssService() allow_create = True # User domain ID domain_id = resource2.URI('domain_id') # request # Account name. domainName = resource2.Body('domainName') # Real-name authentication name. name = resource2.Body('name') # Page to be queried. offset = resource2.Body('offset', type=int) # Number of records on each page. limit = resource2.Body('limit', type=int) # Tag. Fuzzy search is supported. label = resource2.Body('label') # Association type. cooperationType = resource2.Body('cooperationType') # Start time of the association time range (UTC time).The value is in "yyyy-MM-dd 'T' HH:mm:ss 'Z'" format, such as 2019-05-06T08:05:01Z. cooperationTimeStart = resource2.Body('cooperationTimeStart') # End time of the association time range (UTC time). The value is in "yyyy-MM-dd 'T' HH:mm:ss 'Z'" format, such as 2019-05-06T08:05:01Z. cooperationTimeEnd = resource2.Body('cooperationTimeEnd') # response # Total number of records. count = resource2.Body('count') # Customer list. customerInfoList = resource2.Body('customerInfoList', type=list) # Status code. error_code = resource2.Body('error_code') # Error description. error_msg = resource2.Body('error_msg')
class PayPeriodOrder(resource2.Resource): base_path = "%(domain_id)s/customer/order-mgr/order/pay" service = bss_service.BssService() allow_create = True # User domain ID domain_id = resource2.URI('domain_id') # request # Order ID. orderId = resource2.Body('orderId') # Payment account type. payAccountType = resource2.Body('payAccountType', type=int) # partner account ID bpId = resource2.Body('bpId') # This parameter is reserved. couponIds = resource2.Body('couponIds', type=list) # response # Status code. error_code = resource2.Body('error_code') # Error description. error_msg = resource2.Body('error_msg') # Payment sequence number corresponding to the order. tradeNo = resource2.Body('tradeNo') # Information about the resources whose quota or capacity is insufficient. quotaInfos = resource2.Body('quotaInfos', type=list) # Information about the enterprise project whose fund is insufficient. enterpriseProjectAuthResult = resource2.Body('enterpriseProjectAuthResult', type=list)
class QueryOrderDetail(resource2.Resource): base_path = "%(domain_id)s/common/order-mgr/orders/%(order_id)s" service = bss_service.BssService() allow_get = True allow_list = True _query_mapping = resource2.QueryParameters('offset', 'limit') # request # User domain ID domain_id = resource2.URI('domain_id') order_id = resource2.URI('order_id') offset = resource2.Body('offset') limit = resource2.Body('limit') # response # Status code. error_code = resource2.Body('error_code') # Error description. error_msg = resource2.Body('error_msg') # Total number of records. count = resource2.Body('count') # Order details. orderInfo = resource2.Body('orderInfo') # ID of the primary order item mapping the order item. orderlineItems = resource2.Body('orderlineItems')
class OrderRenewByResourceid(resource2.Resource): base_path = "%(domain_id)s/common/order-mgr/resources/renew" service = bss_service.BssService() allow_create = True domain_id = resource2.URI('domain_id') # request # Resource IDs. resource_ids = resource2.Body('resource_ids', type=list) # Period type. period_type = resource2.Body('period_type', type=int) # Number of periods. period_num = resource2.Body('period_num', type=int) # Expiration policy. expire_mode = resource2.Body('expire_mode', type=int) # Whether enable automatic payment. isAutoPay = resource2.Body('isAutoPay', type=int) # response # Status code. error_code = resource2.Body('error_code') # Error description. error_msg = resource2.Body('error_msg') # List of order IDs generated when resource subscription is renewed. order_ids = resource2.Body('order_ids', type=list)
class QueryOrderResource(resource2.Resource): base_path = "%(domain_id)s/common/order-mgr/orders-resource/%(order_id)s" service = bss_service.BssService() allow_get = True # request # User domain ID domain_id = resource2.URI('domain_id') order_id = resource2.URI('order_id') offset = resource2.Body('offset') limit = resource2.Body('limit') # response # Status code. error_code = resource2.Body('error_code') # Error description. error_msg = resource2.Body('error_msg') # Number of records that match the query conditions. totalSize = resource2.Body('totalSize') resources = resource2.Body('resources') def get(self, session, requires_id=False): request = self._prepare_request(requires_id=False) endpoint_override = self.service.get_endpoint_override() service = self.get_service_filter(self, session) xstr = lambda s: '' if s is None else str(s) query_dict = {'offset': xstr(self.offset), 'limit': xstr(self.limit)} query_str = urlencode(query_dict, doseq=True) url = request.uri + "?" + query_str response = session.get(url, endpoint_filter=self.service, microversion=service.microversion, endpoint_override=endpoint_override) self._translate_response(response) return self
class QueryRefundOrder(resource2.Resource): base_path = "%(domain_id)s/common/order-mgr/orders/refund-order" service = bss_service.BssService() allow_get = True # request # User domain ID domain_id = resource2.URI('domain_id') order_id = resource2.Body('order_id') # Status code. error_code = resource2.Body('error_code') # Error description. error_msg = resource2.Body('error_msg') resource_info_list = resource2.Body('resource_info_list', type=list) total_count = resource2.Body('total_count', type=int) def get(self, session, requires_id=False): request = self._prepare_request(requires_id=False) endpoint_override = self.service.get_endpoint_override() service = self.get_service_filter(self, session) xstr = lambda s: '' if s is None else str(s) query_dict = {'order_id': xstr(self.order_id)} query_str = urlencode(query_dict, doseq=True) url = request.uri + "?" + query_str response = session.get(url, endpoint_filter=self.service, microversion=service.microversion, endpoint_override=endpoint_override) self._translate_response(response) return self
class QueryRating(resource2.Resource): base_path = "%(domain_id)s/customer/product-mgr/query-rating" service = bss_service.BssService() allow_create = True # User domain ID domain_id = resource2.URI('domain_id') # request cloudServiceType = resource2.Body('cloudServiceType') resourceType = resource2.Body('resourceType') resourceSpecCode = resource2.Body('resourceSpecCode') resourceSize = resource2.Body('resourceSize', type=int) resouceSizeMeasureId = resource2.Body('resouceSizeMeasureId', type=int) usageFactor = resource2.Body('usageFactor') usageValue = resource2.Body('usageValue') usageMeasureId = resource2.Body('usageMeasureId', type=int) extendParams = resource2.Body('extendParams') tenantId = resource2.Body('tenantId') regionId = resource2.Body('regionId') avaliableZoneId = resource2.Body('avaliableZoneId') chargingMode = resource2.Body('chargingMode', type=int) periodType = resource2.Body('periodType', type=int) periodNum = resource2.Body('periodNum', type=int) periodEndDate = resource2.Body('periodEndDate') relativeResourceId = resource2.Body('relativeResourceId') relativeResourcePeriodType = resource2.Body('relativeResourcePeriodType', type=int) subscriptionNum = resource2.Body('subscriptionNum', type=int) inquiryTime = resource2.Body('inquiryTime') productInfos = resource2.Body('productInfos', type=list) # response id = resource2.Body('id') productId = resource2.Body('productId') amount = resource2.Body('amount') originalAmount = resource2.Body('originalAmount') discountAmount = resource2.Body('discountAmount') # Unit measureId = resource2.Body('measureId') extendParams = resource2.Body('extendParams') amount = resource2.Body('amount') discountAmount = resource2.Body('discountAmount') originalAmount = resource2.Body('originalAmount') # Unit measureId = resource2.Body('measureId') # currency currency = resource2.Body('currency') productRatingResult = resource2.Body('productRatingResult') # Status code. error_code = resource2.Body('error_code') # Error description. error_msg = resource2.Body('error_msg') extendParams = resource2.Body('extendParams') ratingResult = resource2.Body('ratingResult')
class QueryOrderList(resource2.Resource): base_path = "%(domain_id)s/common/order-mgr/orders/detail" service = bss_service.BssService() allow_get = True # request # User domain ID domain_id = resource2.URI('domain_id') order_id = resource2.Body('order_id') customer_id = resource2.Body('customer_id') create_time_begin = resource2.Body('create_time_begin') create_time_end = resource2.Body('create_time_end') service_type = resource2.Body('service_type') # 0: The account name, mobile number, or email address does not exist. # 1: The account name, mobile number, or email address already exists. status = resource2.Body('status') order_type = resource2.Body('order_type') page_size = resource2.Body('page_size') page_index = resource2.Body('page_index') sort = resource2.Body('sort') payment_time_begin = resource2.Body('payment_time_begin') payment_time_end = resource2.Body('payment_time_end') # response # Status code. error_code = resource2.Body('error_code') # Error description. error_msg = resource2.Body('error_msg') data = resource2.Body('data') def get(self, session, requires_id=False): request = self._prepare_request(requires_id=False) endpoint_override = self.service.get_endpoint_override() service = self.get_service_filter(self, session) xstr = lambda s: '' if s is None else str(s) query_dict = { 'order_id': xstr(self.order_id), 'customer_id': xstr(self.customer_id), 'create_time_begin': xstr(self.create_time_begin), 'create_time_end': xstr(self.create_time_end), 'status': xstr(self.status), 'order_type': xstr(self.order_type), 'service_type': xstr(self.service_type), 'page_size': xstr(self.page_size), 'page_index': xstr(self.page_index), 'sort': xstr(self.sort), 'payment_time_begin': xstr(self.payment_time_begin), 'payment_time_end': xstr(self.payment_time_end) } query_str = urlencode(query_dict, doseq=True) url = request.uri + "?" + query_str response = session.get(url, endpoint_filter=self.service, microversion=service.microversion, endpoint_override=endpoint_override) self._translate_response(response) return self
class EnterpriseRealnameAuthChange(resource2.Resource): base_path = "%(domain_id)s/partner/customer-mgr/realname-auth/enterprise" service = bss_service.BssService() allow_create = True put_create = True # User domain ID domain_id = resource2.URI('domain_id') # request # Customer ID. customerId = resource2.Body('customerId') # Authentication method. identifyType = resource2.Body('identifyType') # Enterprise certificate type. certificateType = resource2.Body('certificateType') # URL of the certificate attachment file used for enterprise certificate authentication. verifiedFileURL = resource2.Body('verifiedFileURL') # Organization name. corpName = resource2.Body('corpName') # Enterprise certificate number. verifiedNumber = resource2.Body('verifiedNumber') # Registration country entered for real-name authentication. regCountry = resource2.Body('regCountry') # Enterprise registration address for real-name authentication. regAddress = resource2.Body('regAddress') # Change type. changeType = resource2.Body('changeType') # Platform ID assigned by Huawei to a partner. xaccountType = resource2.Body('xaccountType') # Enterprise person information. enterprisePerson = resource2.Body('enterprisePerson') # Status code. error_code = resource2.Body('error_code') # Error description. error_msg = resource2.Body('error_msg') # Whether to transfer to manual review. isReview = resource2.Body('isReview') # Error list. failCheckItems = resource2.Body('failCheckItems', type=list) def create(self, session, prepend_key=True): endpoint_override = self.service.get_endpoint_override() service = self.get_service_filter(self, session) request = self._prepare_request(requires_id=False, prepend_key=prepend_key) response = session.put(request.uri, endpoint_filter=self.service, endpoint_override=endpoint_override, json=request.body, headers=request.headers, microversion=service.microversion) self._translate_response(response) return self
class Version(resource.Resource): resource_key = 'version' resources_key = 'versions' base_path = '/' service = bss_service.BssService( version=bss_service.BssService.UNVERSIONED ) # capabilities allow_list = True # Properties links = resource.Body('links') status = resource.Body('status')
class QueryBillMonthlySum(resource2.Resource): base_path = "%(domain_id)s/customer/account-mgr/bill/monthly-sum" service = bss_service.BssService() allow_list = True allow_get = True _query_mapping = resource2.QueryParameters( 'cycle', 'cloud_service_type_code', 'type', 'enterpriseProjectId') # User domain ID domain_id = resource2.URI('domain_id') # request # Expenditure month. cycle = resource2.Body('cycle') # Cloud service type code. For example, the cloud service type code of ECS is hws.service.type.ec2. cloud_service_type_code = resource2.Body('cloud_service_type_code') account_type = resource2.Body('type') # Enterprise project ID. enterpriseProjectId = resource2.Body('enterpriseProjectId') # response # Currency unit. currency = resource2.Body('currency') # Number of result sets. total_count = resource2.Body('total_count') # Record information. bill_sums = resource2.Body('bill_sums', type=list) # Status code. error_code = resource2.Body('error_code') # Error description. error_msg = resource2.Body('error_msg') # Total amount (tax included). total_amount = resource2.Body('total_amount') # Total debt. debt_amount = resource2.Body('debt_amount') # Cash coupon amount. coupon_amount = resource2.Body('coupon_amount') # Flexi-purchase coupon amount (reserved). cashcoupon_amount = resource2.Body('cashcoupon_amount') # Stored-value card amount (reserved). storedcard_amount = resource2.Body('storedcard_amount') # Balance in the cash account. debit_amount = resource2.Body('debit_amount') # Balance in the credit account. credit_amount = resource2.Body('credit_amount') # Unit measure_id = resource2.Body('measure_id')
class QueryBillMonthlySum(resource2.Resource): base_path = "%(domain_id)s/customer/account-mgr/bill/monthly-sum" service = bss_service.BssService() allow_get = True # User domain ID domain_id = resource2.URI('domain_id') # request # Expenditure month. cycle = resource2.Body('cycle') # Cloud service type code. For example, the cloud service type code of ECS is hws.service.type.ec2. cloud_service_type_code = resource2.Body('cloud_service_type_code') account_type = resource2.Body('type') # Enterprise project ID. enterpriseProjectId = resource2.Body('enterpriseProjectId') # response # Currency unit. currency = resource2.Body('currency') # Number of result sets. total_count = resource2.Body('total_count') # Record information. bill_sums = resource2.Body('bill_sums', type=list) # Status code. error_code = resource2.Body('error_code') # Error description. error_msg = resource2.Body('error_msg') def get(self, session, requires_id=False): request = self._prepare_request(requires_id=False) endpoint_override = self.service.get_endpoint_override() service = self.get_service_filter(self, session) xstr = lambda s: '' if s is None else str(s) query_dict = { 'cycle': xstr(self.cycle), 'cloud_service_type_code': xstr(self.cloud_service_type_code), 'type': xstr(self.account_type), 'enterpriseProjectId': xstr(self.enterpriseProjectId) } query_str = urlencode(query_dict, doseq=True) url = request.uri + "?" + query_str response = session.get(url, endpoint_filter=self.service, microversion=service.microversion, endpoint_override=endpoint_override) self._translate_response(response) return self
class QueryCustomerPeriodResourcesList(resource2.Resource): base_path = "%(domain_id)s/common/order-mgr/resources/detail" service = bss_service.BssService() allow_get = True # User domain ID domain_id = resource2.URI('domain_id') # request # Resource IDs resource_ids = resource2.Body('resource_ids') order_id = resource2.Body('order_id') only_main_resource = resource2.Body('only_main_resource', type=int) status_list = resource2.Body('status_list') page_no = resource2.Body('page_no', type=int) page_size = resource2.Body('page_size', type=int) # response # Status code. error_code = resource2.Body('error_code') # Error description. error_msg = resource2.Body('error_msg') data = resource2.Body('data', type=list) total_count = resource2.Body('total_count', type=int) def get(self, session, requires_id=False): request = self._prepare_request(requires_id=False) endpoint_override = self.service.get_endpoint_override() service = self.get_service_filter(self, session) xstr = lambda s: '' if s is None else str(s) query_dict = { 'resource_ids': xstr(self.resource_ids), 'order_id': xstr(self.order_id), 'only_main_resource': xstr(self.only_main_resource), 'status_list': xstr(self.status_list), 'page_no': xstr(self.page_no), 'page_size': xstr(self.page_size) } query_str = urlencode(query_dict, doseq=True) url = request.uri + "?" + query_str response = session.get(url, endpoint_filter=self.service, microversion=service.microversion, endpoint_override=endpoint_override) self._translate_response(response) return self
class QueryRealnameAuth(resource2.Resource): base_path = "%(domain_id)s/partner/customer-mgr/realname-auth/result" service = bss_service.BssService() allow_get = True allow_list = True _query_mapping = resource2.QueryParameters('customerId') # User domain ID domain_id = resource2.URI('domain_id') # request # Customer ID. customerId = resource2.Body('customerId') reviewResult = resource2.Body('reviewResult') opinion = resource2.Body('opinion', type=list) # Status code. error_code = resource2.Body('error_code') # Error description. error_msg = resource2.Body('error_msg')
class QueryRefundOrder(resource2.Resource): base_path = "%(domain_id)s/common/order-mgr/orders/refund-order" service = bss_service.BssService() allow_get = True allow_list = True _query_mapping = resource2.QueryParameters( 'order_id') # request # User domain ID domain_id = resource2.URI('domain_id') order_id = resource2.Body('order_id') # Status code. error_code = resource2.Body('error_code') # Error description. error_msg = resource2.Body('error_msg') resource_info_list = resource2.Body('resource_info_list', type=list) total_count = resource2.Body('total_count', type=int)
class QueryBillResRecords(resource2.Resource): base_path = "%(domain_id)s/customer/account-mgr/bill/res-records" service = bss_service.BssService() allow_get = True allow_list = True _query_mapping = resource2.QueryParameters( 'cycle', 'cloudServiceTypeCode', 'resourceTypeCode', 'regionCode', 'resInstanceId','payMethod','enterpriseProjectId','offset','limit') # User domain ID domain_id = resource2.URI('domain_id') # request # Expenditure month. cycle = resource2.Body('cycle') # Cloud service type code. cloudServiceTypeCode = resource2.Body('cloudServiceTypeCode') # Resource type code. For example, the VM resource type code of ECS is hws.resource.type.vm. resourceTypeCode = resource2.Body('resourceTypeCode') # Cloud service region code, for example, cn-north-1. regionCode = resource2.Body('regionCode') # Resource instance ID. resInstanceId = resource2.Body('resInstanceId') # Billing mode. payMethod = resource2.Body('payMethod') # Enterprise project ID. enterpriseProjectId = resource2.Body('enterpriseProjectId') offset = resource2.Body('offset') limit = resource2.Body('limit') # response # currency currency = resource2.Body('currency') totalCount = resource2.Body('totalCount') monthlyRecords = resource2.Body('monthlyRecords', type=list) # Status code. error_code = resource2.Body('error_code') # Error description. error_msg = resource2.Body('error_msg') # Official website price official_amount = resource2.Body('officialAmount')
class UnsubscribePeriodOrder(resource2.Resource): base_path = "%(domain_id)s/customer/order-mgr/orders/%(order_id)s" service = bss_service.BssService() allow_delete = True # User domain ID domain_id = resource2.URI('domain_id') order_id = resource2.URI('order_id') # request unsub_type = resource2.Body('unsub_type') unsubscribe_reason_type = resource2.Body('unsubscribe_reason_type') unsubscribe_reason = resource2.Body('unsubscribe_reason') # Status code. error_code = resource2.Body('error_code') # Error description. error_msg = resource2.Body('error_msg') # New order ID generated for the unsubscription. unsub_order_ids = resource2.Body('unsub_order_ids') def delete(self, session, params=None, has_body=True): endpoint_override = self.service.get_endpoint_override() service = self.get_service_filter(self, session) request = self._prepare_request(requires_id=False, prepend_key=True) xstr = lambda s: '' if s is None else str(s) query_dict = { 'unsub_type': self.unsub_type, 'unsubscribe_reason_type': xstr(self.unsubscribe_reason_type), "unsubscribe_reason": xstr(self.unsubscribe_reason) } query_str = urlencode(query_dict, doseq=True) url = request.uri + '?' + query_str response = session.delete(url, endpoint_filter=self.service, microversion=service.microversion, endpoint_override=endpoint_override, headers=request.headers, params=params) self._translate_response(response) return self
class QueryResFeeRecords(resource2.Resource): base_path = "%(domain_id)s/customer/account-mgr/bill/res-fee-records" service = bss_service.BssService() allow_get = True allow_list = True _query_mapping = resource2.QueryParameters( 'startTime', 'endTime', 'cloudServiceTypeCode', 'regionCode', 'orderId','payMethod','resourceId','enterpriseProjectId','offset','limit') # User domain ID domain_id = resource2.URI('domain_id') # request startTime = resource2.Body('startTime') endTime = resource2.Body('endTime') # Cloud service type code. cloudServiceTypeCode = resource2.Body('cloudServiceTypeCode') # Cloud service region code, for example, cn-north-1. regionCode = resource2.Body('regionCode') # Order ID. orderId = resource2.Body('orderId') # Billing mode. payMethod = resource2.Body('payMethod') # Queries resource IDs in batches. resourceId = resource2.Body('resourceId') # Enterprise project ID. enterpriseProjectId = resource2.Body('enterpriseProjectId') offset = resource2.Body('offset') limit = resource2.Body('limit') # response # currency currency = resource2.Body('currency') totalCount = resource2.Body('totalCount') # Resource usage record. feeRecords = resource2.Body('feeRecords', type=list) # Status code. error_code = resource2.Body('error_code') # Error description. error_msg = resource2.Body('error_msg') # Official website price official_amount = resource2.Body('officialAmount')
class QueryCustomerResource(resource2.Resource): base_path = "%(domain_id)s/partner/customer-mgr/customer-resource/query-resources" service = bss_service.BssService() allow_create = True domain_id = resource2.URI('domain_id') # Customer resource ID. customerResourceId = resource2.Body('customerResourceId') # Customer ID. customerId = resource2.Body('customerId') # Cloud service region code, for example, cn-north-1. regionCode = resource2.Body('regionCode') # Cloud service type code. cloudServiceTypeCode = resource2.Body('cloudServiceTypeCode') # Resource type code. For example, the VM resource type code of ECS is hws.resource.type.vm. resourceTypeCode = resource2.Body('resourceTypeCode') # Queries resource IDs in batches. resourceIds = resource2.Body('resourceIds') # Resource name. resourceName = resource2.Body('resourceName') # Start time of the validity period. startTimeBegin = resource2.Body('startTimeBegin') # End time of the validity period. # End time of the validity period. startTimeEnd = resource2.Body('startTimeEnd') # Current page. pageNo = resource2.Body('pageNo') # Number of records displayed on each page. pageSize = resource2.Body('pageSize') # Status code. error_code = resource2.Body('error_code') # Error description. error_msg = resource2.Body('error_msg') # Customer resources. customerResources = resource2.Body('customerResources') # Total number of query records. totalCount = resource2.Body('totalCount')
class AutoRenew(resource2.Resource): base_path = "%(domain_id)s/common/order-mgr/resources/%(resource_id)s/actions?action_id=%(action_id)s" service = bss_service.BssService() # capabilities allow_update = True allow_delete = True # User domain ID domain_id = resource2.URI('domain_id') # traced resource id resource_id = resource2.URI('resource_id') action_id = resource2.URI('action_id') # Status code. error_code = resource2.Body('error_code') # Error description. error_msg = resource2.Body('error_msg') def create(self, session, prepend_key=True): endpoint_override = self.service.get_endpoint_override() request = self._prepare_request(requires_id=False, prepend_key=prepend_key) response = session.post(request.uri, endpoint_filter=self.service, endpoint_override=endpoint_override, json=request.body, headers=request.headers) self._translate_response(response) return self def delete(self, session, params=None, has_body=False): endpoint_override = self.service.get_endpoint_override() request = self._prepare_request(requires_id=False) response = session.delete(request.uri, endpoint_filter=self.service, endpoint_override=endpoint_override, headers=request.headers) self._translate_response(response) return self
class EnterpriseRealnameAuth(resource2.Resource): base_path = "%(domain_id)s/partner/customer-mgr/realname-auth/enterprise" service = bss_service.BssService() allow_create = True # User domain ID domain_id = resource2.URI('domain_id') # request # Customer ID. customerId = resource2.Body('customerId') # Authentication method. identifyType = resource2.Body('identifyType') # Enterprise certificate type. certificateType = resource2.Body('certificateType') # Attachment URL for individual certificate authentication. The URL must be entered in sequence. verifiedFileURL = resource2.Body('verifiedFileURL', type=list) # Organization name. corpName = resource2.Body('corpName') # Enterprise certificate number. verifiedNumber = resource2.Body('verifiedNumber') # Registration country entered for real-name authentication. regCountry = resource2.Body('regCountry') # Enterprise registration address for real-name authentication. regAddress = resource2.Body('regAddress') # Platform ID assigned by Huawei to a partner. xaccountType = resource2.Body('xaccountType') # Enterprise person information. enterprisePerson = resource2.Body('enterprisePerson') # response # Whether to transfer to manual review. isReview = resource2.Body('isReview') # Error list. errorItems = resource2.Body('errorItems', type=list) # Status code. error_code = resource2.Body('error_code') # Error description. error_msg = resource2.Body('error_msg')
class QueryOrderDetail(resource2.Resource): base_path = "%(domain_id)s/common/order-mgr/orders/%(order_id)s" service = bss_service.BssService() allow_get = True # request # User domain ID domain_id = resource2.URI('domain_id') order_id = resource2.URI('order_id') offset = resource2.Body('offset') limit = resource2.Body('limit') # response # Status code. error_code = resource2.Body('error_code') # Error description. error_msg = resource2.Body('error_msg') # Total number of records. count = resource2.Body('count') # Order details. orderInfo = resource2.Body('orderInfo') # ID of the primary order item mapping the order item. orderlineItems = resource2.Body('orderlineItems') def get(self, session, requires_id=False): request = self._prepare_request(requires_id=False) endpoint_override = self.service.get_endpoint_override() service = self.get_service_filter(self, session) xstr = lambda s: '' if s is None else str(s) query_dict = {'offset': xstr(self.offset), 'limit': xstr(self.limit)} query_str = urlencode(query_dict, doseq=True) url = request.uri + "?" + query_str response = session.get(url, endpoint_filter=self.service, microversion=service.microversion, endpoint_override=endpoint_override) self._translate_response(response) return self
class QueryOrderResource(resource2.Resource): base_path = "%(domain_id)s/common/order-mgr/orders-resource/%(order_id)s" service = bss_service.BssService() allow_get = True allow_list = True _query_mapping = resource2.QueryParameters( 'offset', 'limit') # request # User domain ID domain_id = resource2.URI('domain_id') order_id = resource2.URI('order_id') offset = resource2.Body('offset') limit = resource2.Body('limit') # response # Status code. error_code = resource2.Body('error_code') # Error description. error_msg = resource2.Body('error_msg') # Number of records that match the query conditions. totalSize = resource2.Body('totalSize') resources = resource2.Body('resources')