Querying the Plug-in Definition List
Function
This API is used to query the plug-in definition list.
Calling Method
For details, see Calling APIs.
URI
GET /v1/{project_id}/workspaces/{workspace_id}/soc/components
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Definition Project ID, which is used to specify the project that a resource belongs to. You can query the resources of a project by project ID. You can obtain the project ID from the API or console. Obtaining the Project ID Constraints N/A Range N/A Default Value N/A |
|
workspace_id |
Yes |
String |
Definition Workspace ID. Range N/A |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
offset |
No |
Integer |
Definition Offset. Constraints N/A Range N/A Default Value N/A |
|
limit |
No |
Integer |
Definition Data volume. Constraints N/A Range N/A Default Value N/A |
Request Parameters
None
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
code |
String |
Definition Response code. Constraints N/A |
|
total |
Integer |
Definition Total data records. Constraints N/A |
|
size |
Integer |
Definition Current page size. Constraints N/A |
|
page |
Integer |
Definition Current page number. Constraints N/A |
|
message |
String |
Definition Error message in the response. Constraints N/A |
|
success |
Boolean |
Definition Whether the response is successful. Constraints N/A |
|
request_id |
String |
Definition Request ID. Constraints N/A |
|
data |
Array of ComponentInfo objects |
List. |
|
Parameter |
Type |
Description |
|---|---|---|
|
id |
String |
Plugin ID. |
|
name |
String |
Plugin name. |
|
dev_language |
String |
Plugin implementation language. |
|
dev_language_version |
String |
Plugin implementation language version. |
|
alliance_id |
String |
Plugin set ID. |
|
alliance_name |
String |
Plugin set name. |
|
description |
String |
Plugin description. |
|
logo |
String |
Plugin icon. |
|
label |
String |
Plugin tag information. |
|
create_time |
String |
Creation time. |
|
update_time |
String |
Update time. |
|
creator_id |
String |
Creator ID. |
|
creator_name |
String |
Creator name. |
|
modifier_id |
String |
Modifier ID. |
|
modifier_name |
String |
Modifier name. |
|
operation_history |
Array of operation_history objects |
Plugin operation history. |
|
versions |
Array of ComponentVersionInfo objects |
Plugin version information, which is compatible with the previous Java plugin version. |
|
component_type |
String |
Plugin type. subscribe: subscribed. custom: custom. system: built-in. |
|
Parameter |
Type |
Description |
|---|---|---|
|
operation_name |
String |
Operation. |
|
operation_time |
String |
Time point. |
|
Parameter |
Type |
Description |
|---|---|---|
|
id |
String |
Version ID. |
|
version_num |
String |
Version number. |
|
version_desc |
String |
Version description. |
|
status |
String |
Status. |
|
package_name |
String |
Package to which the plugin belongs. |
|
component_attachment_id |
String |
Attachment ID of the plugin. |
|
sub_version_id |
String |
Subscription version ID. |
|
connection_config |
String |
Operation connection configuration list. |
Status code: 400
|
Parameter |
Type |
Description |
|---|---|---|
|
code |
String |
Definition Error code. Range N/A |
|
message |
String |
Definition Error description. Range N/A |
Example Requests
None
Example Responses
Status code: 200
Object returned upon a successful response.
{
"code" : "00000000",
"data" : [ {
"alliance_id" : "345b3a6c-0d03-40cd-bae4-88b64984743c",
"alliance_name" : "demo_alliance",
"component_type" : "system",
"create_time" : "2024-06-19T19:29:02.000Z+0800",
"creator_id" : "system",
"creator_name" : "system",
"modifier_id" : "system",
"modifier_name" : "system",
"description" : "demo_description",
"dev_language" : "Python",
"dev_language_version" : "3.7",
"id" : "ffe64aa4-6cab-4fc0-9cf0-bb2368a64b48",
"label" : "CLOUD_SERVICE",
"logo" : "demo_log",
"name" : "WAF",
"operation_history" : [ ],
"update_time" : "2024-06-19T19:29:02.000Z+0800",
"versions" : [ {
"id" : "cf4caa8c-f390-4b9e-a911-f5fc27277705",
"version_num" : "0.0.1",
"status" : "publish",
"sub_version_id" : "cf4caa8c-f390-4b9e-a911-f5fc27277705"
} ]
} ],
"message" : "message",
"page" : 1,
"request_id" : "",
"size" : 10,
"success" : true,
"total" : 1
}
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 48 |
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 ListComponentsSolution { 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(); ListComponentsRequest request = new ListComponentsRequest(); request.withWorkspaceId("{workspace_id}"); try { ListComponentsResponse response = client.listComponents(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 32 |
# 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 = ListComponentsRequest() request.workspace_id = "{workspace_id}" response = client.list_components(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 38 |
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.ListComponentsRequest{} request.WorkspaceId = "{workspace_id}" response, err := client.ListComponents(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 |
Object returned upon a successful response. |
|
400 |
Object returned upon a response 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