config-20190108/main.tea (2,084 lines of code) (raw):
/**
*
*/
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;
extends OpenApi;
init(config: OpenApi.Config){
super(config);
@endpointRule = 'central';
@endpointMap = {
cn-shanghai = 'config.cn-shanghai.aliyuncs.com',
ap-southeast-1 = 'config.ap-southeast-1.aliyuncs.com',
};
checkConfig(config);
@endpoint = getEndpoint('config', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}
function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
if (!Util.empty(endpoint)) {
return endpoint;
}
if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
return endpointMap[regionId];
}
return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}
model ActiveConfigRulesRequest {
configRuleIds?: string(name='ConfigRuleIds', description='The IDs of the rules. Separate multiple rule IDs with commas (,). You can specify a maximum of 20 rule IDs at a time.', example='cr-2da35180a8d1008e****,cr-2da35180a8d1008e****'),
}
model ActiveConfigRulesResponseBody = {
operateRuleResult?: {
operateRuleItemList?: [
{
configRuleId?: string(name='ConfigRuleId', description='The ID of the rule.', example='cr-2da35180a8d1008e****'),
errorCode?: string(name='ErrorCode', description='The error code.
* If the rule is enabled, no error code is returned.
* If you fail to enable the rule, an error code is returned. For more information, visit the [API Error Center](https://error-center.alibabacloud.com/status/product/Config).', example='ConfigRuleStatusNotInActive'),
success?: boolean(name='Success', description='Indicates whether the rule is enabled. Valid values:
* true
* false', example='false'),
}
](name='OperateRuleItemList', description='The result information about each rule.'),
}(name='OperateRuleResult', description='The result information about the operation.'),
requestId?: string(name='RequestId', description='The ID of the request.', example='49C1A88F-D163-46DF-84A6-F300229F37AE'),
}
model ActiveConfigRulesResponse = {
headers: map[string]string(name='headers'),
statusCode: int32(name='statusCode'),
body: ActiveConfigRulesResponseBody(name='body'),
}
/**
* @deprecated : ActiveConfigRules is deprecated, please use Config::2020-09-07::ActiveConfigRules instead.
*
* @param request ActiveConfigRulesRequest
* @param runtime runtime options for this request RuntimeOptions
* @return ActiveConfigRulesResponse
*/
// Deprecated
async function activeConfigRulesWithOptions(request: ActiveConfigRulesRequest, runtime: Util.RuntimeOptions): ActiveConfigRulesResponse {
Util.validateModel(request);
var query = {};
if (!Util.isUnset(request.configRuleIds)) {
query['ConfigRuleIds'] = request.configRuleIds;
}
var req = new OpenApi.OpenApiRequest{
query = OpenApiUtil.query(query),
};
var params = new OpenApi.Params{
action = 'ActiveConfigRules',
version = '2019-01-08',
protocol = 'HTTPS',
pathname = '/',
method = 'POST',
authType = 'AK',
style = 'RPC',
reqBodyType = 'formData',
bodyType = 'json',
};
return callApi(params, req, runtime);
}
/**
* @deprecated : ActiveConfigRules is deprecated, please use Config::2020-09-07::ActiveConfigRules instead.
*
* @param request ActiveConfigRulesRequest
* @return ActiveConfigRulesResponse
*/
// Deprecated
async function activeConfigRules(request: ActiveConfigRulesRequest): ActiveConfigRulesResponse {
var runtime = new Util.RuntimeOptions{};
return activeConfigRulesWithOptions(request, runtime);
}
model DeleteConfigRulesRequest {
configRuleIds?: string(name='ConfigRuleIds', description='The IDs of the rules. Separate multiple rule IDs with commas (,). You can specify a maximum of 20 rule IDs at a time.', example='cr-2da35180a8d1008e****,cr-2da35180a8d1008e****'),
}
model DeleteConfigRulesResponseBody = {
operateRuleResult?: {
operateRuleItemList?: [
{
configRuleId?: string(name='ConfigRuleId', description='The ID of the rule.', example='cr-2da35180a8d1008e****'),
errorCode?: string(name='ErrorCode', description='The error code.
* If the rule is deleted, no error code is returned.
* If you fail to delete the rule, an error code is returned. For more information, visit the [API Error Center](https://error-center.alibabacloud.com/status/product/Config).', example='ConfigRuleCanNotDelete'),
success?: boolean(name='Success', description='Indicates whether the rule is deleted. Valid values:
* true
* false', example='false'),
}
](name='OperateRuleItemList', description='The result information about each rule.'),
}(name='OperateRuleResult', description='The result information about the operation.'),
requestId?: string(name='RequestId', description='The ID of the request.', example='49C1A88F-D163-46DF-84A6-F300229F37AE'),
}
model DeleteConfigRulesResponse = {
headers: map[string]string(name='headers'),
statusCode: int32(name='statusCode'),
body: DeleteConfigRulesResponseBody(name='body'),
}
async function deleteConfigRulesWithOptions(request: DeleteConfigRulesRequest, runtime: Util.RuntimeOptions): DeleteConfigRulesResponse {
Util.validateModel(request);
var query = {};
if (!Util.isUnset(request.configRuleIds)) {
query['ConfigRuleIds'] = request.configRuleIds;
}
var req = new OpenApi.OpenApiRequest{
query = OpenApiUtil.query(query),
};
var params = new OpenApi.Params{
action = 'DeleteConfigRules',
version = '2019-01-08',
protocol = 'HTTPS',
pathname = '/',
method = 'POST',
authType = 'AK',
style = 'RPC',
reqBodyType = 'formData',
bodyType = 'json',
};
return callApi(params, req, runtime);
}
async function deleteConfigRules(request: DeleteConfigRulesRequest): DeleteConfigRulesResponse {
var runtime = new Util.RuntimeOptions{};
return deleteConfigRulesWithOptions(request, runtime);
}
model DescribeComplianceRequest {
complianceType?: string(name='ComplianceType', description='The compliance evaluation result of the resource. Valid values:
* COMPLIANT: The resource is evaluated to be compliant.
* NON_COMPLIANT: The resource is evaluated to be non-compliant.
* NOT_APPLICABLE: The rule does not apply to the resource.
* INSUFFICIENT_DATA: The resource data is insufficient.', example='COMPLIANT'),
configRuleId?: string(name='ConfigRuleId', description='The ID of the rule.
If you query compliance evaluation results by resource, you must specify the ConfigRuleId, ResourceType, and ResourceId parameters. Otherwise, the ConfigRuleId parameter becomes invalid.', example='cr-12b398b633820012****'),
memberId?: long(name='MemberId', description='This parameter is scheduled to be removed before 00:00:00, June 30, 2021. Account group-related APIs will be provided as an alternative before 00:00:00, May 30, 2021. If you are using this parameter, we recommend that you switch to account group-related APIs after 00:00:00, May 30, 2021. For more information, see [Account groups](~~211534~~).', example='1234567'),
multiAccount?: boolean(name='MultiAccount', description='This parameter is scheduled to be removed before 00:00:00, June 30, 2021. Account group-related APIs will be provided as an alternative before 00:00:00, May 30, 2021. If you are using this parameter, we recommend that you switch to account group-related APIs after 00:00:00, May 30, 2021. For more information, see [Account groups](~~211534~~).', example='false'),
resourceId?: string(name='ResourceId', description='The ID of the resource.
If you query compliance evaluation results by resource, you must specify the ResourceType and ResourceId parameters.', example='i-bp151g9tpto890zr****'),
resourceType?: string(name='ResourceType', description='The type of the resource.
If you query compliance evaluation results by resource, you must specify the ResourceType and ResourceId parameters.', example='ACS::ECS::Instance'),
}
model DescribeComplianceResponseBody = {
complianceResult?: {
compliances?: [
{
complianceType?: string(name='ComplianceType', description='The compliance evaluation result of the resource. Valid values:
* COMPLIANT: The resource is evaluated to be compliant.
* NON_COMPLIANT: The resource is evaluated to be non-compliant.
* NOT_APPLICABLE: The rule does not apply to the resource.
* INSUFFICIENT_DATA: The resource data is insufficient.', example='COMPLIANT'),
count?: int32(name='Count', description='The number of compliance evaluations with the corresponding result.
* This parameter returns the total number of evaluated resources if you set the ResourceId parameter in the request.
* This parameter returns the total number of triggered rules if you set the ConfigRuleId parameter in the request.', example='13'),
}
](name='Compliances', description='The compliance evaluation results based on compliance types.'),
totalCount?: long(name='TotalCount', description='The total number of compliance evaluations.
* This parameter returns the total number of evaluated resources if you set the ResourceId parameter in the request.
* This parameter returns the total number of triggered rules if you set the ConfigRuleId parameter in the request.', example='13'),
}(name='ComplianceResult', description='The statistics of compliance evaluations.'),
requestId?: string(name='RequestId', description='The ID of the request.', example='17306AB1-34E0-468F-BD7B-68D8AEAB754F'),
}
model DescribeComplianceResponse = {
headers: map[string]string(name='headers'),
statusCode: int32(name='statusCode'),
body: DescribeComplianceResponseBody(name='body'),
}
async function describeComplianceWithOptions(request: DescribeComplianceRequest, runtime: Util.RuntimeOptions): DescribeComplianceResponse {
Util.validateModel(request);
var query = {};
if (!Util.isUnset(request.complianceType)) {
query['ComplianceType'] = request.complianceType;
}
if (!Util.isUnset(request.configRuleId)) {
query['ConfigRuleId'] = request.configRuleId;
}
if (!Util.isUnset(request.memberId)) {
query['MemberId'] = request.memberId;
}
if (!Util.isUnset(request.multiAccount)) {
query['MultiAccount'] = request.multiAccount;
}
if (!Util.isUnset(request.resourceId)) {
query['ResourceId'] = request.resourceId;
}
if (!Util.isUnset(request.resourceType)) {
query['ResourceType'] = request.resourceType;
}
var req = new OpenApi.OpenApiRequest{
query = OpenApiUtil.query(query),
};
var params = new OpenApi.Params{
action = 'DescribeCompliance',
version = '2019-01-08',
protocol = 'HTTPS',
pathname = '/',
method = 'POST',
authType = 'AK',
style = 'RPC',
reqBodyType = 'formData',
bodyType = 'json',
};
return callApi(params, req, runtime);
}
async function describeCompliance(request: DescribeComplianceRequest): DescribeComplianceResponse {
var runtime = new Util.RuntimeOptions{};
return describeComplianceWithOptions(request, runtime);
}
model DescribeComplianceSummaryRequest {
memberId?: long(name='MemberId', description='This parameter is scheduled to be removed before 00:00:00, June 30, 2021. Account group-related APIs will be provided as an alternative before 00:00:00, May 30, 2021. If you are using this parameter, we recommend that you switch to account group-related APIs after 00:00:00, May 30, 2021. For more information, see [Account groups](~~211534~~).', example='123456789'),
multiAccount?: boolean(name='MultiAccount', description='This parameter is scheduled to be removed before 00:00:00, June 30, 2021. Account group-related APIs will be provided as an alternative before 00:00:00, May 30, 2021. If you are using this parameter, we recommend that you switch to account group-related APIs after 00:00:00, May 30, 2021. For more information, see [Account groups](~~211534~~).', example='false'),
}
model DescribeComplianceSummaryResponseBody = {
complianceSummary?: {
complianceSummaryByConfigRule?: {
complianceSummaryTimestamp?: long(name='ComplianceSummaryTimestamp', description='The timestamp when the summary was recorded.', example='1589853712165'),
compliantCount?: int32(name='CompliantCount', description='The number of rules whose evaluation results are compliant.', example='111'),
nonCompliantCount?: int32(name='NonCompliantCount', description='The number of rules whose evaluation results are non-compliant.', example='12'),
totalCount?: long(name='TotalCount', description='The total number of rules.', example='123'),
}(name='ComplianceSummaryByConfigRule', description='The summary of compliance evaluations from the rule dimension.'),
complianceSummaryByResource?: {
complianceSummaryTimestamp?: long(name='ComplianceSummaryTimestamp', description='The timestamp when the summary was recorded.', example='1589853712165'),
compliantCount?: int32(name='CompliantCount', description='The number of resources evaluated as compliant.', example='1'),
nonCompliantCount?: int32(name='NonCompliantCount', description='The number of resources evaluated as non-compliant.', example='12'),
totalCount?: long(name='TotalCount', description='The total number of resources.', example='13'),
}(name='ComplianceSummaryByResource', description='The summary of compliance evaluations from the resource dimension.'),
}(name='ComplianceSummary', description='The summary of compliance evaluations.'),
requestId?: string(name='RequestId', description='The ID of the request.', example='CAEE6F34-DEDC-4AAA-AA8C-946D5D008735'),
}
model DescribeComplianceSummaryResponse = {
headers: map[string]string(name='headers'),
statusCode: int32(name='statusCode'),
body: DescribeComplianceSummaryResponseBody(name='body'),
}
async function describeComplianceSummaryWithOptions(request: DescribeComplianceSummaryRequest, runtime: Util.RuntimeOptions): DescribeComplianceSummaryResponse {
Util.validateModel(request);
var query = {};
if (!Util.isUnset(request.memberId)) {
query['MemberId'] = request.memberId;
}
if (!Util.isUnset(request.multiAccount)) {
query['MultiAccount'] = request.multiAccount;
}
var req = new OpenApi.OpenApiRequest{
query = OpenApiUtil.query(query),
};
var params = new OpenApi.Params{
action = 'DescribeComplianceSummary',
version = '2019-01-08',
protocol = 'HTTPS',
pathname = '/',
method = 'POST',
authType = 'AK',
style = 'RPC',
reqBodyType = 'formData',
bodyType = 'json',
};
return callApi(params, req, runtime);
}
async function describeComplianceSummary(request: DescribeComplianceSummaryRequest): DescribeComplianceSummaryResponse {
var runtime = new Util.RuntimeOptions{};
return describeComplianceSummaryWithOptions(request, runtime);
}
model DescribeConfigRuleRequest {
configRuleId?: string(name='ConfigRuleId', description='The ID of the rule. You can call the [ListConfigRules](~~169607~~) operation to obtain the rule ID.', example='cr-7bc06457e0d90041****'),
memberId?: long(name='MemberId', description='This parameter is unavailable since 00:00:00 on June 30, 2021. Account group-related operations are provided as an alternative after 00:00:00 on May 30, 2021. If you are using this parameter, we recommend that you switch to account group-related operations after 00:00:00 on May 30, 2021. For information about account groups, see [Overview](~~211534~~).', example='123456789'),
multiAccount?: boolean(name='MultiAccount', description='This parameter is unavailable since 00:00:00 on June 30, 2021. Account group-related operations are provided as an alternative after 00:00:00 on May 30, 2021. If you are using this parameter, we recommend that you switch to account group-related operations after 00:00:00 on May 30, 2021. For information about account groups, see [Overview](~~211534~~).', example='false'),
}
model DescribeConfigRuleResponseBody = {
configRule?: {
configRuleArn?: string(name='ConfigRuleArn', description='The Alibaba Cloud Resource Name (ARN) of the rule.', example='acs:config::120886317861****:rule/cr-7bc06457e0d90041****'),
configRuleEvaluationStatus?: {
firstActivatedTimestamp?: long(name='FirstActivatedTimestamp', description='The timestamp when the rule was first triggered.', example='1618901952341'),
firstEvaluationStarted?: boolean(name='FirstEvaluationStarted', description='Indicates whether resources were evaluated based on the rule. Valid values:
* true
* false', example='true'),
lastErrorCode?: string(name='LastErrorCode', description='The error code returned for the last failed compliance evaluation.', example='FunctionNotFound'),
lastErrorMessage?: string(name='LastErrorMessage', description='The error message returned for the last failed compliance evaluation.', example='function \\"funtionName\\" does not exist in service \\"serviceName\\"'),
lastFailedEvaluationTimestamp?: long(name='LastFailedEvaluationTimestamp', description='The timestamp when the last failed compliance evaluation of the rule ended.', example='1602819143913'),
lastFailedInvocationTimestamp?: long(name='LastFailedInvocationTimestamp', description='The timestamp when the last failed compliance evaluation of the rule started.', example='1602819143910'),
lastSuccessfulEvaluationTimestamp?: long(name='LastSuccessfulEvaluationTimestamp', description='The timestamp when the last successful compliance evaluation of the rule ended.', example='1618901957876'),
lastSuccessfulInvocationTimestamp?: long(name='LastSuccessfulInvocationTimestamp', description='The timestamp when the last successful compliance evaluation of the rule started.', example='1618901957395'),
}(name='ConfigRuleEvaluationStatus', description='The information about compliance evaluations performed by the rule.'),
configRuleId?: string(name='ConfigRuleId', description='The ID of the rule.', example='cr-7bc06457e0d90041****'),
configRuleName?: string(name='ConfigRuleName', description='The name of the evaluation rule.', example='governance-guardrail-rds-public-access-check'),
configRuleState?: string(name='ConfigRuleState', description='The status of the rule. Valid values:
* ACTIVE: The rule is enabled.
* EVALUATING: The rule was triggered and is being used to monitor resource configurations.
* INACTIVE: The rule was disabled.', example='ACTIVE'),
createTimestamp?: long(name='CreateTimestamp', description='The timestamp when the rule was created.', example='1602818964884'),
description?: string(name='Description', description='The description of the system defense rule.', example='The number of CPU cores of the RDS instance is greater than or equal to the set threshold, which is considered as compliance.'),
inputParameters?: map[string]any(name='InputParameters', description='The input parameters of the rule.', example='{"cpuCount": "2" }'),
managedRule?: {
compulsoryInputParameterDetails?: map[string]any(name='CompulsoryInputParameterDetails', description='The settings of the required input parameters for the managed rule.', example='{"cpuCount": {"defaultValue": "2","type": "integer"}'),
description?: string(name='Description', description='The description of the managed rule.', example='The number of CPU cores of the RDS instance is greater than or equal to the set threshold, which is considered as compliance.'),
identifier?: string(name='Identifier', description='The identifier of the managed rule.', example='rds-cpu-min-count-limit'),
labels?: [ string ](name='Labels', description='The labels.'),
managedRuleName?: string(name='ManagedRuleName', description='The name of the managed rule.', example='rds-cpu-min-count-limit'),
optionalInputParameterDetails?: map[string]any(name='OptionalInputParameterDetails', description='The settings of the optional input parameters for the managed rule.', example='{"tag1Value":{"type":"string","defaultValue":""},"tag2Key":{"type":"string","defaultValue":""}}'),
sourceDetails?: [
{
eventSource?: string(name='EventSource', description='The event source of the managed rule.
> Only events related to Cloud Config are supported. The value is fixed to aliyun.config.', example='aliyun.config'),
maximumExecutionFrequency?: string(name='MaximumExecutionFrequency', description='The intervals at which the managed rule is triggered. Valid values:
* One_Hour: 1 hour.
* Three_Hours: 3 hours.
* Six_Hours: 6 hours.
* Twelve_Hours: 12 hours.
* TwentyFour_Hours: 24 hours.', example='Six_Hours'),
messageType?: string(name='MessageType', description='The trigger type of the managed rule. Valid values:
* ConfigurationItemChangeNotification: The managed rule is triggered by configuration changes.
* ScheduledNotification: The managed rule is triggered as scheduled.', example='ConfigurationItemChangeNotification'),
}
](name='SourceDetails', description='The intervals at which the rule is triggered. Valid values:
* One_Hour: 1 hour
* Three_Hours: 3 hours
* Six_Hours: 6 hours
* Twelve_Hours: 12 hours.
* TwentyFour_Hours: 24 hours.'),
}(name='ManagedRule', description='The details of the managed rule.'),
maximumExecutionFrequency?: string(name='MaximumExecutionFrequency', description='The intervals at which the rule is triggered. Valid values:
* One_Hour: 1 hour
* Three_Hours: 3 hours
* Six_Hours: 6 hours
* Twelve_Hours: 12 hours.
* TwentyFour_Hours: 24 hours.', example='Six_Hours'),
modifiedTimestamp?: long(name='ModifiedTimestamp', description='The timestamp when the rule was last modified.', example='1602992721000'),
riskLevel?: int32(name='RiskLevel', description='The risk level of the resources that are not compliant with the rule. Valid values:
* 1: high
* 2: medium
* 3: low', example='3'),
scope?: {
complianceResourceId?: string(name='ComplianceResourceId', description='The ID of the resource to be evaluated.', example='vpc-6weoy5flv41pj4wvr****'),
complianceResourceTypes?: [ string ](name='ComplianceResourceTypes', description='The types of the resources to be evaluated.'),
}(name='Scope', description='The monitoring scope of the rule.'),
source?: {
identifier?: string(name='Identifier', description='The identifier of the rule.
* If the rule was created based on a managed rule, the value of this parameter is the name of the managed rule.
* If the rule is a custom rule, the value of this parameter is the Alibaba Cloud Resource Name (ARN) of the relevant function in Function Compute.', example='rds-cpu-min-count-limit'),
owner?: string(name='Owner', description='The way in which the rule was created. Valid values:
* CUSTOM_FC: The rule is a custom rule.
* ALIYUN: The rule was created based on a managed rule of Alibaba Cloud.', example='ALIYUN'),
sourceConditions?: [
{
desiredValue?: string(name='DesiredValue', description='The expected value of the input parameter.', example='2'),
name?: string(name='Name', description='The name of the input parameter for the rule.', example='cpuCount'),
operator?: string(name='Operator', description='The operator used to compare the actual value against the expected value of the input parameter. The operator varies based on the type of data returned for the SelectPath parameter.
* Valid values for the String data type:
* StringEquals: The actual value is equal to the expected value.
* NotStringEquals: The actual value is not equal to the expected value.
* StringIn: The actual value exists in the expected value.
* NotStringIn: The actual value does not exist in the expected value.
* StringContains: The actual value contains the expected value.
* NotStringContains: The actual value does not contain the expected value.
* Valid values for the Number data type:
* Equals: The actual value is equal to the expected value.
* NotEquals: The actual value is not equal to the expected value.
* Less: The actual value is less than the expected value.
* LessOrEquals: The actual value is less than or equal to the expected value.
* Greater: The actual value is greater than the expected value.
* GreaterOrEquals: The actual value is greater than or equal to the expected value.
* Valid values for the Base64String data type that indicates a Base64-encoded string:
* Base64Contains: The actual value contains the expected value.
* NotBase64Contains: The actual value does not contain the expected value.
* Base64ContainsAll: The actual value contains all characters in the expected value.
* Base64ExcludeAll: The actual value excludes all characters in the expected value.
* Valid values for the Array data type:
* Contains: The actual value contains the expected value.
* NotContains: The actual value does not contain the expected value.
* In: The actual value exists in the expected value.
* NotIn: The actual value does not exist in the expected value.
* ContainsAll: The actual value contains all elements of the expected value.
* ExcludeAll: The actual value excludes all elements of the expected value.
* IsEmpty: The actual value is null.', example='GreaterOrEquals'),
tips?: string(name='Tips', description='The description of the input parameter.', example='You are not logged in or your login token has expired.'),
}
](name='SourceConditions', description='The name of the input parameter for the rule.'),
sourceDetails?: [
{
eventSource?: string(name='EventSource', description='The event source of the rule.
> Only events related to Cloud Config are supported. The value is fixed to aliyun.config.', example='aliyun.config'),
maximumExecutionFrequency?: string(name='MaximumExecutionFrequency', description='The intervals at which the rule is triggered. Valid values:
* One_Hour: 1 hour.
* Three_Hours: 3 hours.
* Six_Hours: 6 hours.
* Twelve_Hours: 12 hours.
* TwentyFour_Hours: 24 hours.', example='Six_Hours'),
messageType?: string(name='MessageType', description='The trigger type of the rule. Valid values:
* ConfigurationItemChangeNotification: The rule is triggered by configuration changes.
* ScheduledNotification: The rule is triggered as scheduled.', example='ConfigurationItemChangeNotification'),
}
](name='SourceDetails', description='The intervals at which the rule is triggered. Valid values:
* One_Hour: 1 hour
* Three_Hours: 3 hours
* Six_Hours: 6 hours
* Twelve_Hours: 12 hours.
* TwentyFour_Hours: 24 hours.'),
}(name='Source', description='The information about the trigger of the rule.'),
}(name='ConfigRule', description='The details of the rule.'),
requestId?: string(name='RequestId', description='The request ID.', example='A68DD98C-DE65-46AC-B2D2-04A4A9AB5B99'),
}
model DescribeConfigRuleResponse = {
headers: map[string]string(name='headers'),
statusCode: int32(name='statusCode'),
body: DescribeConfigRuleResponseBody(name='body'),
}
async function describeConfigRuleWithOptions(request: DescribeConfigRuleRequest, runtime: Util.RuntimeOptions): DescribeConfigRuleResponse {
Util.validateModel(request);
var query = {};
if (!Util.isUnset(request.configRuleId)) {
query['ConfigRuleId'] = request.configRuleId;
}
if (!Util.isUnset(request.memberId)) {
query['MemberId'] = request.memberId;
}
if (!Util.isUnset(request.multiAccount)) {
query['MultiAccount'] = request.multiAccount;
}
var req = new OpenApi.OpenApiRequest{
query = OpenApiUtil.query(query),
};
var params = new OpenApi.Params{
action = 'DescribeConfigRule',
version = '2019-01-08',
protocol = 'HTTPS',
pathname = '/',
method = 'POST',
authType = 'AK',
style = 'RPC',
reqBodyType = 'formData',
bodyType = 'json',
};
return callApi(params, req, runtime);
}
async function describeConfigRule(request: DescribeConfigRuleRequest): DescribeConfigRuleResponse {
var runtime = new Util.RuntimeOptions{};
return describeConfigRuleWithOptions(request, runtime);
}
model DescribeConfigurationRecorderResponseBody = {
configurationRecorder?: {
accountId?: long(name='AccountId', description='The ID of your Alibaba Cloud account.', example='100931896542****'),
configurationRecorderStatus?: string(name='ConfigurationRecorderStatus', description='The status of the configuration recorder. Valid values:
* REGISTRABLE: The configuration recorder has not been registered.
* BUILDING: The configuration recorder is being deployed.
* REGISTERED: The configuration recorder has been registered.
* REBUILDING: The configuration recorder is being redeployed.', example='REGISTERED'),
organizationEnableStatus?: string(name='OrganizationEnableStatus', description='Indicates whether Cloud Config is upgraded to Cloud Config for Enterprise. Valid values:
* REGISTRABLE: Cloud Config is not upgraded to Cloud Config for Enterprise.
* BUILDING: Cloud Config is being upgraded to Cloud Config for Enterprise.
* REGISTERED: Cloud Config is upgraded to Cloud Config for Enterprise.', example='REGISTRABLE'),
organizationMasterId?: long(name='OrganizationMasterId', description='The ID of the management account.
> This parameter is returned only when the operation is called by a management account.', example='120886317861****'),
resourceTypes?: [ string ](name='ResourceTypes', description='The types of resources that are monitored by Cloud Config.'),
}(name='ConfigurationRecorder', description='The details of the configuration recorder that monitors resources.'),
requestId?: string(name='RequestId', description='The ID of the request.', example='A3601178-A6A2-4636-BE56-1116F73C0B0C'),
}
model DescribeConfigurationRecorderResponse = {
headers: map[string]string(name='headers'),
statusCode: int32(name='statusCode'),
body: DescribeConfigurationRecorderResponseBody(name='body'),
}
/**
* In this example, the Alibaba Cloud account `100931896542****` is used. The return result shows that two types of resources are monitored: `ACS::ECS::Instance` and `ACS::ECS::NetworkInterface`. The status of the configuration recorder is `REGISTERED`.
*
* @param request DescribeConfigurationRecorderRequest
* @param runtime runtime options for this request RuntimeOptions
* @return DescribeConfigurationRecorderResponse
*/
async function describeConfigurationRecorderWithOptions(runtime: Util.RuntimeOptions): DescribeConfigurationRecorderResponse {
var req = new OpenApi.OpenApiRequest{};
var params = new OpenApi.Params{
action = 'DescribeConfigurationRecorder',
version = '2019-01-08',
protocol = 'HTTPS',
pathname = '/',
method = 'POST',
authType = 'AK',
style = 'RPC',
reqBodyType = 'formData',
bodyType = 'json',
};
return callApi(params, req, runtime);
}
/**
* In this example, the Alibaba Cloud account `100931896542****` is used. The return result shows that two types of resources are monitored: `ACS::ECS::Instance` and `ACS::ECS::NetworkInterface`. The status of the configuration recorder is `REGISTERED`.
*
* @return DescribeConfigurationRecorderResponse
*/
async function describeConfigurationRecorder(): DescribeConfigurationRecorderResponse {
var runtime = new Util.RuntimeOptions{};
return describeConfigurationRecorderWithOptions(runtime);
}
model DescribeDeliveryChannelsRequest {
deliveryChannelIds?: string(name='DeliveryChannelIds', description='The ID of the delivery channel. Separate multiple IDs with commas (,).
For more information about how to obtain the ID of a delivery channel, see [PutDeliveryChannel](~~174253~~).', example='cdc-d9106457e0d900b1****'),
}
model DescribeDeliveryChannelsResponseBody = {
deliveryChannels?: [
{
configurationItemChangeNotification?: boolean(name='ConfigurationItemChangeNotification', description='Indicates whether the resource change logs are received by the specified destination. If you set this parameter to true, Cloud Config delivers the resource change logs to OSS, Log Service, or MNS when the configurations of the resources change. Valid values:
* true: The resource change logs are received by the specified destination.
* false: The resource change logs are not received by the specified destination.', example='true'),
configurationSnapshot?: boolean(name='ConfigurationSnapshot', description='Indicates whether the scheduled resource snapshots are received by the OSS bucket. If you set this parameter to true, Cloud Config delivers the scheduled resource snapshots to the specified OSS bucket at 00:00:00 and 12:00:00 every day. Valid values:
* true: The scheduled resource snapshots are received by the specified OSS bucket.
* false: The scheduled resource snapshots are not received by the specified OSS bucket.', example='false'),
deliveryChannelAssumeRoleArn?: string(name='DeliveryChannelAssumeRoleArn', description='The Alibaba Cloud Resource Name (ARN) of the role assumed by the delivery channel.', example='acs:ram::120886317861****:role/aliyunserviceroleforconfig'),
deliveryChannelCondition?: string(name='DeliveryChannelCondition', description='The rule attached to the delivery channel. This parameter is applicable only to delivery channels of the MNS type.
This parameter indicates the lowest risk level for the events to subscribe to and the resource types for which you subscribe to events.
* The setting of the lowest risk level for the events to subscribe to is in the following format: `{"filterType":"RuleRiskLevel","value":"1","multiple":false}`.
The value field indicates the lowest risk level. Valid values: 1, 2, and 3. A value of 1 indicates the high risk level. A value of 2 indicates the medium risk level. A value of 3 indicates the low risk level.
* The setting of the resource types for which you subscribe to events is in the following format: `{"filterType":"ResourceType","values":["ACS::ACK::Cluster","ACS::ActionTrail::Trail","ACS::CBWP::CommonBandwidthPackage"],"multiple":true}`.
The values field indicates the resource types for which you subscribe to events. Its value is a JSON array.
Example: `[{"filterType":"ResourceType","values":["ACS::ActionTrail::Trail","ACS::CBWP::CommonBandwidthPackage","ACS::CDN::Domain","ACS::CEN::CenBandwidthPackage","ACS::CEN::CenInstance","ACS::CEN::Flowlog","ACS::DdosCoo::Instance"],"multiple":true}]`', example='[{"filterType":"ResourceType","values":["ACS::ActionTrail::Trail","ACS::CBWP::CommonBandwidthPackage","ACS::CDN::Domain","ACS::CEN::CenBandwidthPackage","ACS::CEN::CenInstance","ACS::CEN::Flowlog","ACS::DdosCoo::Instance"],"multiple":true}]'),
deliveryChannelId?: string(name='DeliveryChannelId', description='The ID of the delivery channel.', example='cdc-d9106457e0d900b1****'),
deliveryChannelName?: string(name='DeliveryChannelName', description='The name of the delivery channel.', example='myDeliveryChannel'),
deliveryChannelTargetArn?: string(name='DeliveryChannelTargetArn', description='The ARN of the delivery destination.
* If the DeliveryChannelType parameter is set to OSS, the value of this parameter is the ARN of the destination OSS bucket.
* If the DeliveryChannelType parameter is set to MNS, the value of this parameter is the ARN of the destination MNS topic.
* If the DeliveryChannelType parameter is set to SLS, the value is the ARN of the destination Log Service Logstore.', example='acs:oss:cn-shanghai:120886317861****:new-bucket'),
deliveryChannelType?: string(name='DeliveryChannelType', description='The type of the delivery channel. Valid values:
* OSS: Object Storage Service (OSS)
* MNS: Message Service (MNS)
* SLS: Log Service', example='OSS'),
description?: string(name='Description', description='The description of the delivery channel.', example='My OSS delivery.'),
nonCompliantNotification?: boolean(name='NonCompliantNotification', description='Indicates whether the resource non-compliance events are received by the specified destination. If you set this parameter to true, Cloud Config delivers resource non-compliance events to Log Service or MNS when resources are evaluated as non-compliant. Valid values:
* true: The resource non-compliance events are received by the specified destination.
* false: The resource non-compliance events are not received by the specified destination.', example='false'),
oversizedDataOSSTargetArn?: string(name='OversizedDataOSSTargetArn', description='The ARN of the OSS bucket to which the delivered data is transferred when the size of the data exceeds the specified upper limit of the delivery channel.', example='acs:oss:cn-shanghai:100931896542****:new-bucket'),
status?: int32(name='Status', description='The status of the delivery channel. Valid values:
* 0: The delivery channel is disabled.
* 1: The delivery channel is enabled.', example='1'),
}
](name='DeliveryChannels', description='The information about the delivery channel.'),
requestId?: string(name='RequestId', description='The ID of the request.', example='DC300244-FCE3-5061-8214-C27ECB668487'),
}
model DescribeDeliveryChannelsResponse = {
headers: map[string]string(name='headers'),
statusCode: int32(name='statusCode'),
body: DescribeDeliveryChannelsResponseBody(name='body'),
}
/**
* @deprecated : DescribeDeliveryChannels is deprecated, please use Config::2020-09-07::ListConfigDeliveryChannels,Config::2020-09-07::ListAggregateConfigDeliveryChannels instead.
*
* @param request DescribeDeliveryChannelsRequest
* @param runtime runtime options for this request RuntimeOptions
* @return DescribeDeliveryChannelsResponse
*/
// Deprecated
async function describeDeliveryChannelsWithOptions(request: DescribeDeliveryChannelsRequest, runtime: Util.RuntimeOptions): DescribeDeliveryChannelsResponse {
Util.validateModel(request);
var query = {};
if (!Util.isUnset(request.deliveryChannelIds)) {
query['DeliveryChannelIds'] = request.deliveryChannelIds;
}
var req = new OpenApi.OpenApiRequest{
query = OpenApiUtil.query(query),
};
var params = new OpenApi.Params{
action = 'DescribeDeliveryChannels',
version = '2019-01-08',
protocol = 'HTTPS',
pathname = '/',
method = 'POST',
authType = 'AK',
style = 'RPC',
reqBodyType = 'formData',
bodyType = 'json',
};
return callApi(params, req, runtime);
}
/**
* @deprecated : DescribeDeliveryChannels is deprecated, please use Config::2020-09-07::ListConfigDeliveryChannels,Config::2020-09-07::ListAggregateConfigDeliveryChannels instead.
*
* @param request DescribeDeliveryChannelsRequest
* @return DescribeDeliveryChannelsResponse
*/
// Deprecated
async function describeDeliveryChannels(request: DescribeDeliveryChannelsRequest): DescribeDeliveryChannelsResponse {
var runtime = new Util.RuntimeOptions{};
return describeDeliveryChannelsWithOptions(request, runtime);
}
model DescribeDiscoveredResourceRequest {
memberId?: long(name='MemberId', description='This parameter is scheduled to be removed before 00:00:00, June 30, 2021. Account group-related APIs will be provided as an alternative before 00:00:00, May 30, 2021. If you are using this parameter, we recommend that you switch to account group-related APIs after 00:00:00, May 30, 2021. For more information, see [Account groups](~~211534~~).', example='123456789'),
multiAccount?: boolean(name='MultiAccount', description='This parameter is scheduled to be removed before 00:00:00, June 30, 2021. Account group-related APIs will be provided as an alternative before 00:00:00, May 30, 2021. If you are using this parameter, we recommend that you switch to account group-related APIs after 00:00:00, May 30, 2021. For more information, see [Account groups](~~211534~~).', example='true'),
region?: string(name='Region', description='The ID of the region.', example='cn-hangzhou'),
resourceId?: string(name='ResourceId', description='The ID of the resource.', example='adaf.zhilon****'),
resourceType?: string(name='ResourceType', description='The type of the resource.
> You can call the GetSupportedResourceTypes operation to query the resource types supported by Cloud Config. For more information, see [GetSupportedResourceTypes](~~169618~~).', example='ACS::CDN::Domain'),
}
model DescribeDiscoveredResourceResponseBody = {
discoveredResourceDetail?: {
accountId?: long(name='AccountId', description='The ID of your Alibaba Cloud account.', example='987654321'),
availabilityZone?: string(name='AvailabilityZone', description='The zone where the resource resides.', example='cn-hangzhou-h'),
configuration?: string(name='Configuration', description='The configuration of the resource.', example='{\\"Description\\":\\"\\",\\"SslProtocol\\":\\"off\\",\\"DomainName\\":\\"adaf.zhilong****\\",\\"GmtModified\\":\\"2019-04-10T03:11Z\\",\\"CdnType\\":\\"web\\",\\"GmtCreated\\":\\"2016-03-03T01:31:35Z\\",\\"Cname\\":\\"adaf.zhilong.me.w.kun****.com\\",\\"Sources\\":{\\"Source\\":[{\\"Type\\":\\"oss\\",\\"Content\\":\\"test2-mh.oss-cn-hangzhou.aliyuncs.com\\",\\"Priority\\":\\"20\\",\\"Port\\":80,\\"Weight\\":\\"10\\"}]},\\"DomainStatus\\":\\"offline\\",\\"Sandbox\\":\\"\\"}'),
region?: string(name='Region', description='The ID of the region.', example='cn-hangzhou'),
resourceCreationTime?: long(name='ResourceCreationTime', description='The timestamp when the resource was created.', example='1456968695000'),
resourceDeleted?: int32(name='ResourceDeleted', description='Indicates whether the resource is deleted. Valid values:
* 1: The resource is not deleted.
* 0: The resource is deleted.', example='1'),
resourceId?: string(name='ResourceId', description='The ID of the resource.', example='adaf.zhilon****'),
resourceName?: string(name='ResourceName', description='The name of the resource.', example='test-resource-name'),
resourceStatus?: string(name='ResourceStatus', description='The status of the resource. The parameter value varies with the resource type and may be left empty. Examples:
* If ResourceType is set to ACS::ECS::Instance, the resource is an Elastic Compute Service (ECS) instance which has a specific state. In this case, valid values of this parameter include Running and Stopped.
* If ResourceType is set to ACS::OSS::Bucket, the resource is an Object Storage Service (OSS) bucket which does not have a specific state. In this case, this parameter is left empty.', example='offline'),
resourceType?: string(name='ResourceType', description='The type of the resource.', example='ACS::CDN::Domain'),
tags?: string(name='Tags', description='The tags of the resource.', example='{\\"\\"hc\\"\\":[\\"\\"value2\\"\\"]}'),
}(name='DiscoveredResourceDetail', description='The information about the resource.'),
requestId?: string(name='RequestId', description='The ID of the request.', example='E4D71ACE-6B0A-46E0-8352-56952378CC7F'),
}
model DescribeDiscoveredResourceResponse = {
headers: map[string]string(name='headers'),
statusCode: int32(name='statusCode'),
body: DescribeDiscoveredResourceResponseBody(name='body'),
}
async function describeDiscoveredResourceWithOptions(request: DescribeDiscoveredResourceRequest, runtime: Util.RuntimeOptions): DescribeDiscoveredResourceResponse {
Util.validateModel(request);
var query = {};
if (!Util.isUnset(request.memberId)) {
query['MemberId'] = request.memberId;
}
if (!Util.isUnset(request.multiAccount)) {
query['MultiAccount'] = request.multiAccount;
}
if (!Util.isUnset(request.region)) {
query['Region'] = request.region;
}
if (!Util.isUnset(request.resourceId)) {
query['ResourceId'] = request.resourceId;
}
if (!Util.isUnset(request.resourceType)) {
query['ResourceType'] = request.resourceType;
}
var req = new OpenApi.OpenApiRequest{
query = OpenApiUtil.query(query),
};
var params = new OpenApi.Params{
action = 'DescribeDiscoveredResource',
version = '2019-01-08',
protocol = 'HTTPS',
pathname = '/',
method = 'POST',
authType = 'AK',
style = 'RPC',
reqBodyType = 'formData',
bodyType = 'json',
};
return callApi(params, req, runtime);
}
async function describeDiscoveredResource(request: DescribeDiscoveredResourceRequest): DescribeDiscoveredResourceResponse {
var runtime = new Util.RuntimeOptions{};
return describeDiscoveredResourceWithOptions(request, runtime);
}
model DescribeEvaluationResultsRequest {
complianceType?: string(name='ComplianceType', description='The compliance evaluation result. Valid values:
* COMPLIANT: The resources are evaluated as compliant.
* NON_COMPLIANT: The resources are evaluated as non-compliant.
* NOT_APPLICABLE: The rule does not apply to the resources.
* INSUFFICIENT_DATA: The resource data is insufficient.', example='COMPLIANT'),
configRuleId?: string(name='ConfigRuleId', description='The rule ID. If you query the compliance evaluation results of resources by rule, you must specify this parameter.
> You must specify the ResourceType or ConfigRuleId parameter.', example='cr-2da35180a8d1008e****'),
memberId?: long(name='MemberId', description='This parameter is unavailable since 00:00:00 on June 30, 2021. Account group-related operations are provided as an alternative after 00:00:00 on May 30, 2021. If you are using this parameter, we recommend that you switch to account group-related operations after 00:00:00 on May 30, 2021. For information about account groups, see [Overview](~~211534~~).', example='123456789'),
multiAccount?: boolean(name='MultiAccount', description='This parameter is unavailable since 00:00:00 on June 30, 2021. Account group-related operations are provided as an alternative after 00:00:00 on May 30, 2021. If you are using this parameter, we recommend that you switch to account group-related operations after 00:00:00 on May 30, 2021. For information about account groups, see [Overview](~~211534~~).', example='false'),
pageNumber?: int32(name='PageNumber', description='The number of the page to return. Pages start from page 1.', example='1'),
pageSize?: int32(name='PageSize', description='The number of entries to return per page. Valid values: 1 to 100.', example='10'),
resourceId?: string(name='ResourceId', description='The resource ID. If you query the compliance evaluation results of resources by resource type, you must specify this parameter.', example='i-bp151g9tpto890zr****'),
resourceType?: string(name='ResourceType', description='The type of resource. If you query the compliance evaluation results of resources by resource type, you must specify this parameter.
You can call the GetSupportedResourceTypes operation to query the resource types supported by Cloud Config. For more information, see [GetSupportedResourceTypes](~~169618~~).
> You must specify the ResourceType or ConfigRuleId parameter.', example='ACS::ECS::Instance'),
}
model DescribeEvaluationResultsResponseBody = {
evaluationResults?: {
evaluationResultList?: [
{
annotation?: string(name='Annotation', description='The annotation to the resource that is evaluated to be non-compliant.', example='{"operator": "StringEquals", "property": "$.SslProtocol", "desiredValue": "on", "configuration": "[\\"off\\"]"}'),
complianceType?: string(name='ComplianceType', description='The compliance evaluation result of the resource. Valid values:
* COMPLIANT: The resource is evaluated to be compliant.
* NON_COMPLIANT: The resource is evaluated to be non-compliant.
* NOT_APPLICABLE: The rule does not apply to the resource.
* INSUFFICIENT_DATA: The resource data is insufficient.', example='COMPLIANT'),
configRuleInvokedTimestamp?: long(name='ConfigRuleInvokedTimestamp', description='The timestamp that was generated when the rule was triggered.', example='1589941923258'),
evaluationResultIdentifier?: {
evaluationResultQualifier?: {
configRuleArn?: string(name='ConfigRuleArn', description='The Alibaba Cloud Resource Name (ARN) of the rule.', example='acs:config::120390217529****:config-rule/cr-2da35180a8d1008e****'),
configRuleId?: string(name='ConfigRuleId', description='The ID of the rule.', example='cr-2da35180a8d1008e****'),
configRuleName?: string(name='ConfigRuleName', description='The name of the rule.', example='test-rule-name'),
regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
resourceId?: string(name='ResourceId', description='The ID of the evaluated resource.', example='i-bp151g9tpto890zr****'),
resourceName?: string(name='ResourceName', description='The type of the evaluated resource.', example='launch-advisor-20200330'),
resourceType?: string(name='ResourceType', description='The type of the evaluated resource.', example='ACS::ECS::Instance'),
}(name='EvaluationResultQualifier', description='The information of the rule and the evaluated resource.'),
orderingTimestamp?: long(name='OrderingTimestamp', description='The timestamp that was generated when the compliance evaluation was performed.', example='1589941923117'),
}(name='EvaluationResultIdentifier', description='The identifier of the compliance evaluation result.'),
invokingEventMessageType?: string(name='InvokingEventMessageType', description='The trigger type of the rule. Valid values:
* ConfigurationItemChangeNotification: The rule is triggered by configuration changes.
* ScheduledNotification: The rule is triggered as scheduled.', example='ConfigurationItemChangeNotification'),
remediationEnabled?: boolean(name='RemediationEnabled', description='Specifies whether to enable the remediation template. Valid values:
* **true**
* **false**', example='false'),
resultRecordedTimestamp?: long(name='ResultRecordedTimestamp', description='The timestamp that was generated when the compliance evaluation result was recorded.', example='1589941923432'),
riskLevel?: int32(name='RiskLevel', description='The risk level of the non-compliant resource. Valid values:
* 1: high risk
* 2: medium risk
* 3: low risk', example='1'),
}
](name='EvaluationResultList', description='Indicates whether remediation is enabled. Valid values:
* true
* false'),
pageNumber?: int32(name='PageNumber', description='The page number of the returned page. Pages start from page 1.', example='1'),
pageSize?: int32(name='PageSize', description='The number of entries returned per page. Valid values: 1 to 100.', example='10'),
totalCount?: long(name='TotalCount', description='The total number of compliance evaluation results.', example='2'),
}(name='EvaluationResults', description='The information about the compliance evaluation results returned.'),
requestId?: string(name='RequestId', description='The request ID.', example='D296EE41-1143-4B13-83BB-909008100130'),
}
model DescribeEvaluationResultsResponse = {
headers: map[string]string(name='headers'),
statusCode: int32(name='statusCode'),
body: DescribeEvaluationResultsResponseBody(name='body'),
}
async function describeEvaluationResultsWithOptions(request: DescribeEvaluationResultsRequest, runtime: Util.RuntimeOptions): DescribeEvaluationResultsResponse {
Util.validateModel(request);
var query = OpenApiUtil.query(Util.toMap(request));
var req = new OpenApi.OpenApiRequest{
query = OpenApiUtil.query(query),
};
var params = new OpenApi.Params{
action = 'DescribeEvaluationResults',
version = '2019-01-08',
protocol = 'HTTPS',
pathname = '/',
method = 'GET',
authType = 'AK',
style = 'RPC',
reqBodyType = 'formData',
bodyType = 'json',
};
return callApi(params, req, runtime);
}
async function describeEvaluationResults(request: DescribeEvaluationResultsRequest): DescribeEvaluationResultsResponse {
var runtime = new Util.RuntimeOptions{};
return describeEvaluationResultsWithOptions(request, runtime);
}
model GetAggregateDiscoveredResourceRequest {
aggregatorId?: string(name='AggregatorId', description='The ID of the account group.
For more information about how to obtain the ID of an account group, see [ListAggregators](~~255797~~).', example='ca-5885626622af0008****'),
region?: string(name='Region', description='The ID of the region where the resource resides.
For more information about how to obtain the region ID of a resource, see [ListAggregateDiscoveredResources](~~265983~~).', example='cn-hangzhou'),
resourceId?: string(name='ResourceId', description='The ID of the resource.
For more information about how to obtain the ID of a resource, see [ListAggregateDiscoveredResources](~~265983~~).', example='new-bucket'),
resourceOwnerId?: long(name='ResourceOwnerId'),
resourceType?: string(name='ResourceType', description='The type of the resource.
For more information about how to obtain the type of a resource, see [ListAggregateDiscoveredResources](~~265983~~).', example='ACS::OSS::Bucket'),
}
model GetAggregateDiscoveredResourceResponseBody = {
discoveredResourceDetail?: {
accountId?: long(name='AccountId', description='The ID of the Alibaba Cloud account to which the resource belongs.', example='100931896542****'),
availabilityZone?: string(name='AvailabilityZone', description='The zone where the resource resides.', example='cn-hangzhou-h'),
configuration?: string(name='Configuration', description='The configuration of the resource.', example='{\\"AccessControlList\\":{\\"Grant\\":\\"private\\"},\\"ServerSideEncryptionRule\\":{\\"SSEAlgorithm\\":\\"None\\"},\\"Comment\\":\\"\\",\\"CreationDate\\":\\"2021-06-29T10:05:12.000Z\\",\\"Owner\\":{\\"DisplayName\\":\\"100931896542****\\",\\"ID\\":\\"100931896542****\\"},\\"StorageClass\\":\\"Standard\\",\\"DataRedundancyType\\":\\"LRS\\",\\"AllowEmptyReferer\\":\\"true\\",\\"Name\\":\\"new-bucket\\",\\"BucketPolicy\\":{\\"LogPrefix\\":\\"\\",\\"LogBucket\\":\\"\\"},\\"ExtranetEndpoint\\":\\"oss-cn-hangzhou.aliyuncs.com\\",\\"IntranetEndpoint\\":\\"oss-cn-hangzhou-internal.aliyuncs.com\\",\\"Location\\":\\"oss-cn-hangzhou\\"}'),
region?: string(name='Region', description='The ID of the region where the resource resides.', example='cn-hangzhou'),
resourceCreationTime?: long(name='ResourceCreationTime', description='The timestamp when the resource was created.', example='1624961112000'),
resourceDeleted?: int32(name='ResourceDeleted', description='Indicates whether the resource is deleted. Valid values:
* 1: The resource is retained.
* 0: The resource is deleted.', example='1'),
resourceId?: string(name='ResourceId', description='The ID of the resource.', example='new-bucket'),
resourceName?: string(name='ResourceName', description='The name of the resource.', example='new-bucket'),
resourceStatus?: string(name='ResourceStatus', description='The status of the resource. The parameter value varies with the resource type and may be left empty. Examples:
* If the ResourceType parameter is set to ACS::ECS::Instance, the resource is an Elastic Compute Service (ECS) instance that has a specific state. In this case, valid values of this parameter include Running and Stopped.
* If the ResourceType parameter is set to ACS::OSS::Bucket, the resource is an Object Storage Service (OSS) bucket that does not have a specific state. In this case, this parameter is left empty.', example='offline'),
resourceType?: string(name='ResourceType', description='The type of the resource.', example='ACS::OSS::BucketACS::CDN::Domain'),
tags?: string(name='Tags', description='The tags of the resource.', example='{\\"\\"hc\\"\\":[\\"\\"value2\\"\\"]}'),
}(name='DiscoveredResourceDetail', description='The information about the resource.'),
requestId?: string(name='RequestId', description='The ID of the request.', example='E4D71ACE-6B0A-46E0-8352-56952378CC7F'),
}
model GetAggregateDiscoveredResourceResponse = {
headers: map[string]string(name='headers'),
statusCode: int32(name='statusCode'),
body: GetAggregateDiscoveredResourceResponseBody(name='body'),
}
/**
* @deprecated : GetAggregateDiscoveredResource is deprecated, please use Config::2020-09-07::GetAggregateDiscoveredResource instead.
* In this topic, the `new-bucket` resource in the `ca-5885626622af0008****` account group is used as an example.
*
* @param request GetAggregateDiscoveredResourceRequest
* @param runtime runtime options for this request RuntimeOptions
* @return GetAggregateDiscoveredResourceResponse
*/
// Deprecated
async function getAggregateDiscoveredResourceWithOptions(request: GetAggregateDiscoveredResourceRequest, runtime: Util.RuntimeOptions): GetAggregateDiscoveredResourceResponse {
Util.validateModel(request);
var query = OpenApiUtil.query(Util.toMap(request));
var req = new OpenApi.OpenApiRequest{
query = OpenApiUtil.query(query),
};
var params = new OpenApi.Params{
action = 'GetAggregateDiscoveredResource',
version = '2019-01-08',
protocol = 'HTTPS',
pathname = '/',
method = 'GET',
authType = 'AK',
style = 'RPC',
reqBodyType = 'formData',
bodyType = 'json',
};
return callApi(params, req, runtime);
}
/**
* @deprecated : GetAggregateDiscoveredResource is deprecated, please use Config::2020-09-07::GetAggregateDiscoveredResource instead.
* In this topic, the `new-bucket` resource in the `ca-5885626622af0008****` account group is used as an example.
*
* @param request GetAggregateDiscoveredResourceRequest
* @return GetAggregateDiscoveredResourceResponse
*/
// Deprecated
async function getAggregateDiscoveredResource(request: GetAggregateDiscoveredResourceRequest): GetAggregateDiscoveredResourceResponse {
var runtime = new Util.RuntimeOptions{};
return getAggregateDiscoveredResourceWithOptions(request, runtime);
}
model GetDiscoveredResourceCountsRequest {
groupByKey?: string(name='GroupByKey', description='The dimension by which resources are grouped. Valid values:
* ResourceType: specifies that resources are grouped by type.
* Region: specifies that resources are grouped by region.', example='ResourceType'),
memberId?: long(name='MemberId', description='This parameter has been removed from 00:00:00, June 30, 2021. Account group-related operations are provided as an alternative after 00:00:00, May 30, 2021. If you are using this parameter, we recommend that you switch to account group-related operations after 00:00:00, May 30, 2021. For more information about account groups, see [Overview](~~211534~~).', example='120886317861****'),
multiAccount?: boolean(name='MultiAccount', description='This parameter has been removed from 00:00:00, June 30, 2021. Account group-related operations are provided as an alternative after 00:00:00, May 30, 2021. If you are using this parameter, we recommend that you switch to account group-related operations after 00:00:00, May 30, 2021. For more information about account groups, see [Overview](~~211534~~).', example='true'),
}
model GetDiscoveredResourceCountsResponseBody = {
groupedResourceCounts?: {
groupByKey?: string(name='GroupByKey', description='The dimension by which resources are grouped.', example='ResourceType'),
groupedResourceCountList?: [
{
groupName?: string(name='GroupName', description='The name of the resource group.', example='ACS::ECS::SecurityGroup'),
resourceCount?: long(name='ResourceCount', description='The number of resources in the group.', example='10'),
}
](name='GroupedResourceCountList', description='The information about resources in a specific group.'),
}(name='GroupedResourceCounts', description='The returned information about resources.'),
requestId?: string(name='RequestId', description='The ID of the request.', example='54BFA4FB-6E08-4D58-9E83-1A8A3EC80247'),
}
model GetDiscoveredResourceCountsResponse = {
headers: map[string]string(name='headers'),
statusCode: int32(name='statusCode'),
body: GetDiscoveredResourceCountsResponseBody(name='body'),
}
async function getDiscoveredResourceCountsWithOptions(request: GetDiscoveredResourceCountsRequest, runtime: Util.RuntimeOptions): GetDiscoveredResourceCountsResponse {
Util.validateModel(request);
var query = {};
if (!Util.isUnset(request.groupByKey)) {
query['GroupByKey'] = request.groupByKey;
}
if (!Util.isUnset(request.memberId)) {
query['MemberId'] = request.memberId;
}
if (!Util.isUnset(request.multiAccount)) {
query['MultiAccount'] = request.multiAccount;
}
var req = new OpenApi.OpenApiRequest{
query = OpenApiUtil.query(query),
};
var params = new OpenApi.Params{
action = 'GetDiscoveredResourceCounts',
version = '2019-01-08',
protocol = 'HTTPS',
pathname = '/',
method = 'POST',
authType = 'AK',
style = 'RPC',
reqBodyType = 'formData',
bodyType = 'json',
};
return callApi(params, req, runtime);
}
async function getDiscoveredResourceCounts(request: GetDiscoveredResourceCountsRequest): GetDiscoveredResourceCountsResponse {
var runtime = new Util.RuntimeOptions{};
return getDiscoveredResourceCountsWithOptions(request, runtime);
}
model GetDiscoveredResourceSummaryRequest {
memberId?: long(name='MemberId', description='This parameter is scheduled to be removed before 00:00:00, June 30, 2021. Account group-related APIs will be provided as an alternative before 00:00:00, May 30, 2021. If you are using this parameter, we recommend that you switch to account group-related APIs after 00:00:00, May 30, 2021. For more information, see [Account groups](~~211534~~).', example='123456789'),
multiAccount?: boolean(name='MultiAccount', description='This parameter is scheduled to be removed before 00:00:00, June 30, 2021. Account group-related APIs will be provided as an alternative before 00:00:00, May 30, 2021. If you are using this parameter, we recommend that you switch to account group-related APIs after 00:00:00, May 30, 2021. For more information, see [Account groups](~~211534~~).', example='false'),
}
model GetDiscoveredResourceSummaryResponseBody = {
discoveredResourceSummary?: {
regionCount?: int32(name='RegionCount', description='The number of the regions involved in the monitoring.', example='6'),
resourceCount?: int32(name='ResourceCount', description='The number of the resources monitored by Cloud Config.', example='7'),
resourceTypeCount?: int32(name='ResourceTypeCount', description='The number of the resource types monitored by Cloud Config.', example='45'),
}(name='DiscoveredResourceSummary', description='The statistics of the resources monitored by Cloud Config.'),
requestId?: string(name='RequestId', description='The ID of the request.', example='2A8FA4FB-2E08-4D28-8F83-1A8A3EC80B1C'),
}
model GetDiscoveredResourceSummaryResponse = {
headers: map[string]string(name='headers'),
statusCode: int32(name='statusCode'),
body: GetDiscoveredResourceSummaryResponseBody(name='body'),
}
async function getDiscoveredResourceSummaryWithOptions(request: GetDiscoveredResourceSummaryRequest, runtime: Util.RuntimeOptions): GetDiscoveredResourceSummaryResponse {
Util.validateModel(request);
var query = {};
if (!Util.isUnset(request.memberId)) {
query['MemberId'] = request.memberId;
}
if (!Util.isUnset(request.multiAccount)) {
query['MultiAccount'] = request.multiAccount;
}
var req = new OpenApi.OpenApiRequest{
query = OpenApiUtil.query(query),
};
var params = new OpenApi.Params{
action = 'GetDiscoveredResourceSummary',
version = '2019-01-08',
protocol = 'HTTPS',
pathname = '/',
method = 'POST',
authType = 'AK',
style = 'RPC',
reqBodyType = 'formData',
bodyType = 'json',
};
return callApi(params, req, runtime);
}
async function getDiscoveredResourceSummary(request: GetDiscoveredResourceSummaryRequest): GetDiscoveredResourceSummaryResponse {
var runtime = new Util.RuntimeOptions{};
return getDiscoveredResourceSummaryWithOptions(request, runtime);
}
model GetResourceComplianceTimelineRequest {
endTime?: long(name='EndTime', description='The timestamp that specifies the end of the time range to query. By default, the value is the time when the GetResourceConfigurationTimeline operation is called.', example='1593599342230'),
limit?: int32(name='Limit', description='The number of entries to return on each page. Valid values: 1 to 100. Default value: 10.', example='10'),
memberId?: string(name='MemberId', description='This parameter is scheduled to be removed before 00:00:00, June 30, 2021. Account group-related APIs will be provided as an alternative before 00:00:00, May 30, 2021. If you are using this parameter, we recommend that you switch to account group-related APIs after 00:00:00, May 30, 2021. For more information, see [Account groups](~~211534~~).', example='123456789'),
multiAccount?: boolean(name='MultiAccount', description='This parameter is scheduled to be removed before 00:00:00, June 30, 2021. Account group-related APIs will be provided as an alternative before 00:00:00, May 30, 2021. If you are using this parameter, we recommend that you switch to account group-related APIs after 00:00:00, May 30, 2021. For more information, see [Account groups](~~211534~~).', example='true'),
nextToken?: string(name='NextToken', description='The token that is used to start the next query.', example='caeba0bbb2be03f84eb48b699f0a****'),
region?: string(name='Region', description='The ID of the region.', example='cn-hangzhou'),
resourceId?: string(name='ResourceId', description='The ID of the resource.', example='i-uf6072y75i2cevjq****'),
resourceType?: string(name='ResourceType', description='The type of the resource.', example='ACS::ECS::Instance'),
startTime?: long(name='StartTime', description='The timestamp that specifies the beginning of the time range to query. By default, Cloud Config retrieves the configuration changes in the last 30 days for the specified resource.', example='1593599340010'),
}
model GetResourceComplianceTimelineResponseBody = {
requestId?: string(name='RequestId', description='The ID of the request.', example='DE9FFFE5-FCAD-4B24-9546-BF49273C562B'),
resourceComplianceTimeline?: {
complianceList?: [
{
accountId?: string(name='AccountId', description='The ID of your Alibaba Cloud account.', example='120390217529****'),
availabilityZone?: string(name='AvailabilityZone', description='The ID of the zone.', example='cn-hangzhou-f'),
captureTime?: long(name='CaptureTime', description='The timestamp when the compliance evaluation occurred.', example='1203902175292305'),
configuration?: string(name='Configuration', description='The information about the rules triggered for the resource and the compliance evaluation results.', example='{\\"managetest-required-tags\\":[{},{\\"configRuleId\\":\\"cr-656d5180a8d1009c****\\",\\"configRuleArn\\":\\"acs:config::120390217529****:config-rule/cr-656d5180a8d1009c****\\",\\"configRuleName\\":\\"managetest-required-tags\\",\\"complianceType\\":\\"NON_COMPLIANT\\",\\"riskLevel\\":1,\\"annotation\\":\\"{\\\\\\"desiredValue\\\\\\":\\\\\\"key1\\\\\\",\\\\\\"reason\\\\\\":\\\\\\"No tag with name key1\\\\\\"}\\",\\"invokingEventMessageType\\":\\"ConfigurationItemChangeNotification\\"}]}'),
configurationDiff?: string(name='ConfigurationDiff', description='The information about the changes to the compliance evaluation results, including the information about the triggered rules.', example='{\\"Compliance\\":{\\"complianceType\\":\\"NON_COMPLIANT\\",\\"count\\":2},\\"ConfigRuleList\\":[{\\"configRuleId\\":\\"cr-7b6e5180a8d100cc****\\",\\"configRuleArn\\":\\"acs:config::120390217529****:config-rule/cr-7b6e5180a8d100cc****\\",\\"configRuleName\\":\\"required-tags\\",\\"complianceType\\":\\"COMPLIANT\\",\\"riskLevel\\":1,\\"invokingEventMessageType\\":\\"ConfigurationItemChangeNotification\\"}]}'),
region?: string(name='Region', description='The ID of the region.', example='cn-hangzhou'),
resourceCreateTime?: long(name='ResourceCreateTime', description='The timestamp when the resource was created.', example='1203902175293610'),
resourceId?: string(name='ResourceId', description='The ID of the resource.', example='i-uf6072y75i2cevjq****'),
resourceName?: string(name='ResourceName', description='The name of the resource.', example='test-resource'),
resourceStatus?: string(name='ResourceStatus', description='The status of the resource. The parameter value varies with the resource type and may be left empty. Examples:
* If ResourceType is set to ACS::ECS::Instance, the resource is an Elastic Compute Service (ECS) instance which has a specific state. In this case, valid values of this parameter include Running and Stopped.
* If ResourceType is set to ACS::OSS::Bucket, the resource is an Object Storage Service (OSS) bucket which does not have a specific state. In this case, this parameter is left empty.', example='Running'),
resourceType?: string(name='ResourceType', description='The type of the resource.', example='ACS::ECS::Instance'),
tags?: string(name='Tags', description='The tags of the resource.', example='{\\"project\\":[\\"efg\\"]}'),
}
](name='ComplianceList', description='The compliance evaluations in the compliance timeline.'),
limit?: int32(name='Limit', description='The number of entries returned on each page. Valid values: 1 to 100.', example='10'),
nextToken?: string(name='NextToken', description='The token that was returned for the next query.', example='caeba0bbb2be03f84eb48b699f0a****'),
totalCount?: long(name='TotalCount', description='The total number of the compliance evaluations for the specified resource.', example='100'),
}(name='ResourceComplianceTimeline', description='The information about the compliance timeline.'),
}
model GetResourceComplianceTimelineResponse = {
headers: map[string]string(name='headers'),
statusCode: int32(name='statusCode'),
body: GetResourceComplianceTimelineResponseBody(name='body'),
}
async function getResourceComplianceTimelineWithOptions(request: GetResourceComplianceTimelineRequest, runtime: Util.RuntimeOptions): GetResourceComplianceTimelineResponse {
Util.validateModel(request);
var query = {};
if (!Util.isUnset(request.endTime)) {
query['EndTime'] = request.endTime;
}
if (!Util.isUnset(request.limit)) {
query['Limit'] = request.limit;
}
if (!Util.isUnset(request.memberId)) {
query['MemberId'] = request.memberId;
}
if (!Util.isUnset(request.multiAccount)) {
query['MultiAccount'] = request.multiAccount;
}
if (!Util.isUnset(request.nextToken)) {
query['NextToken'] = request.nextToken;
}
if (!Util.isUnset(request.region)) {
query['Region'] = request.region;
}
if (!Util.isUnset(request.resourceId)) {
query['ResourceId'] = request.resourceId;
}
if (!Util.isUnset(request.resourceType)) {
query['ResourceType'] = request.resourceType;
}
if (!Util.isUnset(request.startTime)) {
query['StartTime'] = request.startTime;
}
var req = new OpenApi.OpenApiRequest{
query = OpenApiUtil.query(query),
};
var params = new OpenApi.Params{
action = 'GetResourceComplianceTimeline',
version = '2019-01-08',
protocol = 'HTTPS',
pathname = '/',
method = 'POST',
authType = 'AK',
style = 'RPC',
reqBodyType = 'formData',
bodyType = 'json',
};
return callApi(params, req, runtime);
}
async function getResourceComplianceTimeline(request: GetResourceComplianceTimelineRequest): GetResourceComplianceTimelineResponse {
var runtime = new Util.RuntimeOptions{};
return getResourceComplianceTimelineWithOptions(request, runtime);
}
model GetResourceConfigurationTimelineRequest {
endTime?: long(name='EndTime', description='The timestamp that specifies the end of the time range to query. By default, the value is the time when the GetResourceConfigurationTimeline operation is called.', example='1605489235000'),
limit?: int32(name='Limit', description='The number of entries to return on each page. Valid values: 1 to 100. Default value: 10.', example='10'),
memberId?: long(name='MemberId', description='This parameter is scheduled to be removed before 00:00:00, June 30, 2021. Account group-related APIs will be provided as an alternative before 00:00:00, May 30, 2021. If you are using this parameter, we recommend that you switch to account group-related APIs after 00:00:00, May 30, 2021. For more information, see [Account groups](~~211534~~).', example='123456789'),
multiAccount?: boolean(name='MultiAccount', description='This parameter is scheduled to be removed before 00:00:00, June 30, 2021. Account group-related APIs will be provided as an alternative before 00:00:00, May 30, 2021. If you are using this parameter, we recommend that you switch to account group-related APIs after 00:00:00, May 30, 2021. For more information, see [Account groups](~~211534~~).', example='true'),
nextToken?: string(name='NextToken', description='The token that is used to start the next query.', example='caeba0bbb2be03f84eb48b699f0a****'),
region?: string(name='Region', description='The ID of the region.', example='cn-hangzhou'),
resourceId?: string(name='ResourceId', description='The ID of the resource.', example='i-bp19xem7lt97h973****'),
resourceType?: string(name='ResourceType', description='The type of the resource.', example='ACS::ECS::Instance'),
startTime?: long(name='StartTime', description='The timestamp that specifies the beginning of the time range to query. By default, Cloud Config retrieves the configuration changes in the last 30 days for the specified resource.', example='1605489195000'),
}
model GetResourceConfigurationTimelineResponseBody = {
requestId?: string(name='RequestId', description='The ID of the request.', example='ED9CD1B3-286C-4E05-A765-5E1E0B9BC2AB'),
resourceConfigurationTimeline?: {
configurationList?: [
{
accountId?: long(name='AccountId', description='The ID of your Alibaba Cloud account.', example='987654321'),
availabilityZone?: string(name='AvailabilityZone', description='The ID of the zone.', example='cn-hangzhou-h'),
captureTime?: string(name='CaptureTime', description='The timestamp when the configuration change occurred.', example='1605316711000'),
configurationDiff?: string(name='ConfigurationDiff', description='The information of the changes to the configuration of the resource.', example='{\\"ExpiredTime\\":[\\"2020-10-26T16:00Z\\",\\"2020-11-26T16:00Z\\"]}'),
region?: string(name='Region', description='The ID of the region.', example='cn-hangzhou'),
resourceCreateTime?: string(name='ResourceCreateTime', description='The time when the resource was created.', example='1605237751000'),
resourceEventType?: string(name='ResourceEventType', description='The type of the resource change event. Valid values:
* DISCOVERED: A resource was created.
* MODIFY: A resource was modified.
* REMOVE: A resource is deleted.', example='DISCOVERED'),
resourceId?: string(name='ResourceId', description='The ID of the resource.', example='i-bp19xem7lt97h973****'),
resourceName?: string(name='ResourceName', description='The name of the resource.', example='ECS-test'),
resourceType?: string(name='ResourceType', description='The type of the resource.', example='ACS::ECS::Instance'),
tags?: string(name='Tags', description='The tags of the resource.', example='"{\\"\\"hc\\"\\":[\\"\\"value2\\"\\"]}"'),
}
](name='ConfigurationList', description='The configuration changes of the configuration timeline.'),
limit?: int32(name='Limit', description='The number of entries returned on each page. Valid values: 1 to 100.', example='10'),
nextToken?: string(name='NextToken', description='The token that was returned for the next query.', example='caeba0bbb2be03f84eb48b699f0a****'),
totalCount?: long(name='TotalCount', description='The total number of configuration changes for the specified resource.', example='100'),
}(name='ResourceConfigurationTimeline', description='The information of the configuration timeline.'),
}
model GetResourceConfigurationTimelineResponse = {
headers: map[string]string(name='headers'),
statusCode: int32(name='statusCode'),
body: GetResourceConfigurationTimelineResponseBody(name='body'),
}
async function getResourceConfigurationTimelineWithOptions(request: GetResourceConfigurationTimelineRequest, runtime: Util.RuntimeOptions): GetResourceConfigurationTimelineResponse {
Util.validateModel(request);
var query = {};
if (!Util.isUnset(request.endTime)) {
query['EndTime'] = request.endTime;
}
if (!Util.isUnset(request.limit)) {
query['Limit'] = request.limit;
}
if (!Util.isUnset(request.memberId)) {
query['MemberId'] = request.memberId;
}
if (!Util.isUnset(request.multiAccount)) {
query['MultiAccount'] = request.multiAccount;
}
if (!Util.isUnset(request.nextToken)) {
query['NextToken'] = request.nextToken;
}
if (!Util.isUnset(request.region)) {
query['Region'] = request.region;
}
if (!Util.isUnset(request.resourceId)) {
query['ResourceId'] = request.resourceId;
}
if (!Util.isUnset(request.resourceType)) {
query['ResourceType'] = request.resourceType;
}
if (!Util.isUnset(request.startTime)) {
query['StartTime'] = request.startTime;
}
var req = new OpenApi.OpenApiRequest{
query = OpenApiUtil.query(query),
};
var params = new OpenApi.Params{
action = 'GetResourceConfigurationTimeline',
version = '2019-01-08',
protocol = 'HTTPS',
pathname = '/',
method = 'POST',
authType = 'AK',
style = 'RPC',
reqBodyType = 'formData',
bodyType = 'json',
};
return callApi(params, req, runtime);
}
async function getResourceConfigurationTimeline(request: GetResourceConfigurationTimelineRequest): GetResourceConfigurationTimelineResponse {
var runtime = new Util.RuntimeOptions{};
return getResourceConfigurationTimelineWithOptions(request, runtime);
}
model GetSupportedResourceTypesResponseBody = {
requestId?: string(name='RequestId', description='The ID of the request.', example='6CE4ABA1-9A57-41A9-8EA9-E8B17D4671CD'),
resourceTypes?: [ string ](name='ResourceTypes', description='The types of resources that are supported by Cloud Config.'),
}
model GetSupportedResourceTypesResponse = {
headers: map[string]string(name='headers'),
statusCode: int32(name='statusCode'),
body: GetSupportedResourceTypesResponseBody(name='body'),
}
async function getSupportedResourceTypesWithOptions(runtime: Util.RuntimeOptions): GetSupportedResourceTypesResponse {
var req = new OpenApi.OpenApiRequest{};
var params = new OpenApi.Params{
action = 'GetSupportedResourceTypes',
version = '2019-01-08',
protocol = 'HTTPS',
pathname = '/',
method = 'POST',
authType = 'AK',
style = 'RPC',
reqBodyType = 'formData',
bodyType = 'json',
};
return callApi(params, req, runtime);
}
async function getSupportedResourceTypes(): GetSupportedResourceTypesResponse {
var runtime = new Util.RuntimeOptions{};
return getSupportedResourceTypesWithOptions(runtime);
}
model ListAggregateDiscoveredResourcesRequest {
aggregatorId?: string(name='AggregatorId', description='The ID of the account group.
For more information about how to obtain the ID of an account group, see [ListAggregators](~~255797~~).', example='ca-c560626622af0005****'),
pageNumber?: int32(name='PageNumber', description='The number of the page to return.
Pages start from page 1. Default value: 1.', example='1'),
pageSize?: int32(name='PageSize', description='The number of entries to return on each page.
Valid values: 1 to 100. A minimum of 1 entry can be returned on each page. Default value: 10.', example='10'),
regions?: string(name='Regions', description='The ID of the region in which the resource resides. Separate multiple region IDs with commas (,).
For more information about how to obtain the region ID of a resource, see [ListAggregateDiscoveredResources](~~265983~~).', example='cn-huhehaote'),
resourceDeleted?: int32(name='ResourceDeleted', description='The status of the resource. Valid values:
* 0: The resource is deleted.
* 1: The resource is retained. This is the default value.', example='1'),
resourceId?: string(name='ResourceId', description='The ID of the resource.', example='eni-hp31cqoba96jagtz****'),
resourceOwnerId?: long(name='ResourceOwnerId'),
resourceTypes?: string(name='ResourceTypes', description='The type of the resource. Separate multiple resource types with commas (,).', example='ACS::ECS::NetworkInterface'),
}
model ListAggregateDiscoveredResourcesResponseBody = {
discoveredResourceProfiles?: {
discoveredResourceProfileList?: [
{
accountId?: long(name='AccountId', description='The ID of the Alibaba Cloud account to which the resource belongs.', example='161259599160****'),
region?: string(name='Region', description='The ID of the region.', example='cn-huhehaote'),
resourceCreationTime?: long(name='ResourceCreationTime', description='The timestamp when the resource was created. Unit: milliseconds.', example='1618675206000'),
resourceDeleted?: int32(name='ResourceDeleted', description='Indicates whether the resource is deleted. Valid values:
* 0: The resource is deleted.
* 1: The resource is retained.', example='1'),
resourceId?: string(name='ResourceId', description='The ID of the resource.', example='eni-hp31cqoba96jagtz****'),
resourceName?: string(name='ResourceName', description='The name of the resource.', example='Cloud Firewall'),
resourceOwnerId?: long(name='ResourceOwnerId', description='The ID of the Alibaba Cloud account to which the resource belongs.', example='161259599160****'),
resourceStatus?: string(name='ResourceStatus', description='The status of the resource. The parameter value varies based on the resource type and may be left empty. Examples:
* If the value of the ResourceType parameter is ACS::ECS::Instance, the resource is an Elastic Compute Service (ECS) instance that has a specific state. In this case, the valid values of this parameter are Running and Stopped.
* If the value of the ResourceType parameter is ACS::OSS::Bucket, the resource is an Object Storage Service (OSS) bucket that does not have a specific state. In this case, this parameter is left empty.', example='InUse'),
resourceType?: string(name='ResourceType', description='The type of the resource.', example='ACS::ECS::NetworkInterface'),
tags?: string(name='Tags', description='The tags of the resource.', example='{\\"key1\\":[\\"value2\\"]}'),
}
](name='DiscoveredResourceProfileList', description='The information about the resource.'),
pageNumber?: int32(name='PageNumber', description='The page number of the returned page. Pages start from page 1.', example='1'),
pageSize?: int32(name='PageSize', description='The number of entries returned per page. Valid values: 1 to 100.', example='10'),
totalCount?: int32(name='TotalCount', description='The total number of resources.', example='8'),
}(name='DiscoveredResourceProfiles', description='The information about the returned resources.'),
requestId?: string(name='RequestId', description='The ID of the request.', example='C7817373-78CB-4F9A-8AFA-E7A88E9D64A2'),
}
model ListAggregateDiscoveredResourcesResponse = {
headers: map[string]string(name='headers'),
statusCode: int32(name='statusCode'),
body: ListAggregateDiscoveredResourcesResponseBody(name='body'),
}
/**
* @deprecated : ListAggregateDiscoveredResources is deprecated, please use Config::2020-09-07::ListAggregateDiscoveredResources instead.
* In this example, the `ca-c560626622af0005****` account group is used. The return result shows a total of eight resources in this sample account group.
*
* @param request ListAggregateDiscoveredResourcesRequest
* @param runtime runtime options for this request RuntimeOptions
* @return ListAggregateDiscoveredResourcesResponse
*/
// Deprecated
async function listAggregateDiscoveredResourcesWithOptions(request: ListAggregateDiscoveredResourcesRequest, runtime: Util.RuntimeOptions): ListAggregateDiscoveredResourcesResponse {
Util.validateModel(request);
var query = {};
if (!Util.isUnset(request.aggregatorId)) {
query['AggregatorId'] = request.aggregatorId;
}
if (!Util.isUnset(request.pageNumber)) {
query['PageNumber'] = request.pageNumber;
}
if (!Util.isUnset(request.pageSize)) {
query['PageSize'] = request.pageSize;
}
if (!Util.isUnset(request.regions)) {
query['Regions'] = request.regions;
}
if (!Util.isUnset(request.resourceDeleted)) {
query['ResourceDeleted'] = request.resourceDeleted;
}
if (!Util.isUnset(request.resourceId)) {
query['ResourceId'] = request.resourceId;
}
if (!Util.isUnset(request.resourceOwnerId)) {
query['ResourceOwnerId'] = request.resourceOwnerId;
}
if (!Util.isUnset(request.resourceTypes)) {
query['ResourceTypes'] = request.resourceTypes;
}
var req = new OpenApi.OpenApiRequest{
query = OpenApiUtil.query(query),
};
var params = new OpenApi.Params{
action = 'ListAggregateDiscoveredResources',
version = '2019-01-08',
protocol = 'HTTPS',
pathname = '/',
method = 'POST',
authType = 'AK',
style = 'RPC',
reqBodyType = 'formData',
bodyType = 'json',
};
return callApi(params, req, runtime);
}
/**
* @deprecated : ListAggregateDiscoveredResources is deprecated, please use Config::2020-09-07::ListAggregateDiscoveredResources instead.
* In this example, the `ca-c560626622af0005****` account group is used. The return result shows a total of eight resources in this sample account group.
*
* @param request ListAggregateDiscoveredResourcesRequest
* @return ListAggregateDiscoveredResourcesResponse
*/
// Deprecated
async function listAggregateDiscoveredResources(request: ListAggregateDiscoveredResourcesRequest): ListAggregateDiscoveredResourcesResponse {
var runtime = new Util.RuntimeOptions{};
return listAggregateDiscoveredResourcesWithOptions(request, runtime);
}
model ListConfigRulesRequest {
compliancePackId?: string(name='CompliancePackId', description='The ID of the compliance package to which the rule belongs.', example='cp-8d5c6457e0d9002a****'),
complianceType?: string(name='ComplianceType', description='The compliance evaluation result of the resources. Valid values:
* COMPLIANT: The resources are evaluated as compliant.
* NON_COMPLIANT: The resources are evaluated as non-compliant.
* NOT_APPLICABLE: The rule does not apply to the resources.
* INSUFFICIENT_DATA: The resource data is insufficient.', example='COMPLIANT'),
configRuleName?: string(name='ConfigRuleName', description='The name of the monitoring rule.', example='Best practices for OSS compliance management-OSS bucket ACL prohibits public read access'),
configRuleState?: string(name='ConfigRuleState', description='The status of the rule. Valid values:
* ACTIVE: The rule is enabled.
* EVALUATING: The rule is triggered and is being used to monitor resource configurations.
* INACTIVE: The rule is disabled.', example='ACTIVE'),
memberId?: long(name='MemberId', description='This parameter is unavailable since 00:00:00 on June 30, 2021. Account group-related operations are provided as an alternative after 00:00:00 on May 30, 2021. If you are using this parameter, we recommend that you switch to account group-related operations after 00:00:00 on May 30, 2021. For information about account groups, see [Overview](~~211534~~).', example='123456789'),
multiAccount?: boolean(name='MultiAccount', description='This parameter is unavailable since 00:00:00 on June 30, 2021. Account group-related operations are provided as an alternative after 00:00:00 on May 30, 2021. If you are using this parameter, we recommend that you switch to account group-related operations after 00:00:00 on May 30, 2021. For information about account groups, see [Overview](~~211534~~).', example='true'),
pageNumber?: int32(name='PageNumber', description='The page number of the returned page. A minimum of one entry can be returned on each page.', example='1'),
pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values: 1 to 100.', example='20'),
riskLevel?: int32(name='RiskLevel', description='The risk level of the resources that are not compliant with the rule. Valid values:
* 1: high
* 2: medium
* 3: low', example='1'),
}
model ListConfigRulesResponseBody = {
configRules?: {
configRuleList?: [
{
accountId?: long(name='AccountId', description='The ID of the Alibaba Cloud account that owns the rule.', example='987654321'),
automationType?: string(name='AutomationType', description='The type of the remediation template. The value is fixed to LC.
> LC stands for Logic Composer.', example='LC'),
compliance?: {
complianceType?: string(name='ComplianceType', description='The compliance evaluation result of the resources. Valid values:
* COMPLIANT: The resources are evaluated as compliant.
* NON_COMPLIANT: The resources are evaluated as non-compliant.
* NOT_APPLICABLE: The rule does not apply to the resources.
* INSUFFICIENT_DATA: The resource data is insufficient.', example='COMPLIANT'),
count?: int32(name='Count', description='The number of resources with the specified compliance evaluation result.', example='161'),
}(name='Compliance', description='The statistics about the compliance evaluation results based on the rule.'),
compliancePackId?: string(name='CompliancePackId', description='The ID of the compliance package to which the rule belongs.', example='cp-8d5c6457e0d9002a****'),
configRuleArn?: string(name='ConfigRuleArn', description='The ARN of the rule.', example='acs:config::120886317861****:rule/cr-8d5c6457e0d9002a****'),
configRuleId?: string(name='ConfigRuleId', description='The ID of the rule.', example='cr-8d5c6457e0d9002a****'),
configRuleName?: string(name='ConfigRuleName', description='The name of the rule.', example='Best practices for OSS compliance management-OSS bucket ACL prohibits public read access'),
configRuleState?: string(name='ConfigRuleState', description='The status of the rule. Valid values:
* ACTIVE: The rule is enabled.
* EVALUATING: The rule is triggered and is being used to monitor resource configurations.
* INACTIVE: The rule is disabled.', example='ACTIVE'),
createBy?: {
compliancePackId?: string(name='CompliancePackId', description='The ID of the compliance package.', example='cp-8d5c6457e0d9002a****'),
compliancePackName?: string(name='CompliancePackName', description='The name of the compliance package.', example='Best practices for OSS Compliance Management'),
}(name='CreateBy', description='The information about how the rule is created.'),
description?: string(name='Description', description='The description of the rule.', example='The ACL policy for OSS buckets prohibits public read access and is considered compliant'),
riskLevel?: int32(name='RiskLevel', description='The risk level of the resources that are not compliant with the rule. Valid values:
* 1: high risk level
* 2: medium risk level
* 3: low risk level', example='1'),
sourceIdentifier?: string(name='SourceIdentifier', description='The identifier of the rule.
* If the rule was created based on a managed rule, the value of this parameter is the name of the managed rule.
* If the rule is a custom rule, the value of this parameter is the Alibaba Cloud Resource Name (ARN) of the relevant function in Function Compute.', example='oss-bucket-public-read-prohibited'),
sourceOwner?: string(name='SourceOwner', description='The method that is used to create the rule. Valid values:
* CUSTOM_FC: The rule is a custom rule.
* ALIYUN: The rule is created based on a managed rule of Alibaba Cloud.', example='ALIYUN'),
tags?: [
{
key?: string(name='Key', description='The key of the tag.', example='Key1'),
value?: string(name='Value', description='The value of the tag.', example='Value1'),
}
](name='Tags', description='The tags.'),
}
](name='ConfigRuleList', description='The tag key of the ENI.'),
pageNumber?: int32(name='PageNumber', description='The page number of the returned page. A minimum of one entry can be returned on each page.', example='1'),
pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values: 1 to 100.', example='20'),
totalCount?: long(name='TotalCount', description='The total number of cluster defense rules.', example='1'),
}(name='ConfigRules', description='The rules.'),
requestId?: string(name='RequestId', description='The request ID.', example='8195B664-9565-4685-89AC-8B5F04B44B92'),
}
model ListConfigRulesResponse = {
headers: map[string]string(name='headers'),
statusCode: int32(name='statusCode'),
body: ListConfigRulesResponseBody(name='body'),
}
async function listConfigRulesWithOptions(request: ListConfigRulesRequest, runtime: Util.RuntimeOptions): ListConfigRulesResponse {
Util.validateModel(request);
var query = {};
if (!Util.isUnset(request.compliancePackId)) {
query['CompliancePackId'] = request.compliancePackId;
}
if (!Util.isUnset(request.complianceType)) {
query['ComplianceType'] = request.complianceType;
}
if (!Util.isUnset(request.configRuleName)) {
query['ConfigRuleName'] = request.configRuleName;
}
if (!Util.isUnset(request.configRuleState)) {
query['ConfigRuleState'] = request.configRuleState;
}
if (!Util.isUnset(request.memberId)) {
query['MemberId'] = request.memberId;
}
if (!Util.isUnset(request.multiAccount)) {
query['MultiAccount'] = request.multiAccount;
}
if (!Util.isUnset(request.pageNumber)) {
query['PageNumber'] = request.pageNumber;
}
if (!Util.isUnset(request.pageSize)) {
query['PageSize'] = request.pageSize;
}
if (!Util.isUnset(request.riskLevel)) {
query['RiskLevel'] = request.riskLevel;
}
var req = new OpenApi.OpenApiRequest{
query = OpenApiUtil.query(query),
};
var params = new OpenApi.Params{
action = 'ListConfigRules',
version = '2019-01-08',
protocol = 'HTTPS',
pathname = '/',
method = 'POST',
authType = 'AK',
style = 'RPC',
reqBodyType = 'formData',
bodyType = 'json',
};
return callApi(params, req, runtime);
}
async function listConfigRules(request: ListConfigRulesRequest): ListConfigRulesResponse {
var runtime = new Util.RuntimeOptions{};
return listConfigRulesWithOptions(request, runtime);
}
model ListDiscoveredResourcesRequest {
memberId?: long(name='MemberId', description='This parameter has been removed from 00:00:00, June 30, 2021. Account group-related operations are provided as an alternative after 00:00:00, May 30, 2021. If you are using this parameter, we recommend that you switch to account group-related operations after 00:00:00, May 30, 2021. For more information about account groups, see [Overview](~~211534~~).', example='120886341261****'),
multiAccount?: boolean(name='MultiAccount', description='This parameter has been removed from 00:00:00, June 30, 2021. Account group-related operations are provided as an alternative after 00:00:00, May 30, 2021. If you are using this parameter, we recommend that you switch to account group-related operations after 00:00:00, May 30, 2021. For more information about account groups, see [Overview](~~211534~~).', example='false'),
pageNumber?: int32(name='PageNumber', description='The number of the page to return. Pages start from page 1.', example='10'),
pageSize?: int32(name='PageSize', description='The number of entries to return on each page. Valid values: 1 to 100.', example='1'),
regions?: string(name='Regions', description='The ID of the region in which the resource resides. Separate multiple regions IDs with commas (,).', example='cn-huhehaote'),
resourceDeleted?: int32(name='ResourceDeleted', description='The status of the resource. Valid values:
* 0: The resource is deleted.
* 1: The resource is retained. This is the default value.', example='1'),
resourceId?: string(name='ResourceId', description='The ID of the resource.', example='eni-hp31cqoba96jagtz****'),
resourceTypes?: string(name='ResourceTypes', description='The type of the resource. Separate multiple resource types with commas (,).', example='ACS::ECS::NetworkInterface'),
}
model ListDiscoveredResourcesResponseBody = {
discoveredResourceProfiles?: {
discoveredResourceProfileList?: [
{
accountId?: long(name='AccountId', description='The ID of the Alibaba Cloud account to which the resource belongs.', example='120886317861****'),
region?: string(name='Region', description='The ID of the region.', example='cn-huhehaote'),
resourceCreationTime?: long(name='ResourceCreationTime', description='The timestamp when the resource was created.', example='1618675206000'),
resourceDeleted?: int32(name='ResourceDeleted', description='Indicates whether the resource is deleted. Valid values:
* 1: The resource is retained.
* 0: The resource is deleted.', example='1'),
resourceId?: string(name='ResourceId', description='The ID of the resource.', example='eni-hp31cqoba96jagtz****'),
resourceName?: string(name='ResourceName', description='The name of the resource.', example='Cloud Firewall'),
resourceStatus?: string(name='ResourceStatus', description='The status of the resource. The parameter value varies based on the resource type and may be left empty.
Examples:
* If the value of the ResourceType parameter is ACS::ECS::Instance, the resource is an Elastic Compute Service (ECS) instance that has a specific state. In this case, the valid values of this parameter are Running and Stopped.
* If the value of the ResourceType parameter is ACS::OSS::Bucket, the resource is an Object Storage Service (OSS) bucket that does not have a specific state. In this case, this parameter is left empty.', example='InUse'),
resourceType?: string(name='ResourceType', description='The type of the resource.', example='ACS::ECS::NetworkInterface'),
tags?: string(name='Tags', description='The tags of the resource.', example='{\\"key1\\":[\\"value2\\"]}'),
}
](name='DiscoveredResourceProfileList', description='The information about the resource.'),
pageNumber?: int32(name='PageNumber', description='The page number of the returned page. Pages start from page 1.', example='10'),
pageSize?: int32(name='PageSize', description='The number of entries returned per page. Valid values: 1 to 100.', example='1'),
totalCount?: int32(name='TotalCount', description='The total number of resources.', example='129'),
}(name='DiscoveredResourceProfiles', description='The information about the returned resources.'),
requestId?: string(name='RequestId', description='The ID of the request.', example='C7817373-78CB-4F9A-8AFA-E7A88E9D64A2'),
}
model ListDiscoveredResourcesResponse = {
headers: map[string]string(name='headers'),
statusCode: int32(name='statusCode'),
body: ListDiscoveredResourcesResponseBody(name='body'),
}
async function listDiscoveredResourcesWithOptions(request: ListDiscoveredResourcesRequest, runtime: Util.RuntimeOptions): ListDiscoveredResourcesResponse {
Util.validateModel(request);
var query = {};
if (!Util.isUnset(request.memberId)) {
query['MemberId'] = request.memberId;
}
if (!Util.isUnset(request.multiAccount)) {
query['MultiAccount'] = request.multiAccount;
}
if (!Util.isUnset(request.pageNumber)) {
query['PageNumber'] = request.pageNumber;
}
if (!Util.isUnset(request.pageSize)) {
query['PageSize'] = request.pageSize;
}
if (!Util.isUnset(request.regions)) {
query['Regions'] = request.regions;
}
if (!Util.isUnset(request.resourceDeleted)) {
query['ResourceDeleted'] = request.resourceDeleted;
}
if (!Util.isUnset(request.resourceId)) {
query['ResourceId'] = request.resourceId;
}
if (!Util.isUnset(request.resourceTypes)) {
query['ResourceTypes'] = request.resourceTypes;
}
var req = new OpenApi.OpenApiRequest{
query = OpenApiUtil.query(query),
};
var params = new OpenApi.Params{
action = 'ListDiscoveredResources',
version = '2019-01-08',
protocol = 'HTTPS',
pathname = '/',
method = 'POST',
authType = 'AK',
style = 'RPC',
reqBodyType = 'formData',
bodyType = 'json',
};
return callApi(params, req, runtime);
}
async function listDiscoveredResources(request: ListDiscoveredResourcesRequest): ListDiscoveredResourcesResponse {
var runtime = new Util.RuntimeOptions{};
return listDiscoveredResourcesWithOptions(request, runtime);
}
model ListRemediationTemplatesRequest {
managedRuleIdentifier?: string(name='ManagedRuleIdentifier', description='The identifier of the managed rule.', example='oss-bucket-public-write-prohibited'),
remediationType?: string(name='RemediationType', description='The type of the remediation template. Valid value: OOS, which stands for Operation Orchestration Service.', example='OOS'),
}
model ListRemediationTemplatesResponseBody = {
remediationTemplates?: [
{
remediationType?: string(name='RemediationType', description='The type of the remediation template. Valid value: OOS, which stands for Operation Orchestration Service.', example='OOS'),
templateDefinition?: string(name='TemplateDefinition', description='The configuration of the remediation template.'),
templateIdentifier?: string(name='TemplateIdentifier', description='The ID of the remediation template.', example='ACS-OSS-PutBucketAcl'),
templateName?: string(name='TemplateName', description='The name of the remediation template.', example='Set the ACL of an OSS bucket to private.'),
}
](name='RemediationTemplates', description='The information about the remediation template.'),
requestId?: string(name='RequestId', description='The ID of the request.', example='FC2C4750-7024-499C-A69F-763543D1CBE3'),
}
model ListRemediationTemplatesResponse = {
headers: map[string]string(name='headers'),
statusCode: int32(name='statusCode'),
body: ListRemediationTemplatesResponseBody(name='body'),
}
/**
* @deprecated : ListRemediationTemplates is deprecated, please use Config::2020-09-07::ListRemediationTemplates instead.
* In this topic, the `oss-bucket-public-write-prohibited` managed rule is used as an example. The return result shows the detailed information about the remediation template of the `OOS` type for the managed rule. OOS represents Operation Orchestration Service.
*
* @param request ListRemediationTemplatesRequest
* @param runtime runtime options for this request RuntimeOptions
* @return ListRemediationTemplatesResponse
*/
// Deprecated
async function listRemediationTemplatesWithOptions(request: ListRemediationTemplatesRequest, runtime: Util.RuntimeOptions): ListRemediationTemplatesResponse {
Util.validateModel(request);
var query = {};
if (!Util.isUnset(request.managedRuleIdentifier)) {
query['ManagedRuleIdentifier'] = request.managedRuleIdentifier;
}
if (!Util.isUnset(request.remediationType)) {
query['RemediationType'] = request.remediationType;
}
var req = new OpenApi.OpenApiRequest{
query = OpenApiUtil.query(query),
};
var params = new OpenApi.Params{
action = 'ListRemediationTemplates',
version = '2019-01-08',
protocol = 'HTTPS',
pathname = '/',
method = 'POST',
authType = 'AK',
style = 'RPC',
reqBodyType = 'formData',
bodyType = 'json',
};
return callApi(params, req, runtime);
}
/**
* @deprecated : ListRemediationTemplates is deprecated, please use Config::2020-09-07::ListRemediationTemplates instead.
* In this topic, the `oss-bucket-public-write-prohibited` managed rule is used as an example. The return result shows the detailed information about the remediation template of the `OOS` type for the managed rule. OOS represents Operation Orchestration Service.
*
* @param request ListRemediationTemplatesRequest
* @return ListRemediationTemplatesResponse
*/
// Deprecated
async function listRemediationTemplates(request: ListRemediationTemplatesRequest): ListRemediationTemplatesResponse {
var runtime = new Util.RuntimeOptions{};
return listRemediationTemplatesWithOptions(request, runtime);
}
model PutConfigRuleRequest {
clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must ensure that it is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.', example='1594295238-f9361358-5843-4294-8d30-b5183fac****'),
configRuleId?: string(name='ConfigRuleId', description='The ID of the rule.', example='cr-2a914fcf617e00c9****'),
configRuleName?: string(name='ConfigRuleName', description='The name of the rule.'),
description?: string(name='Description', description='The description of the rule.'),
inputParameters?: string(name='InputParameters', description='The settings of the input parameters for the rule.', example='{"cpuCount": "2"}'),
memberId?: long(name='MemberId', description='This parameter is scheduled to be removed before 00:00:00, June 30, 2021. Account group-related APIs will be provided as an alternative before 00:00:00, May 30, 2021. If you are using this parameter, we recommend that you switch to account group-related APIs after 00:00:00, May 30, 2021. For more information, see [Account groups](~~211534~~).', example='123456789'),
multiAccount?: boolean(name='MultiAccount', description='This parameter is scheduled to be removed before 00:00:00, June 30, 2021. Account group-related APIs will be provided as an alternative before 00:00:00, May 30, 2021. If you are using this parameter, we recommend that you switch to account group-related APIs after 00:00:00, May 30, 2021. For more information, see [Account groups](~~211534~~).', example='false'),
riskLevel?: int32(name='RiskLevel', description='The risk level of the non-compliant resource. Valid values:
* 1: high risk
* 2: medium risk
* 3: low risk', example='1'),
scopeComplianceResourceId?: string(name='ScopeComplianceResourceId', description='The ID of the resource to be evaluated.
* If you do not set this parameter, the rule evaluates resources of all the types specified by ScopeComplianceResourceTypes.
* If you specify a resource ID, the rule evaluates the resource identified by the ID.', example='vpc-6weoy5flv41pj4wvr****'),
scopeComplianceResourceTypes?: string(name='ScopeComplianceResourceTypes', description='The types of the resources to be evaluated.', example='["ACS::RDS::DBInstance"]'),
sourceDetailMessageType?: string(name='SourceDetailMessageType', description='The trigger type of the rule. Valid values:
* ConfigurationItemChangeNotification: The rule is triggered by configuration changes.
* ScheduledNotification: The rule is triggered as scheduled.', example='ConfigurationItemChangeNotification'),
sourceIdentifier?: string(name='SourceIdentifier', description='The identifier of the rule.
* For a managed rule, the value is the name of the managed rule.
* For a custom rule, the value is the Alibaba Cloud Resource Name (ARN) of the custom rule.', example='rds-cpu-min-count-limit'),
sourceMaximumExecutionFrequency?: string(name='SourceMaximumExecutionFrequency', description='The frequency at which the rule is executed. Valid values:
* One_Hour: 1 hour
* Three_Hours: 3 hours
* Six_Hours: 6 hours
* Twelve_Hours: 12 hours
* TwentyFour_Hours: 24 hours', example='Twelve_Hours'),
sourceOwner?: string(name='SourceOwner', description='Indicates whether you or Alibaba Cloud owns and manages the rule. Valid values:
* CUSTOM_FC: The rule is a custom rule that you own.
* ALIYUN: The rule is a managed rule of Alibaba Cloud.', example='ALIYUN'),
}
model PutConfigRuleResponseBody = {
configRuleId?: string(name='ConfigRuleId', description='The ID of the rule.', example='cr-76ac4fcfb57e00c9****'),
requestId?: string(name='RequestId', description='The ID of the request.', example='A7A0FFF8-0B44-40C6-8BBF-3A185EFDF3F7'),
}
model PutConfigRuleResponse = {
headers: map[string]string(name='headers'),
statusCode: int32(name='statusCode'),
body: PutConfigRuleResponseBody(name='body'),
}
/**
* @deprecated : PutConfigRule is deprecated, please use Config::2020-09-07::CreateConfigRule,Config::2020-09-07::CreateAggregateConfigRule instead.
*
* @param request PutConfigRuleRequest
* @param runtime runtime options for this request RuntimeOptions
* @return PutConfigRuleResponse
*/
// Deprecated
async function putConfigRuleWithOptions(request: PutConfigRuleRequest, runtime: Util.RuntimeOptions): PutConfigRuleResponse {
Util.validateModel(request);
var query = {};
if (!Util.isUnset(request.memberId)) {
query['MemberId'] = request.memberId;
}
if (!Util.isUnset(request.multiAccount)) {
query['MultiAccount'] = request.multiAccount;
}
var body : map[string]any = {};
if (!Util.isUnset(request.clientToken)) {
body['ClientToken'] = request.clientToken;
}
if (!Util.isUnset(request.configRuleId)) {
body['ConfigRuleId'] = request.configRuleId;
}
if (!Util.isUnset(request.configRuleName)) {
body['ConfigRuleName'] = request.configRuleName;
}
if (!Util.isUnset(request.description)) {
body['Description'] = request.description;
}
if (!Util.isUnset(request.inputParameters)) {
body['InputParameters'] = request.inputParameters;
}
if (!Util.isUnset(request.riskLevel)) {
body['RiskLevel'] = request.riskLevel;
}
if (!Util.isUnset(request.scopeComplianceResourceId)) {
body['ScopeComplianceResourceId'] = request.scopeComplianceResourceId;
}
if (!Util.isUnset(request.scopeComplianceResourceTypes)) {
body['ScopeComplianceResourceTypes'] = request.scopeComplianceResourceTypes;
}
if (!Util.isUnset(request.sourceDetailMessageType)) {
body['SourceDetailMessageType'] = request.sourceDetailMessageType;
}
if (!Util.isUnset(request.sourceIdentifier)) {
body['SourceIdentifier'] = request.sourceIdentifier;
}
if (!Util.isUnset(request.sourceMaximumExecutionFrequency)) {
body['SourceMaximumExecutionFrequency'] = request.sourceMaximumExecutionFrequency;
}
if (!Util.isUnset(request.sourceOwner)) {
body['SourceOwner'] = request.sourceOwner;
}
var req = new OpenApi.OpenApiRequest{
query = OpenApiUtil.query(query),
body = OpenApiUtil.parseToMap(body),
};
var params = new OpenApi.Params{
action = 'PutConfigRule',
version = '2019-01-08',
protocol = 'HTTPS',
pathname = '/',
method = 'POST',
authType = 'AK',
style = 'RPC',
reqBodyType = 'formData',
bodyType = 'json',
};
return callApi(params, req, runtime);
}
/**
* @deprecated : PutConfigRule is deprecated, please use Config::2020-09-07::CreateConfigRule,Config::2020-09-07::CreateAggregateConfigRule instead.
*
* @param request PutConfigRuleRequest
* @return PutConfigRuleResponse
*/
// Deprecated
async function putConfigRule(request: PutConfigRuleRequest): PutConfigRuleResponse {
var runtime = new Util.RuntimeOptions{};
return putConfigRuleWithOptions(request, runtime);
}
model PutConfigurationRecorderRequest {
resourceTypes?: string(name='ResourceTypes', description='The types of the resources that you want Cloud Config to monitor. Separate multiple resource types with commas (,).', example='ACS::ECS::Instance,ACS::ECS::Disk'),
}
model PutConfigurationRecorderResponseBody = {
configurationRecorder?: {
accountId?: long(name='AccountId', description='The ID of your Alibaba Cloud account.', example='123456789'),
configurationRecorderStatus?: string(name='ConfigurationRecorderStatus', description='The status of the configuration recorder. Valid values:
* REGISTRABLE: The configuration recorder has not been registered.
* BUILDING: The configuration recorder is being deployed.
* REGISTERED: The configuration recorder has been registered.
* REBUILDING: The configuration recorder is being redeployed.', example='REGISTERED'),
resourceTypes?: [ string ](name='ResourceTypes', description='The types of resources that are monitored by Cloud Config.'),
}(name='ConfigurationRecorder', description='The details of the configuration recorder that monitors resources.'),
requestId?: string(name='RequestId', description='The ID of the request.', example='7C189ED2-30C1-492E-82B6-0D828B556ED9'),
}
model PutConfigurationRecorderResponse = {
headers: map[string]string(name='headers'),
statusCode: int32(name='statusCode'),
body: PutConfigurationRecorderResponseBody(name='body'),
}
/**
* @deprecated : PutConfigurationRecorder is deprecated, please use Config::2020-09-07::UpdateConfigurationRecorder instead.
* This operation is valid only for the current Alibaba Cloud account. For more information, see [Alibaba Cloud services that support Cloud Config](~~127411~~).
*
* @param request PutConfigurationRecorderRequest
* @param runtime runtime options for this request RuntimeOptions
* @return PutConfigurationRecorderResponse
*/
// Deprecated
async function putConfigurationRecorderWithOptions(request: PutConfigurationRecorderRequest, runtime: Util.RuntimeOptions): PutConfigurationRecorderResponse {
Util.validateModel(request);
var body : map[string]any = {};
if (!Util.isUnset(request.resourceTypes)) {
body['ResourceTypes'] = request.resourceTypes;
}
var req = new OpenApi.OpenApiRequest{
body = OpenApiUtil.parseToMap(body),
};
var params = new OpenApi.Params{
action = 'PutConfigurationRecorder',
version = '2019-01-08',
protocol = 'HTTPS',
pathname = '/',
method = 'POST',
authType = 'AK',
style = 'RPC',
reqBodyType = 'formData',
bodyType = 'json',
};
return callApi(params, req, runtime);
}
/**
* @deprecated : PutConfigurationRecorder is deprecated, please use Config::2020-09-07::UpdateConfigurationRecorder instead.
* This operation is valid only for the current Alibaba Cloud account. For more information, see [Alibaba Cloud services that support Cloud Config](~~127411~~).
*
* @param request PutConfigurationRecorderRequest
* @return PutConfigurationRecorderResponse
*/
// Deprecated
async function putConfigurationRecorder(request: PutConfigurationRecorderRequest): PutConfigurationRecorderResponse {
var runtime = new Util.RuntimeOptions{};
return putConfigurationRecorderWithOptions(request, runtime);
}
model PutDeliveryChannelRequest {
clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate a token, but you must make sure that it is unique among different requests. The token cannot exceed 64 characters in length and can only contain ASCII characters.', example='1594295238-f9361358-5843-4294-8d30-b5183fac****'),
deliveryChannelAssumeRoleArn?: string(name='DeliveryChannelAssumeRoleArn', description='The Alibaba Cloud Resource Name (ARN) of the role to be assumed by the delivery method. This parameter is required when you create a delivery method.
> If the delivery method assumes the service linked role for Cloud Config, you can specify the ARN in the format of the provided example and replace the account ID with the ID of your Alibaba Cloud account.', example='acs:ram::100931896542****:role/aliyunserviceroleforconfig'),
deliveryChannelCondition?: string(name='DeliveryChannelCondition', description='The rule attached to the delivery method. This parameter is applicable only to delivery methods of the MNS type.
This parameter allows you to specify the lowest risk level for the events to subscribe to and the resource types for which you want to subscribe to events.
* To specify the lowest risk level for the events to subscribe to, use the following format:`{"filterType":"RuleRiskLevel","value":"1","multiple":false}.`
The value field indicates the lowest risk level and can be set to 1, 2, or 3, which indicates the high risk level, the medium risk level, and the low risk level, respectively.
* To specify the resource types for which you want to subscribe to events, use the following format:`{"filterType":"ResourceType","values":["ACS::ACK::Cluster","ACS::ActionTrail::Trail","ACS::CBWP::CommonBandwidthPackage"],"multiple":true}.`
The values field indicates the resource types. Its value is a JSON array.
Example: `[{"filterType":"ResourceType","values":["ACS::ActionTrail::Trail","ACS::CBWP::CommonBandwidthPackage","ACS::CDN::Domain","ACS::CEN::CenBandwidthPackage","ACS::CEN::CenInstance","ACS::CEN::Flowlog","ACS::DdosCoo::Instance"],"multiple":true}]`', example='[{"filterType":"ResourceType","values":["ACS::ActionTrail::Trail","ACS::CBWP::CommonBandwidthPackage","ACS::CDN::Domain","ACS::CEN::CenBandwidthPackage","ACS::CEN::CenInstance","ACS::CEN::Flowlog","ACS::DdosCoo::Instance"],"multiple":true}]'),
deliveryChannelId?: string(name='DeliveryChannelId', description='The ID of the delivery method. This parameter is required when you modify a delivery method.', example='cdc-193f6457e0d90080****'),
deliveryChannelName?: string(name='DeliveryChannelName', description='The name of the delivery method.', example='testoss'),
deliveryChannelTargetArn?: string(name='DeliveryChannelTargetArn', description='The ARN of the delivery destination. This parameter is required when you create a delivery method. The value must be in one of the following formats:
* `acs:oss:{RegionId}:{Aliuid}:{bucketName}` if your delivery destination is an Object Storage Service (OSS) bucket.
* `acs:mns:{RegionId}:{Aliuid}:/topics/{topicName}` if your delivery destination is a Message Service (MNS) topic.
* `acs:log:{RegionId}:{Aliuid}:project/{projectName}/logstore/{logstoreName}` if your delivery destination is a Log Service Logstore.', example='acs:oss:cn-hangzhou:100931896542****:20171130--1'),
deliveryChannelType?: string(name='DeliveryChannelType', description='The type of the delivery method. This parameter is required when you create a delivery method. Valid values:
* OSS
* MNS
* SLS', example='OSS'),
description?: string(name='Description', description='The description of the delivery method.', example='My OSS delivery.'),
status?: int32(name='Status', description='The status of the delivery method. Valid values:
* 0: The delivery method is disabled.
* 1: The delivery destination is enabled. This is the default value.', example='1'),
}
model PutDeliveryChannelResponseBody = {
deliveryChannelId?: string(name='DeliveryChannelId', description='The ID of the delivery method that you created or the updated ID of the delivery method that you modified.', example='cdc-ee0f626622af0069****'),
requestId?: string(name='RequestId', description='The ID of the request.', example='0D6B9E0A-AD53-4732-922B-0F584ECA5FAB'),
}
model PutDeliveryChannelResponse = {
headers: map[string]string(name='headers'),
statusCode: int32(name='statusCode'),
body: PutDeliveryChannelResponseBody(name='body'),
}
/**
* @deprecated : PutDeliveryChannel is deprecated, please use Config::2020-09-07::CreateConfigDeliveryChannel,Config::2020-09-07::CreateAggregateConfigDeliveryChannel instead.
* ****
*
* @param request PutDeliveryChannelRequest
* @param runtime runtime options for this request RuntimeOptions
* @return PutDeliveryChannelResponse
*/
// Deprecated
async function putDeliveryChannelWithOptions(request: PutDeliveryChannelRequest, runtime: Util.RuntimeOptions): PutDeliveryChannelResponse {
Util.validateModel(request);
var body : map[string]any = {};
if (!Util.isUnset(request.clientToken)) {
body['ClientToken'] = request.clientToken;
}
if (!Util.isUnset(request.deliveryChannelAssumeRoleArn)) {
body['DeliveryChannelAssumeRoleArn'] = request.deliveryChannelAssumeRoleArn;
}
if (!Util.isUnset(request.deliveryChannelCondition)) {
body['DeliveryChannelCondition'] = request.deliveryChannelCondition;
}
if (!Util.isUnset(request.deliveryChannelId)) {
body['DeliveryChannelId'] = request.deliveryChannelId;
}
if (!Util.isUnset(request.deliveryChannelName)) {
body['DeliveryChannelName'] = request.deliveryChannelName;
}
if (!Util.isUnset(request.deliveryChannelTargetArn)) {
body['DeliveryChannelTargetArn'] = request.deliveryChannelTargetArn;
}
if (!Util.isUnset(request.deliveryChannelType)) {
body['DeliveryChannelType'] = request.deliveryChannelType;
}
if (!Util.isUnset(request.description)) {
body['Description'] = request.description;
}
if (!Util.isUnset(request.status)) {
body['Status'] = request.status;
}
var req = new OpenApi.OpenApiRequest{
body = OpenApiUtil.parseToMap(body),
};
var params = new OpenApi.Params{
action = 'PutDeliveryChannel',
version = '2019-01-08',
protocol = 'HTTPS',
pathname = '/',
method = 'POST',
authType = 'AK',
style = 'RPC',
reqBodyType = 'formData',
bodyType = 'json',
};
return callApi(params, req, runtime);
}
/**
* @deprecated : PutDeliveryChannel is deprecated, please use Config::2020-09-07::CreateConfigDeliveryChannel,Config::2020-09-07::CreateAggregateConfigDeliveryChannel instead.
* ****
*
* @param request PutDeliveryChannelRequest
* @return PutDeliveryChannelResponse
*/
// Deprecated
async function putDeliveryChannel(request: PutDeliveryChannelRequest): PutDeliveryChannelResponse {
var runtime = new Util.RuntimeOptions{};
return putDeliveryChannelWithOptions(request, runtime);
}
model PutEvaluationsRequest {
evaluations?: string(name='Evaluations', description='The compliance evaluation results.', example='[{"annotation":"Resource type is ACS::CEN::Flowlog, not in ACS::ECS::Instance,ACS::ECS::NetworkInterface.","complianceResourceId":"flowlog-o6wdfo1yvgo4i8****","complianceResourceType":"ACS::CEN::Flowlog","complianceType":"NOT_APPLICABLE","orderingTimestamp":1588907220408}]'),
resultToken?: string(name='ResultToken', description='The token used to return the response.', example='=lAUbfkWp7GL9AFoQEIStinqBMc4FC8sHvip/1F1npkWUDNS2GEm6xwL6Zl/fSr0bbkWY+aiCLjTJxnp4H/yp/8p/Q8VCAtqG5uhRii4sfnYRnTPnE****'),
}
model PutEvaluationsResponseBody = {
requestId?: string(name='RequestId', description='The ID of the request.', example='A7A0FFF8-0B44-40C6-8BBF-3A185EFDF3F7'),
result?: boolean(name='Result', description='Indicates whether the operation was successful. Valid values:
* true: The operation was successful.
* false: The operation failed.', example='true'),
}
model PutEvaluationsResponse = {
headers: map[string]string(name='headers'),
statusCode: int32(name='statusCode'),
body: PutEvaluationsResponseBody(name='body'),
}
/**
* @deprecated : PutEvaluations is deprecated, please use Config::2020-09-07::PutEvaluations instead.
* ****
*
* @param request PutEvaluationsRequest
* @param runtime runtime options for this request RuntimeOptions
* @return PutEvaluationsResponse
*/
// Deprecated
async function putEvaluationsWithOptions(request: PutEvaluationsRequest, runtime: Util.RuntimeOptions): PutEvaluationsResponse {
Util.validateModel(request);
var body : map[string]any = {};
if (!Util.isUnset(request.evaluations)) {
body['Evaluations'] = request.evaluations;
}
if (!Util.isUnset(request.resultToken)) {
body['ResultToken'] = request.resultToken;
}
var req = new OpenApi.OpenApiRequest{
body = OpenApiUtil.parseToMap(body),
};
var params = new OpenApi.Params{
action = 'PutEvaluations',
version = '2019-01-08',
protocol = 'HTTPS',
pathname = '/',
method = 'POST',
authType = 'AK',
style = 'RPC',
reqBodyType = 'formData',
bodyType = 'json',
};
return callApi(params, req, runtime);
}
/**
* @deprecated : PutEvaluations is deprecated, please use Config::2020-09-07::PutEvaluations instead.
* ****
*
* @param request PutEvaluationsRequest
* @return PutEvaluationsResponse
*/
// Deprecated
async function putEvaluations(request: PutEvaluationsRequest): PutEvaluationsResponse {
var runtime = new Util.RuntimeOptions{};
return putEvaluationsWithOptions(request, runtime);
}
model StartConfigRuleEvaluationRequest {
compliancePackId?: string(name='CompliancePackId', description='The ID of the compliance package.
For more information about how to obtain the ID of a compliance package, see [ListCompliancePacks](~~263332~~).
> You must set one of the `CompliancePackId` and `ConfigRuleId` parameters.', example='cp-ac16626622af0053****'),
configRuleId?: string(name='ConfigRuleId', description='The ID of the rule.
For more information about how to obtain the ID of a rule, see [ListConfigRules](~~169607~~).', example='cr-bdb6626622af0012****'),
revertEvaluation?: boolean(name='RevertEvaluation', description='Specifies whether to reevaluate a non-compliant resource that is ignored. Valid values:
* true: reevaluates a non-compliant resource that is ignored.
* false: continues to ignore a non-compliant resource.', example='false'),
}
model StartConfigRuleEvaluationResponseBody = {
requestId?: string(name='RequestId', description='The ID of the request.', example='C32EEAD7-BF64-5927-977A-AFF9342B7275'),
result?: boolean(name='Result', description='Indicates whether the operation is successful. Valid values:
* true: The operation is successful.
* false: The operation fails.', example='true'),
}
model StartConfigRuleEvaluationResponse = {
headers: map[string]string(name='headers'),
statusCode: int32(name='statusCode'),
body: StartConfigRuleEvaluationResponseBody(name='body'),
}
/**
* > After you call this operation, the compliance evaluation is performed only once. To query the compliance evaluation results returned by the specified rule or compliance package, call the ListConfigRuleEvaluationResults operation. For more information, see [ListConfigRuleEvaluationResults](~~267503~~).
* In this example, the `cr-bdb6626622af0012****` rule is used.
*
* @param request StartConfigRuleEvaluationRequest
* @param runtime runtime options for this request RuntimeOptions
* @return StartConfigRuleEvaluationResponse
*/
async function startConfigRuleEvaluationWithOptions(request: StartConfigRuleEvaluationRequest, runtime: Util.RuntimeOptions): StartConfigRuleEvaluationResponse {
Util.validateModel(request);
var query = {};
if (!Util.isUnset(request.compliancePackId)) {
query['CompliancePackId'] = request.compliancePackId;
}
if (!Util.isUnset(request.configRuleId)) {
query['ConfigRuleId'] = request.configRuleId;
}
if (!Util.isUnset(request.revertEvaluation)) {
query['RevertEvaluation'] = request.revertEvaluation;
}
var req = new OpenApi.OpenApiRequest{
query = OpenApiUtil.query(query),
};
var params = new OpenApi.Params{
action = 'StartConfigRuleEvaluation',
version = '2019-01-08',
protocol = 'HTTPS',
pathname = '/',
method = 'POST',
authType = 'AK',
style = 'RPC',
reqBodyType = 'formData',
bodyType = 'json',
};
return callApi(params, req, runtime);
}
/**
* > After you call this operation, the compliance evaluation is performed only once. To query the compliance evaluation results returned by the specified rule or compliance package, call the ListConfigRuleEvaluationResults operation. For more information, see [ListConfigRuleEvaluationResults](~~267503~~).
* In this example, the `cr-bdb6626622af0012****` rule is used.
*
* @param request StartConfigRuleEvaluationRequest
* @return StartConfigRuleEvaluationResponse
*/
async function startConfigRuleEvaluation(request: StartConfigRuleEvaluationRequest): StartConfigRuleEvaluationResponse {
var runtime = new Util.RuntimeOptions{};
return startConfigRuleEvaluationWithOptions(request, runtime);
}
model StartConfigurationRecorderRequest {
enterpriseEdition?: boolean(name='EnterpriseEdition', description='Specifies whether to upgrade Cloud Config for Enterprise. Default value: false. Valid values:
* true
* false
> Cloud Config for Enterprise is upgraded to the account group feature. For more information, see [Announcement: Enterprise Edition Cloud Config Upgrade to Account Group](~~213433~~).', example='false'),
}
model StartConfigurationRecorderResponseBody = {
configurationRecorder?: {
accountId?: long(name='AccountId', description='The ID of your Alibaba Cloud account.
> This parameter is returned only when the operation was called by an ordinary account.', example='123456789'),
configurationRecorderStatus?: string(name='ConfigurationRecorderStatus', description='The status of the configuration recorder. Valid values:
* REGISTRABLE: The configuration recorder has not been registered.
* BUILDING: The configuration recorder is being deployed.
* REGISTERED: The configuration recorder has been registered.
* REBUILDING: The configuration recorder is being redeployed.', example='REGISTRABLE'),
organizationEnableStatus?: string(name='OrganizationEnableStatus', description='The upgrade status of Cloud Config for Enterprise. Valid values:
* REGISTRABLE: Cloud Config for Enterprise is not upgraded.
* BUILDING: Cloud Config for Enterprise is being upgraded.
* REGISTERED: Cloud Config for Enterprise is upgraded.', example='REGISTRABLE'),
organizationMasterId?: long(name='OrganizationMasterId', description='The ID of the management account.
> This parameter is returned only when the operation was called by a management account.', example='987654321'),
resourceTypes?: [ string ](name='ResourceTypes', description='The types of resources that are monitored by Cloud Config.
> By default, Cloud Config returns all resource types. In the following sample responses, `ACS::ECS::Instance` and `ACS::ECS::NetworkInterface` are returned.'),
}(name='ConfigurationRecorder', description='The details of the configuration recorder that monitors resources.'),
requestId?: string(name='RequestId', description='The ID of the request.', example='A3601178-A6A2-4636-BE56-1116F73C0B0C'),
}
model StartConfigurationRecorderResponse = {
headers: map[string]string(name='headers'),
statusCode: int32(name='statusCode'),
body: StartConfigurationRecorderResponseBody(name='body'),
}
/**
* Ordinary accounts and management accounts have the following differences when you use them to call the StartConfigurationRecorder operation:
* * If you are using an ordinary account, you can call the StartConfigurationRecorder operation to activate Cloud Config for the current account. You can also view the resources of the current account and manage the compliance rules of the current account.
* * If you are using the management account of a resource directory and set the `EnterpriseEdition` parameter to `true`, you can activate Cloud Config for all member accounts. In addition, a global account group that includes all member accounts is created by default. You can view the resources of all member accounts in the account group and manage the compliance rules of all member accounts.
* In this topic, an ordinary account is used as an example to show how to activate Cloud Config and monitor the resources of the current account.
*
* @param request StartConfigurationRecorderRequest
* @param runtime runtime options for this request RuntimeOptions
* @return StartConfigurationRecorderResponse
*/
async function startConfigurationRecorderWithOptions(request: StartConfigurationRecorderRequest, runtime: Util.RuntimeOptions): StartConfigurationRecorderResponse {
Util.validateModel(request);
var body : map[string]any = {};
if (!Util.isUnset(request.enterpriseEdition)) {
body['EnterpriseEdition'] = request.enterpriseEdition;
}
var req = new OpenApi.OpenApiRequest{
body = OpenApiUtil.parseToMap(body),
};
var params = new OpenApi.Params{
action = 'StartConfigurationRecorder',
version = '2019-01-08',
protocol = 'HTTPS',
pathname = '/',
method = 'POST',
authType = 'AK',
style = 'RPC',
reqBodyType = 'formData',
bodyType = 'json',
};
return callApi(params, req, runtime);
}
/**
* Ordinary accounts and management accounts have the following differences when you use them to call the StartConfigurationRecorder operation:
* * If you are using an ordinary account, you can call the StartConfigurationRecorder operation to activate Cloud Config for the current account. You can also view the resources of the current account and manage the compliance rules of the current account.
* * If you are using the management account of a resource directory and set the `EnterpriseEdition` parameter to `true`, you can activate Cloud Config for all member accounts. In addition, a global account group that includes all member accounts is created by default. You can view the resources of all member accounts in the account group and manage the compliance rules of all member accounts.
* In this topic, an ordinary account is used as an example to show how to activate Cloud Config and monitor the resources of the current account.
*
* @param request StartConfigurationRecorderRequest
* @return StartConfigurationRecorderResponse
*/
async function startConfigurationRecorder(request: StartConfigurationRecorderRequest): StartConfigurationRecorderResponse {
var runtime = new Util.RuntimeOptions{};
return startConfigurationRecorderWithOptions(request, runtime);
}
model StopConfigRulesRequest {
configRuleIds?: string(name='ConfigRuleIds', description='The IDs of the rules. Separate multiple rule IDs with commas (,). You can specify a maximum of 20 rule IDs at a time.', example='cr-2da35180a8d1008e****,cr-2da35180a8d1008e****'),
}
model StopConfigRulesResponseBody = {
operateRuleResult?: {
operateRuleItemList?: [
{
configRuleId?: string(name='ConfigRuleId', description='The ID of the rule.', example='cr-2da35180a8d1008e****'),
errorCode?: string(name='ErrorCode', description='The error code.
* If the rule is disabled, no error code is returned.
* If you fail to disable the rule, an error code is returned. For more information, visit the [API Error Center](https://error-center.alibabacloud.com/status/product/Config).', example='ConfigRuleStatusNotActive'),
success?: boolean(name='Success', description='Indicates whether the rule is disabled. Valid values:
* true
* false', example='false'),
}
](name='OperateRuleItemList', description='The result information about each rule.'),
}(name='OperateRuleResult', description='The result information about the operation.'),
requestId?: string(name='RequestId', description='The ID of the request.', example='49C1A88F-D163-46DF-84A6-F300229F37AE'),
}
model StopConfigRulesResponse = {
headers: map[string]string(name='headers'),
statusCode: int32(name='statusCode'),
body: StopConfigRulesResponseBody(name='body'),
}
async function stopConfigRulesWithOptions(request: StopConfigRulesRequest, runtime: Util.RuntimeOptions): StopConfigRulesResponse {
Util.validateModel(request);
var query = {};
if (!Util.isUnset(request.configRuleIds)) {
query['ConfigRuleIds'] = request.configRuleIds;
}
var req = new OpenApi.OpenApiRequest{
query = OpenApiUtil.query(query),
};
var params = new OpenApi.Params{
action = 'StopConfigRules',
version = '2019-01-08',
protocol = 'HTTPS',
pathname = '/',
method = 'POST',
authType = 'AK',
style = 'RPC',
reqBodyType = 'formData',
bodyType = 'json',
};
return callApi(params, req, runtime);
}
async function stopConfigRules(request: StopConfigRulesRequest): StopConfigRulesResponse {
var runtime = new Util.RuntimeOptions{};
return stopConfigRulesWithOptions(request, runtime);
}