Querying the SecMaster Offerings Available at the Current Site
Function
This API is used to query the SecMaster offerings available at the current site.
Calling Method
For details, see Calling APIs.
URI
GET /v1/{project_id}/subscriptions/products
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Tenant project ID. |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
User token. You can obtain it by calling the IAM API for obtaining a user token. The token is the value of X-Subject-Token in the response header. |
|
X-Language |
Yes |
String |
Current environment language. zh-cn: simplified Chinese; en-us: English. |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
basic |
basic object |
Product code object for the basic edition. |
|
standard |
standard object |
Product code object for the standard edition. |
|
professional |
professional object |
Product code object for the professional edition. |
|
large_screen |
large_screen object |
Product code object for the large screen module. |
|
log_collection |
log_collection object |
Product code object for log collection. |
|
log_retention |
log_retention object |
Product code object for log retention. |
|
log_analysis |
log_analysis object |
Product code object for log analysis. |
|
soar |
soar object |
Product code object for the security orchestration module. |
|
Parameter |
Type |
Description |
|---|---|---|
|
cloud_service_type |
String |
Main service type of the cloud service product. The default value is xxx.service.type.sa for SecMaster. |
|
resource_type |
String |
Resource type code. |
|
resource_spec_code |
String |
Resource specification code. |
|
resource_size_measure_id |
Integer |
Resource capacity measurement ID. |
|
usage_factor |
String |
Usage factor. This parameter is mandatory for pay-per-use billing. The value is the same as the usage factor in SDRs. The mappings between cloud services and usage factors are as follows: Currently, SecMaster supports the following options: duration: time. This is mainly used for the basic, standard, and professional editions. count: times. This is mainly used for security orchestration. flow: traffic. This is mainly used for log analysis and collection. retention: retention. This is mainly used for log retention. |
|
usage_measure_id |
Integer |
Usage measurement unit. This parameter is mandatory for a pay-per-use inquiry. For example, the resources are billed by the hour, the usage value is 1, and the usage measurement unit is hour. The options are: 4: hour 10: GB. Bandwidth usage is measured in GB based on traffic. 11: MB. Bandwidth usage is measured in MB based on traffic. 13: Byte. The bandwidth usage is measured by byte based on traffic. |
|
region_id |
String |
Code of the current region. The default value is null, indicating the current region. |
|
Parameter |
Type |
Description |
|---|---|---|
|
cloud_service_type |
String |
Main service type of the cloud service product. The default value is xxx.service.type.sa for SecMaster. |
|
resource_type |
String |
Resource type code. |
|
resource_spec_code |
String |
Resource specification code. |
|
resource_size_measure_id |
Integer |
Resource capacity measurement ID. |
|
usage_factor |
String |
Usage factor. This parameter is mandatory for pay-per-use billing. The value is the same as the usage factor in SDRs. The mappings between cloud services and usage factors are as follows: Currently, SecMaster supports the following options: duration: time. This is mainly for the basic, standard, and professional editions. count: times. This is mainly used for security orchestration. flow: traffic. This is mainly used for log analysis and collection. retention: retention. This is mainly used for log retention. |
|
usage_measure_id |
Integer |
Usage measurement unit. This parameter is mandatory for a pay-per-use inquiry. For example, the resources are billed by the hour, the usage value is 1, and the usage measurement unit is hour. The options are: 4: hour 10: GB. Bandwidth usage is measured in GB based on traffic. 11: MB. Bandwidth usage is measured in MB based on traffic. 13: Byte. The bandwidth usage is measured by byte based on traffic. |
|
region_id |
String |
Code of the current region. The default value is null, indicating the current region. |
|
Parameter |
Type |
Description |
|---|---|---|
|
cloud_service_type |
String |
Main service type of the cloud service product. The default value is xxx.service.type.sa for SecMaster. |
|
resource_type |
String |
Resource type code. |
|
resource_spec_code |
String |
Resource specification code. |
|
resource_size_measure_id |
Integer |
Resource capacity measurement ID. |
|
usage_factor |
String |
Usage factor. This parameter is mandatory for pay-per-use billing. The value is the same as the usage factor in SDRs. The mappings between cloud services and usage factors are as follows. Currently, SecMaster supports the following options: duration: time. This is mainly used for the basic, standard, and professional editions. count: times. This is mainly used for security orchestration. flow: traffic. This is mainly used for log analysis and collection. retention: retention. This is mainly used for log retention. |
|
usage_measure_id |
Integer |
Usage measurement unit. This parameter is mandatory for a pay-per-use inquiry. For example, the resources are billed by the hour, the usage value is 1, and the usage measurement unit is hour. The options are: 4: hour 10: GB. Bandwidth usage is measured in GB based on traffic. 11: MB. Bandwidth usage is measured in MB based on traffic. 13: Byte. The bandwidth usage is measured by byte based on traffic. |
|
region_id |
String |
Code of the current region. The default value is null, indicating the current region. |
|
Parameter |
Type |
Description |
|---|---|---|
|
cloud_service_type |
String |
Main service type of the cloud service product. The default value is xxx.service.type.sa for SecMaster. |
|
resource_type |
String |
Resource type code. |
|
resource_spec_code |
String |
Resource specification code. |
|
resource_size_measure_id |
Integer |
Resource capacity measurement ID. |
|
usage_factor |
String |
Usage factor. This parameter is mandatory for pay-per-use billing. The value is the same as the usage factor in SDRs. The mappings between cloud services and usage factors are as follows. Currently, SecMaster supports the following options: duration: time. This is mainly used for the basic, standard, and professional editions. count: times. This is mainly used for security orchestration. flow: traffic. This is mainly used for log analysis and collection. retention: retention. This is mainly used for log retention. |
|
usage_measure_id |
Integer |
Usage measurement unit. This parameter is mandatory for a pay-per-use inquiry. For example, the resources are billed by the hour, the usage value is 1, and the usage measurement unit is hour. The options are: 4: hour 10: GB. Bandwidth usage is measured in GB based on traffic. 11: MB. Bandwidth usage is measured in MB based on traffic. 13: Byte. The bandwidth usage is measured by byte based on traffic. |
|
region_id |
String |
Code of the current region. The default value is null, indicating the current region. |
|
Parameter |
Type |
Description |
|---|---|---|
|
cloud_service_type |
String |
Main service type of the cloud service product. The default value is xxx.service.type.sa for SecMaster. |
|
resource_type |
String |
Resource type code. |
|
resource_spec_code |
String |
Resource specification code. |
|
resource_size_measure_id |
Integer |
Resource capacity measurement ID. |
|
usage_factor |
String |
Usage factor. This parameter is mandatory for pay-per-use billing. The value is the same as the usage factor in SDRs. The mappings between cloud services and usage factors are as follows. Currently, SecMaster supports the following options: duration: time. This is mainly used for the basic, standard, and professional editions. count: times. This is mainly used for security orchestration. flow: traffic. This is mainly used for log analysis and collection. retention: retention. This is mainly used for log retention. |
|
usage_measure_id |
Integer |
Usage measurement unit. This parameter is mandatory for a pay-per-use inquiry. For example, the resources are billed by the hour, the usage value is 1, and the usage measurement unit is hour. The options are: 4: hour 10: GB. Bandwidth usage is measured in GB based on traffic. 11: MB. Bandwidth usage is measured in MB based on traffic. 13: Byte. The bandwidth usage is measured by byte based on traffic. |
|
region_id |
String |
Code of the current region. The default value is null, indicating the current region. |
|
Parameter |
Type |
Description |
|---|---|---|
|
cloud_service_type |
String |
Main service type of the cloud service product. The default value is xxx.service.type.sa for SecMaster. |
|
resource_type |
String |
Resource type code. |
|
resource_spec_code |
String |
Resource specification code. |
|
resource_size_measure_id |
Integer |
Resource capacity measurement ID. |
|
usage_factor |
String |
Usage factor. This parameter is mandatory for pay-per-use billing. The value is the same as the usage factor in SDRs. The mappings between cloud services and usage factors are as follows. Currently, SecMaster supports the following options: duration: time. This is mainly used for the basic, standard, and professional editions. count: times. This is mainly used for security orchestration. flow: traffic. This is mainly used for log analysis and collection. retention: retention. This is mainly used for log retention. |
|
usage_measure_id |
Integer |
Usage measurement unit. This parameter is mandatory for a pay-per-use inquiry. For example, the resources are billed by the hour, the usage value is 1, and the usage measurement unit is hour. The options are: 4: hour 10: GB. Bandwidth usage is measured in GB based on traffic. 11: MB. Bandwidth usage is measured in MB based on traffic. 13: Byte. The bandwidth usage is measured by byte based on traffic. |
|
region_id |
String |
Code of the current region. The default value is null, indicating the current region. |
|
Parameter |
Type |
Description |
|---|---|---|
|
cloud_service_type |
String |
Main service type of the cloud service product. The default value is xxx.service.type.sa for SecMaster. |
|
resource_type |
String |
Resource type code. |
|
resource_spec_code |
String |
Resource specification code. |
|
resource_size_measure_id |
Integer |
Resource capacity measurement ID. |
|
usage_factor |
String |
Usage factor. This parameter is mandatory for pay-per-use billing. The value is the same as the usage factor in SDRs. The mappings between cloud services and usage factors are as follows. Currently, SecMaster supports the following options: duration: time. This is mainly used for the basic, standard, and professional editions. count: times. This is mainly used for security orchestration. flow: traffic. This is mainly used for log analysis and collection. retention: retention. This is mainly used for log retention. |
|
usage_measure_id |
Integer |
Usage measurement unit. This parameter is mandatory for a pay-per-use inquiry. For example, the resources are billed by the hour, the usage value is 1, and the usage measurement unit is hour. The options are: 4: hour 10: GB. Bandwidth usage is measured in GB based on traffic. 11: MB. Bandwidth usage is measured in MB based on traffic. 13: Byte. The bandwidth usage is measured by byte based on traffic. |
|
region_id |
String |
Code of the current region. The default value is null, indicating the current region. |
|
Parameter |
Type |
Description |
|---|---|---|
|
cloud_service_type |
String |
Main service type of the cloud service product. The default value is xxx.service.type.sa for SecMaster. |
|
resource_type |
String |
Resource type code. |
|
resource_spec_code |
String |
Resource specification code. |
|
resource_size_measure_id |
Integer |
Resource capacity measurement ID. |
|
usage_factor |
String |
Usage factor. This parameter is mandatory for pay-per-use billing. The value is the same as the usage factor in SDRs. The mappings between cloud services and usage factors are as follows. Currently, SecMaster supports the following options: duration: time. This is mainly used for the basic, standard, and professional editions. count: times. This is mainly used for security orchestration. flow: traffic. This is mainly used for log analysis and collection. retention: retention. This is mainly used for log retention. |
|
usage_measure_id |
Integer |
Usage measurement unit. This parameter is mandatory for a pay-per-use inquiry. For example, the resources are billed by the hour, the usage value is 1, and the usage measurement unit is hour. The options are: 4: hour 10: GB. Bandwidth usage is measured in GB based on traffic. 11: MB. Bandwidth usage is measured in MB based on traffic. 13: Byte. The bandwidth usage is measured by byte based on traffic. |
|
region_id |
String |
Code of the current region. The default value is null, indicating the current region. |
Status code: 400
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Definition Error code. Range N/A |
|
error_msg |
String |
Definition Error description. Range N/A |
Status code: 403
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Definition Error code. Range N/A |
|
error_msg |
String |
Definition Error description. Range N/A |
Status code: 500
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Definition Error code. Range N/A |
|
error_msg |
String |
Definition Error description. Range N/A |
Example Requests
This API is used to query to available product list.
GET https://{endpoint}/v1/{projectId}/subscriptions/products
Example Responses
Status code: 200
List of the SecMaster offerings supported at the current site
{
"basic" : {
"cloud_service_type" : "xxx.service.type.sa",
"resource_type" : "xxx.resource.type.secmaster.typical",
"resource_spec_code" : "secmaster.basic",
"resource_size_measure_id" : 14,
"usage_factor" : "duration",
"usage_measure_id" : 4,
"region_id" : "demo-region"
},
"standard" : {
"cloud_service_type" : "xxx.service.type.sa",
"resource_type" : "xxx.resource.type.secmaster.typical",
"resource_spec_code" : "secmaster.standard",
"resource_size_measure_id" : 14,
"usage_factor" : "duration",
"usage_measure_id" : 4,
"region_id" : "demo-region"
},
"professional" : {
"cloud_service_type" : "xxx.service.type.sa",
"resource_type" : "xxx.resource.type.secmaster.typical",
"resource_spec_code" : "secmaster.professional",
"resource_size_measure_id" : 14,
"usage_factor" : "duration",
"usage_measure_id" : 4,
"region_id" : "demo-region"
},
"large_screen" : {
"cloud_service_type" : "xxx.service.type.sa",
"resource_type" : "xxx.resource.type.secmaster.cspm",
"resource_spec_code" : "cspm.largescreen",
"resource_size_measure_id" : 14,
"usage_factor" : "duration",
"usage_measure_id" : 4,
"region_id" : "demo-region"
},
"log_collection" : {
"cloud_service_type" : "xxx.service.type.sa",
"resource_type" : "xxx.resource.type.secmaster.siem",
"resource_spec_code" : "secmaster.basic",
"resource_size_measure_id" : 10,
"usage_factor" : "flow",
"usage_measure_id" : 10,
"region_id" : "demo-region"
},
"log_retention" : {
"cloud_service_type" : "xxx.service.type.sa",
"resource_type" : "xxx.resource.type.secmaster.siem",
"resource_spec_code" : "secmaster.basic",
"resource_size_measure_id" : 17,
"usage_factor" : "retention",
"usage_measure_id" : 17,
"region_id" : "demo-region"
},
"log_analysis" : {
"cloud_service_type" : "xxx.service.type.sa",
"resource_type" : "xxx.resource.type.secmaster.siem",
"resource_spec_code" : "secmaster.basic",
"resource_size_measure_id" : 10,
"usage_factor" : "flow",
"usage_measure_id" : 10,
"region_id" : "demo-region"
},
"soar" : {
"cloud_service_type" : "xxx.service.type.sa",
"resource_type" : "xxx.resource.type.secmaster.soar",
"resource_spec_code" : "soar.action",
"resource_size_measure_id" : 14,
"usage_factor" : "count",
"usage_measure_id" : 14,
"region_id" : "demo-region"
}
}
SDK Sample Code
The SDK sample code is as follows.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
package com.huaweicloud.sdk.test; import com.huaweicloud.sdk.core.auth.ICredential; import com.huaweicloud.sdk.core.auth.BasicCredentials; import com.huaweicloud.sdk.core.exception.ConnectionException; import com.huaweicloud.sdk.core.exception.RequestTimeoutException; import com.huaweicloud.sdk.core.exception.ServiceResponseException; import com.huaweicloud.sdk.secmaster.v1.region.SecMasterRegion; import com.huaweicloud.sdk.secmaster.v1.*; import com.huaweicloud.sdk.secmaster.v1.model.*; public class ListSubscriptionProductSolution { public static void main(String[] args) { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment String ak = System.getenv("CLOUD_SDK_AK"); String sk = System.getenv("CLOUD_SDK_SK"); String projectId = "{project_id}"; ICredential auth = new BasicCredentials() .withProjectId(projectId) .withAk(ak) .withSk(sk); SecMasterClient client = SecMasterClient.newBuilder() .withCredential(auth) .withRegion(SecMasterRegion.valueOf("<YOUR REGION>")) .build(); ListSubscriptionProductRequest request = new ListSubscriptionProductRequest(); try { ListSubscriptionProductResponse response = client.listSubscriptionProduct(request); System.out.println(response.toString()); } catch (ConnectionException e) { e.printStackTrace(); } catch (RequestTimeoutException e) { e.printStackTrace(); } catch (ServiceResponseException e) { e.printStackTrace(); System.out.println(e.getHttpStatusCode()); System.out.println(e.getRequestId()); System.out.println(e.getErrorCode()); System.out.println(e.getErrorMsg()); } } } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# coding: utf-8 import os from huaweicloudsdkcore.auth.credentials import BasicCredentials from huaweicloudsdksecmaster.v1.region.secmaster_region import SecMasterRegion from huaweicloudsdkcore.exceptions import exceptions from huaweicloudsdksecmaster.v1 import * if __name__ == "__main__": # The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. # In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment ak = os.environ["CLOUD_SDK_AK"] sk = os.environ["CLOUD_SDK_SK"] projectId = "{project_id}" credentials = BasicCredentials(ak, sk, projectId) client = SecMasterClient.new_builder() \ .with_credentials(credentials) \ .with_region(SecMasterRegion.value_of("<YOUR REGION>")) \ .build() try: request = ListSubscriptionProductRequest() response = client.list_subscription_product(request) print(response) except exceptions.ClientRequestException as e: print(e.status_code) print(e.request_id) print(e.error_code) print(e.error_msg) |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
package main import ( "fmt" "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic" secmaster "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/secmaster/v1" "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/secmaster/v1/model" region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/secmaster/v1/region" ) func main() { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment ak := os.Getenv("CLOUD_SDK_AK") sk := os.Getenv("CLOUD_SDK_SK") projectId := "{project_id}" auth := basic.NewCredentialsBuilder(). WithAk(ak). WithSk(sk). WithProjectId(projectId). Build() client := secmaster.NewSecMasterClient( secmaster.SecMasterClientBuilder(). WithRegion(region.ValueOf("<YOUR REGION>")). WithCredential(auth). Build()) request := &model.ListSubscriptionProductRequest{} response, err := client.ListSubscriptionProduct(request) if err == nil { fmt.Printf("%+v\n", response) } else { fmt.Println(err) } } |
For SDK sample code of more programming languages, see the Sample Code tab in API Explorer. SDK sample code can be automatically generated.
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
List of the SecMaster offerings supported at the current site |
|
400 |
Parameter error. |
|
403 |
No permissions. |
|
500 |
Internal error. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot