tencent cloud

Feedback

CreateBaselineStrategy

Last updated: 2024-12-06 15:41:30

1. API Description

Domain name for API request: cwp.intl.tencentcloudapi.com.

This API is used to create a baseline policy based on the policy information.

A maximum of 20 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common Params. The value used for this API: CreateBaselineStrategy.
Version Yes String Common Params. The value used for this API: 2018-02-28.
Region No String Common Params. This parameter is not required.
StrategyName Yes String Policy name
ScanCycle Yes Integer Check cycle, indicating the number of days between checks. Example: 2, indicating that the check is carried out every 2 days.
ScanAt Yes String Time for a periodic check. The scan task is issued at this time. Example: "22:00", indicating that the task is issued at 22:00.
CategoryIds.N Yes Array of Integer Array of selected baseline IDs under this policy. Example: [1,3,5,7]
IsGlobal Yes Integer Whether all servers are scanned. 1: yes; 0: no. If the value is 1, all Professional Edition hosts are scanned.
MachineType Yes String Cloud host type:
CVM: virtual machine
BM: bare metal server
ECM: edge computing machine
LH: Lighthouse
Other: hybrid cloud machine
RegionCode Yes String Host region. Example: "ap-guangzhou"
Quuids.N No Array of String Host ID array. Example: ["quuid1","quuid2"]

3. Output Parameters

Parameter Name Type Description
RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

4. Example

Example1 Creating Baseline Policy

This example shows you how to create the baseline policy based on the baseline information.

Input Example

https://cwp.intl.tencentcloudapi.com/?Action=CreateBaselineStrategy
&StrategyName=test
&ScanCycle=1
&ScanAt=00:00:00
&CategoryIds.0=1
&IsGlobal=1
&MachineType=CVM
&RegionCode=ab-bj
&Quuids.0="quuid1"
&<Common request parameters>

Output Example

{
    "Response": {
        "RequestId": "657f3c29-4bc9-4c48-a8d6-de5bd14ffc67"
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
FailedOperation.NoProfessionHost No Pro Edition host.
FailedOperation.TooManyStrategy The maximum number for baseline policy creation is exceeded.
InternalError Internal error
InvalidParameter Incorrect parameter.
InvalidParameter.IllegalRequest Invalid request.
InvalidParameter.MissingParameter Missing parameter.
InvalidParameter.ParsingError Incorrect parameter parsing.
InvalidParameterValue Invalid parameter value.
MissingParameter Missing parameter error.
OperationDenied The operation was denied.
ResourceNotFound The resource does not exist.