cms-20240330/v2/main.tea (1,767 lines of code) (raw):

/** * */ import OpenApi; import OpenApi.OpenApiUtil; extends OpenApi; init(config: OpenApiUtil.Config){ super(config); @endpointRule = ''; checkConfig(config); @endpoint = getEndpoint('cms', @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 (!$isNull(endpoint)) { return endpoint; } if (!$isNull(endpointMap) && !$isNull(endpointMap[regionId])) { return endpointMap[regionId]; } return OpenApiUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix); } model AddonMeta { alias?: string(name='alias'), categories?: [ string ](name='categories'), dashboards?: [ { description?: string(name='description'), name?: string(name='name'), url?: string(name='url'), } ](name='dashboards'), description?: string(name='description'), environments?: [ { dependencies?: { clusterTypes?: [ string ](name='clusterTypes'), features?: map[string]boolean(name='features'), services?: [ string ](name='services'), }(name='dependencies'), description?: string(name='description'), enable?: boolean(name='enable'), label?: string(name='label'), name?: string(name='name'), policies?: { alertDefaultStatus?: string(name='alertDefaultStatus'), bindDefaultPolicy?: boolean(name='bindDefaultPolicy'), bindEntity?: { entityGroupMode?: boolean(name='entityGroupMode'), entityType?: string(name='entityType'), singleEntityMode?: boolean(name='singleEntityMode'), vpcIdFieldKey?: string(name='vpcIdFieldKey'), }(name='bindEntity'), defaultInstall?: boolean(name='defaultInstall'), enableServiceAccount?: boolean(name='enableServiceAccount'), metricCheckRule?: { promQL?: [ string ](name='promQL'), }(name='metricCheckRule'), needRestartAfterIntegration?: boolean(name='needRestartAfterIntegration'), protocols?: [ { description?: string(name='description'), icon?: string(name='icon'), label?: string(name='label'), name?: string(name='name'), } ](name='protocols'), targetAddonName?: string(name='targetAddonName'), }(name='policies'), policyType?: string(name='policyType'), } ](name='environments'), icon?: string(name='icon'), keywords?: [ string ](name='keywords'), language?: string(name='language'), latestReleaseCreateTime?: string(name='latestReleaseCreateTime'), name?: string(name='name'), once?: boolean(name='once'), scene?: string(name='scene'), version?: string(name='version'), weight?: int32(name='weight'), } model AlertEventIntegrationPolicyForModify { alertEventIntegrationPolicyName?: string(name='alertEventIntegrationPolicyName', description='This parameter is required.'), description?: string(name='description'), filterSetting?: FilterSetting(name='filterSetting'), integrationSetting?: string(name='integrationSetting'), transformerSetting?: [ TransformAction ](name='transformerSetting'), type?: string(name='type'), } model AlertEventIntegrationPolicyForView { alertEventIntegrationPolicyId?: string(name='alertEventIntegrationPolicyId'), alertEventIntegrationPolicyName?: string(name='alertEventIntegrationPolicyName', description='This parameter is required.'), createTime?: string(name='createTime'), description?: string(name='description'), enable?: boolean(name='enable'), filterSetting?: FilterSetting(name='filterSetting'), integrationSetting?: string(name='integrationSetting'), token?: string(name='token'), transformerSetting?: [ TransformAction ](name='transformerSetting'), type?: string(name='type'), updateTime?: string(name='updateTime'), userId?: string(name='userId'), workspace?: string(name='workspace'), } model AlertRuleAction { actions?: [ string ](name='actions'), } model AlertRuleAlertMetricFilterDef { dim?: string(name='dim'), dimDisabled?: boolean(name='dimDisabled'), displayNameCn?: string(name='displayNameCn'), displayNameEn?: string(name='displayNameEn'), hidden?: boolean(name='hidden'), labelDisabled?: boolean(name='labelDisabled'), opt?: string(name='opt'), supportedOpts?: [ { displayNameCn?: string(name='displayNameCn'), displayNameEn?: string(name='displayNameEn'), value?: string(name='value'), } ](name='supportedOpts'), } model AlertRuleAlertMetricInput { filterValues?: [ AlertRuleAlertMetricInputFilterValue ](name='filterValues'), groupId?: string(name='groupId'), metricId?: string(name='metricId'), paramValues?: [ AlertRuleAlertMetricInputParamValue ](name='paramValues'), } model AlertRuleAlertMetricInputFilterValue { dim?: string(name='dim', description='This parameter is required.'), opt?: string(name='opt', description='This parameter is required.'), value?: string(name='value'), } model AlertRuleAlertMetricInputParamValue { name?: string(name='name', description='This parameter is required.'), value?: string(name='value', description='This parameter is required.'), } model AlertRuleAlertMetricParamDef { maxWidth?: int32(name='maxWidth'), minWidth?: int32(name='minWidth'), name?: string(name='name'), placeholderCn?: string(name='placeholderCn'), placeholderEn?: string(name='placeholderEn'), type?: string(name='type'), value?: string(name='value'), values?: [ { labelCn?: string(name='labelCn'), labelEn?: string(name='labelEn'), value?: string(name='value'), } ](name='values'), } model AlertRuleCondition { alertCount?: int32(name='alertCount', description='type=SLS_CONDITION时指定,满足条件几次后告警,默认为1'), caseList?: [ { condition?: string(name='condition'), countCondition?: string(name='countCondition'), level?: string(name='level'), type?: string(name='type'), } ](name='caseList', description='type=SLS_CONDITION时指定'), compareList?: [ { aggregate?: string(name='aggregate'), oper?: string(name='oper'), value?: double(name='value'), valueLevelList?: [ { level?: string(name='level'), value?: double(name='value'), } ](name='valueLevelList'), yoyTimeUnit?: string(name='yoyTimeUnit'), yoyTimeValue?: int32(name='yoyTimeValue'), } ](name='compareList'), noDataAppendValue?: string(name='noDataAppendValue'), nodataAlertLevel?: string(name='nodataAlertLevel', description='无数据时按什么级别告警,不指定则不对无数据报警'), relation?: string(name='relation'), type?: string(name='type', description='规则条件类型,可选值:SLS_CONDITION This parameter is required.'), } model AlertRuleDataSource { appType?: string(name='appType'), dsList?: [ { project?: string(name='project'), regionId?: string(name='regionId'), store?: string(name='store'), type?: string(name='type'), } ](name='dsList'), instanceId?: string(name='instanceId', description='实例id,当type=PROMETHEUS_DS/ENTERPRISE_DS时必填,为prometheus实例的clusterId或指标仓库名称'), namespace?: string(name='namespace'), regionId?: string(name='regionId'), type?: string(name='type', description='数据源类型 This parameter is required.'), } model AlertRuleLabelFilter { labels?: map[string]string(name='labels'), opt?: string(name='opt'), } model AlertRuleNotification { contacts?: [ string ](name='contacts'), customWebhooks?: [ string ](name='customWebhooks'), dingWebhooks?: [ string ](name='dingWebhooks'), fsWebhooks?: [ string ](name='fsWebhooks'), groups?: [ string ](name='groups'), notifyTime?: AlertRuleTimeSpan(name='notifyTime'), silenceTime?: long(name='silenceTime'), slackWebhooks?: [ string ](name='slackWebhooks'), wxWebhooks?: [ string ](name='wxWebhooks'), } model AlertRuleNotificationFilter { contacts?: [ string ](name='contacts'), customWebhooks?: [ string ](name='customWebhooks'), dingWebhooks?: [ string ](name='dingWebhooks'), fsWebhooks?: [ string ](name='fsWebhooks'), groups?: [ string ](name='groups'), slackWebhooks?: [ string ](name='slackWebhooks'), wxWebhooks?: [ string ](name='wxWebhooks'), } model AlertRuleQuery { checkAfterDataComplete?: boolean(name='checkAfterDataComplete'), duration?: long(name='duration'), expr?: string(name='expr'), firstJoin?: AlertRuleSlsQueryJoin(name='firstJoin'), groupFieldList?: [ string ](name='groupFieldList'), groupType?: string(name='groupType'), queries?: [ { apmAlertMetricId?: string(name='apmAlertMetricId'), apmFilters?: [ { dim?: string(name='dim'), type?: string(name='type'), value?: string(name='value'), } ](name='apmFilters'), apmGroupBy?: [ string ](name='apmGroupBy'), duration?: long(name='duration'), end?: long(name='end', description='时间偏移结束时间(相对),如果指定了start、end,则不指定window。'), expr?: string(name='expr', description='查询表达式'), start?: long(name='start', description='sls查询的时间偏移开始时间(相对),如果指定了start、end,则不指定window。 例如:start=15, timeUnit=minute,表示15分钟前'), timeUnit?: string(name='timeUnit', description='start和end、window的时间单位: day/hour/minute/second'), window?: long(name='window', description='整点时间查询区间。 如果指定了window则不指定start、end'), } ](name='queries'), secondJoin?: AlertRuleSlsQueryJoin(name='secondJoin'), type?: string(name='type', description='查询类型 This parameter is required.'), } model AlertRuleSend { action?: AlertRuleAction(name='action'), notification?: AlertRuleNotification(name='notification'), } model AlertRuleSlsQueryJoin { conditions?: [ { firstField?: string(name='firstField', description='条件的左操作参数,格式为$<query_idx>.<结果集字段名>'), oper?: string(name='oper', description='<, >, ==, !=, <=, >='), secondField?: string(name='secondField', description='条件的右操作参数,格式为$<query_idx>.<结果集字段名>'), } ](name='conditions'), type?: string(name='type', description='集合操作类型。 ● CrossJoin: 笛卡尔积 ● FullJoin:全联 ● InnerJoin:内联 ● LeftExclude: 左斥 ● RightExclude:右斥 ● LeftJoin:左联 ● RightJoin:右联 ● NoJoin:不合并 ● Concat: 拼接 https://help.aliyun.com/zh/sls/user-guide/set-query-statistics-statement This parameter is required.'), } model AlertRuleTimeSpan { dayOfWeek?: [ int32 ](name='dayOfWeek'), endTime?: string(name='endTime'), gmtOffset?: string(name='gmtOffset'), startTime?: string(name='startTime'), } model BizTraceConfig { advancedConfig?: string(name='advancedConfig'), bizTraceCode?: string(name='bizTraceCode'), bizTraceId?: string(name='bizTraceId'), bizTraceName?: string(name='bizTraceName'), createTime?: string(name='createTime'), regionId?: string(name='regionId'), ruleConfig?: string(name='ruleConfig'), workspace?: string(name='workspace'), } model DataStorageItem { dataType?: string(name='dataType'), project?: string(name='project'), regionId?: string(name='regionId'), storeName?: string(name='storeName'), storeType?: string(name='storeType'), } model FilterSetting { conditions?: [ { field?: string(name='field'), op?: string(name='op'), value?: string(name='value'), } ](name='conditions'), expression?: string(name='expression'), relation?: string(name='relation'), } model IncidentContactStruct { channel?: [ string ](name='channel'), contactId?: string(name='contactId'), contactType?: string(name='contactType'), } model IncidentEscalationStageStruct { contact?: [ IncidentContactStruct ](name='contact'), cycleNotifyCount?: int32(name='cycleNotifyCount'), cycleNotifyTime?: int32(name='cycleNotifyTime'), description?: string(name='description'), effectTime?: string(name='effectTime'), name?: string(name='name'), stageIndex?: int32(name='stageIndex'), timeZone?: string(name='timeZone'), waitToNextStageTime?: int32(name='waitToNextStageTime'), } model IncidentEscalationStruct { createTime?: long(name='createTime'), description?: string(name='description'), incidentEscalationId?: string(name='incidentEscalationId'), modifyTime?: long(name='modifyTime'), name?: string(name='name'), regionId?: string(name='regionId'), stage?: [ IncidentEscalationStageStruct ](name='stage'), workspace?: string(name='workspace'), } model IncidentEventStruct { autoRecoverTime?: long(name='autoRecoverTime'), content?: string(name='content'), count?: int32(name='count'), dimension?: map[string]string(name='dimension'), groupBy?: map[string]string(name='groupBy'), incidentEventId?: string(name='incidentEventId'), incidentId?: string(name='incidentId'), lastTime?: long(name='lastTime'), recoverTime?: long(name='recoverTime'), resource?: map[string]string(name='resource'), status?: long(name='status'), time?: string(name='time'), title?: string(name='title'), userId?: string(name='userId'), } model IncidentMemberStruct { acknowledge?: { breakLevel?: string(name='breakLevel'), verifyTime?: long(name='verifyTime'), }(name='acknowledge'), contactId?: string(name='contactId'), contacts?: [ { channel?: string(name='channel'), contactMask?: string(name='contactMask'), } ](name='contacts'), escalation?: { description?: string(name='description'), incidentEscalationId?: string(name='incidentEscalationId'), name?: string(name='name'), stageIndex?: string(name='stageIndex'), title?: string(name='title'), }(name='escalation'), incidentId?: string(name='incidentId'), incidentMemberId?: string(name='incidentMemberId'), scheduleGroup?: { contactId?: string(name='contactId'), name?: string(name='name'), }(name='scheduleGroup'), time?: long(name='time'), userId?: long(name='userId'), } model IncidentNoteStruct { content?: string(name='content'), format?: string(name='format'), incidentId?: string(name='incidentId'), noteId?: string(name='noteId'), operator?: { contact?: string(name='contact'), contactId?: string(name='contactId'), name?: string(name='name'), userId?: long(name='userId'), }(name='operator'), time?: long(name='time'), type?: string(name='type'), } model IncidentPlanCorporationStruct { channel?: string(name='channel'), robotId?: string(name='robotId'), } model IncidentPlanFieldPath { fieldAlias?: string(name='fieldAlias'), fieldPath?: [ string ](name='fieldPath'), } model IncidentPlanStruct { autoRecoverSeconds?: int32(name='autoRecoverSeconds'), closeExpire?: long(name='closeExpire'), corporation?: [ IncidentPlanCorporationStruct ](name='corporation'), description?: string(name='description'), escalationId?: [ string ](name='escalationId'), gmtCreate?: long(name='gmtCreate'), gmtModified?: long(name='gmtModified'), groupBy?: [ IncidentPlanFieldPath ](name='groupBy'), incidentPlanId?: string(name='incidentPlanId'), name?: string(name='name'), resourceFiled?: [ IncidentPlanFieldPath ](name='resourceFiled'), status?: string(name='status'), userId?: long(name='userId'), workspace?: string(name='workspace'), } model IncidentResourceDetail { extraId?: string(name='extraId'), resourceId?: map[string]any(name='resourceId'), type?: string(name='type'), } model IncidentResourceStruct { description?: string(name='description'), incidentId?: string(name='incidentId'), incidentResourceId?: string(name='incidentResourceId'), resource?: IncidentResourceDetail(name='resource'), source?: string(name='source'), time?: long(name='time'), userId?: long(name='userId'), } model IncidentStruct { content?: string(name='content'), escalations?: [ IncidentEscalationStruct ](name='escalations'), incidentId?: string(name='incidentId'), incidentPlan?: IncidentPlanStruct(name='incidentPlan'), resource?: IncidentResourceDetail(name='resource'), severity?: string(name='severity'), status?: string(name='status'), time?: long(name='time'), title?: string(name='title'), userId?: string(name='userId'), } model IncidentTimeline { childType?: string(name='childType'), content?: string(name='content'), incidentId?: string(name='incidentId'), incidentTimelineId?: string(name='incidentTimelineId'), time?: long(name='time'), timelineId?: string(name='timelineId'), title?: string(name='title'), type?: string(name='type'), userId?: string(name='userId'), } model MaintainWindowForModify { description?: string(name='description'), effectTimeRange?: { dayInWeek?: [ int32 ](name='dayInWeek'), endTimeInMinute?: int32(name='endTimeInMinute'), startTimeInMinute?: int32(name='startTimeInMinute'), timeZone?: string(name='timeZone'), }(name='effectTimeRange'), effective?: string(name='effective'), endTime?: string(name='endTime'), filterSetting?: FilterSetting(name='filterSetting'), maintainWindowName?: string(name='maintainWindowName', description='This parameter is required.'), startTime?: string(name='startTime'), } model MaintainWindowForView { createTime?: string(name='createTime'), description?: string(name='description'), effectTimeRange?: { dayInWeek?: [ int32 ](name='dayInWeek'), endTimeInMinute?: int32(name='endTimeInMinute'), startTimeInMinute?: int32(name='startTimeInMinute'), timeZone?: string(name='timeZone'), }(name='effectTimeRange'), effective?: string(name='effective'), enable?: boolean(name='enable'), endTime?: string(name='endTime'), filterSetting?: FilterSetting(name='filterSetting'), maintainWindowId?: string(name='maintainWindowId'), maintainWindowName?: string(name='maintainWindowName', description='This parameter is required.'), startTime?: string(name='startTime'), updateTime?: string(name='updateTime'), userId?: string(name='userId'), workspace?: string(name='workspace'), } model NotifyStrategyForModify { customTemplateEntries?: [ { targetType?: string(name='targetType', description='This parameter is required.'), templateUuid?: string(name='templateUuid', description='This parameter is required.'), } ](name='customTemplateEntries'), description?: string(name='description'), groupingSetting?: { groupingKeys?: [ string ](name='groupingKeys'), periodMin?: int32(name='periodMin'), silenceSec?: int32(name='silenceSec'), times?: int32(name='times'), }(name='groupingSetting', description='This parameter is required.'), ignoreRestoredNotification?: boolean(name='ignoreRestoredNotification'), notifyStrategyName?: string(name='notifyStrategyName', description='This parameter is required.'), routes?: [ { channels?: [ { channelType?: string(name='channelType', description='This parameter is required.'), enabledSubChannels?: [ string ](name='enabledSubChannels'), receivers?: [ string ](name='receivers', description='This parameter is required.'), } ](name='channels'), effectTimeRange?: { dayInWeek?: [ int32 ](name='dayInWeek'), endTimeInMinute?: int32(name='endTimeInMinute'), startTimeInMinute?: int32(name='startTimeInMinute'), timeZone?: string(name='timeZone'), }(name='effectTimeRange'), filterSetting?: FilterSetting(name='filterSetting'), severities?: [ string ](name='severities'), } ](name='routes', description='This parameter is required.'), } model NotifyStrategyForView { createTime?: string(name='createTime'), customTemplateEntries?: [ { targetType?: string(name='targetType', description='This parameter is required.'), templateUuid?: string(name='templateUuid', description='This parameter is required.'), } ](name='customTemplateEntries'), description?: string(name='description'), enable?: boolean(name='enable'), groupingSetting?: { groupingKeys?: [ string ](name='groupingKeys'), periodMin?: int32(name='periodMin'), silenceSec?: int32(name='silenceSec'), times?: int32(name='times'), }(name='groupingSetting', description='This parameter is required.'), ignoreRestoredNotification?: boolean(name='ignoreRestoredNotification'), notifyStrategyId?: string(name='notifyStrategyId'), notifyStrategyName?: string(name='notifyStrategyName', description='This parameter is required.'), routes?: [ { channels?: [ { channelType?: string(name='channelType', description='This parameter is required.'), enabledSubChannels?: [ string ](name='enabledSubChannels'), receivers?: [ string ](name='receivers', description='This parameter is required.'), } ](name='channels'), effectTimeRange?: { dayInWeek?: [ int32 ](name='dayInWeek'), endTimeInMinute?: int32(name='endTimeInMinute'), startTimeInMinute?: int32(name='startTimeInMinute'), timeZone?: string(name='timeZone'), }(name='effectTimeRange'), filterSetting?: FilterSetting(name='filterSetting'), severities?: [ string ](name='severities'), } ](name='routes', description='This parameter is required.'), updateTime?: string(name='updateTime'), userId?: string(name='userId'), workspace?: string(name='workspace'), } model PrometheusManagedInstance { createTime?: string(name='createTime'), instanceType?: string(name='instanceType'), prometheusInstanceId?: string(name='prometheusInstanceId'), prometheusInstanceName?: string(name='prometheusInstanceName'), regionId?: string(name='regionId'), status?: string(name='status'), workspace?: string(name='workspace'), } model RumDnsResponse { domain?: string(name='domain'), message?: string(name='message'), result?: boolean(name='result'), } model SubscriptionForModify { description?: string(name='description'), filterSetting?: FilterSetting(name='filterSetting'), notifyStrategyId?: string(name='notifyStrategyId'), pushingSetting?: { alertActionIds?: [ string ](name='alertActionIds'), responsePlanId?: string(name='responsePlanId'), restoreActionIds?: [ string ](name='restoreActionIds'), templateUuid?: string(name='templateUuid'), }(name='pushingSetting'), subscriptionName?: string(name='subscriptionName', description='This parameter is required.'), } model SubscriptionForView { createTime?: string(name='createTime'), description?: string(name='description'), enable?: boolean(name='enable'), filterSetting?: FilterSetting(name='filterSetting'), notifyStrategyId?: string(name='notifyStrategyId'), pushingSetting?: { alertActionIds?: [ string ](name='alertActionIds'), responsePlanId?: string(name='responsePlanId'), restoreActionIds?: [ string ](name='restoreActionIds'), templateUuid?: string(name='templateUuid'), }(name='pushingSetting'), subscriptionId?: string(name='subscriptionId'), subscriptionName?: string(name='subscriptionName', description='This parameter is required.'), updateTime?: string(name='updateTime'), userId?: string(name='userId'), workspace?: string(name='workspace'), } model TransformAction { filterSetting?: FilterSetting(name='filterSetting'), labelKey?: string(name='labelKey'), mapping?: map[string]string(name='mapping'), regExp?: string(name='regExp'), source?: string(name='source'), target?: string(name='target'), type?: string(name='type'), value?: string(name='value'), variable?: string(name='variable'), } model TransformerForModify { actions?: [ TransformAction ](name='actions'), description?: string(name='description'), filterSetting?: FilterSetting(name='filterSetting'), quitAfterMatch?: boolean(name='quitAfterMatch'), sortId?: int32(name='sortId'), transformerName?: string(name='transformerName', description='This parameter is required.'), } model TransformerForView { actions?: [ TransformAction ](name='actions'), createTime?: string(name='createTime'), description?: string(name='description'), enable?: boolean(name='enable'), filterSetting?: FilterSetting(name='filterSetting'), quitAfterMatch?: boolean(name='quitAfterMatch'), sortId?: int32(name='sortId'), transformerId?: string(name='transformerId'), transformerName?: string(name='transformerName', description='This parameter is required.'), updateTime?: string(name='updateTime'), userId?: string(name='userId'), workspace?: string(name='workspace'), } model CreateEntityStoreResponseBody = { requestId?: string(name='requestId', example='264C3E89-XXXX-XXXX-XXXX-CE9C2196C7DC'), workspaceName?: string(name='workspaceName', example='workspace-test-001'), } model CreateEntityStoreResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: CreateEntityStoreResponseBody(name='body'), } /** * @summary 创建EntityStore相关存储 * * @param headers map * @param runtime runtime options for this request RuntimeOptions * @return CreateEntityStoreResponse */ async function createEntityStoreWithOptions(workspaceName: string, headers: map[string]string, runtime: $RuntimeOptions): CreateEntityStoreResponse { var req = new OpenApiUtil.OpenApiRequest{ headers = headers, }; var params = new OpenApiUtil.Params{ action = 'CreateEntityStore', version = '2024-03-30', protocol = 'HTTPS', pathname = `/workspace/${$URL.percentEncode(workspaceName)}/entitystore`, method = 'POST', authType = 'AK', style = 'ROA', reqBodyType = 'json', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary 创建EntityStore相关存储 * * @return CreateEntityStoreResponse */ async function createEntityStore(workspaceName: string): CreateEntityStoreResponse { var runtime = new $RuntimeOptions{}; var headers : map[string]string = {}; return createEntityStoreWithOptions(workspaceName, headers, runtime); } model CreatePrometheusInstanceRequest { archiveDuration?: int32(name='archiveDuration', example='60', nullable=true), authFreeReadPolicy?: string(name='authFreeReadPolicy', example='0.0.0.0/0'), authFreeWritePolicy?: string(name='authFreeWritePolicy', example='0.0.0.0/0'), enableAuthFreeRead?: boolean(name='enableAuthFreeRead', example='true'), enableAuthFreeWrite?: boolean(name='enableAuthFreeWrite', example='true'), enableAuthToken?: boolean(name='enableAuthToken', example='true'), paymentType?: string(name='paymentType', example='POSTPAY'), prometheusInstanceName?: string(name='prometheusInstanceName', description='This parameter is required.', example='name1'), status?: string(name='status', example='Running'), storageDuration?: int32(name='storageDuration', example='90'), tags?: [ { key?: string(name='key', example='key1'), value?: string(name='value', example='110109200001214284'), } ](name='tags'), workspace?: string(name='workspace', example='wokspace1'), } model CreatePrometheusInstanceResponseBody = { prometheusInstanceId?: string(name='prometheusInstanceId', example='rw-abc123'), requestId?: string(name='requestId', description='Id of the request', example='264C3E89-BE6E-5F82-A484-CE9C2196C7DC'), } model CreatePrometheusInstanceResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: CreatePrometheusInstanceResponseBody(name='body'), } /** * @summary 创建Prometheus监控实例 * * @param request CreatePrometheusInstanceRequest * @param headers map * @param runtime runtime options for this request RuntimeOptions * @return CreatePrometheusInstanceResponse */ async function createPrometheusInstanceWithOptions(request: CreatePrometheusInstanceRequest, headers: map[string]string, runtime: $RuntimeOptions): CreatePrometheusInstanceResponse { request.validate(); var body : map[string]any = {}; if (!$isNull(request.archiveDuration)) { body['archiveDuration'] = request.archiveDuration; } if (!$isNull(request.authFreeReadPolicy)) { body['authFreeReadPolicy'] = request.authFreeReadPolicy; } if (!$isNull(request.authFreeWritePolicy)) { body['authFreeWritePolicy'] = request.authFreeWritePolicy; } if (!$isNull(request.enableAuthFreeRead)) { body['enableAuthFreeRead'] = request.enableAuthFreeRead; } if (!$isNull(request.enableAuthFreeWrite)) { body['enableAuthFreeWrite'] = request.enableAuthFreeWrite; } if (!$isNull(request.enableAuthToken)) { body['enableAuthToken'] = request.enableAuthToken; } if (!$isNull(request.paymentType)) { body['paymentType'] = request.paymentType; } if (!$isNull(request.prometheusInstanceName)) { body['prometheusInstanceName'] = request.prometheusInstanceName; } if (!$isNull(request.status)) { body['status'] = request.status; } if (!$isNull(request.storageDuration)) { body['storageDuration'] = request.storageDuration; } if (!$isNull(request.tags)) { body['tags'] = request.tags; } if (!$isNull(request.workspace)) { body['workspace'] = request.workspace; } var req = new OpenApiUtil.OpenApiRequest{ headers = headers, body = OpenApiUtil.parseToMap(body), }; var params = new OpenApiUtil.Params{ action = 'CreatePrometheusInstance', version = '2024-03-30', protocol = 'HTTPS', pathname = `/prometheus-instances`, method = 'POST', authType = 'AK', style = 'ROA', reqBodyType = 'json', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary 创建Prometheus监控实例 * * @param request CreatePrometheusInstanceRequest * @return CreatePrometheusInstanceResponse */ async function createPrometheusInstance(request: CreatePrometheusInstanceRequest): CreatePrometheusInstanceResponse { var runtime = new $RuntimeOptions{}; var headers : map[string]string = {}; return createPrometheusInstanceWithOptions(request, headers, runtime); } model CreateUmodelRequest { commonSchemaRef?: [ { group?: string(name='group', example='test-job-123'), items?: [ string ](name='items'), version?: string(name='version', example='1'), } ](name='commonSchemaRef'), description?: string(name='description', example='workspace test'), } model CreateUmodelResponseBody = { requestId?: string(name='requestId', example='123-0F43-23423-AC43-34234'), workspace?: string(name='workspace', example='workspace-test'), } model CreateUmodelResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: CreateUmodelResponseBody(name='body'), } /** * @summary 创建Umodel配置 * * @param request CreateUmodelRequest * @param headers map * @param runtime runtime options for this request RuntimeOptions * @return CreateUmodelResponse */ async function createUmodelWithOptions(workspace: string, request: CreateUmodelRequest, headers: map[string]string, runtime: $RuntimeOptions): CreateUmodelResponse { request.validate(); var body : map[string]any = {}; if (!$isNull(request.commonSchemaRef)) { body['commonSchemaRef'] = request.commonSchemaRef; } if (!$isNull(request.description)) { body['description'] = request.description; } var req = new OpenApiUtil.OpenApiRequest{ headers = headers, body = OpenApiUtil.parseToMap(body), }; var params = new OpenApiUtil.Params{ action = 'CreateUmodel', version = '2024-03-30', protocol = 'HTTPS', pathname = `/workspace/${$URL.percentEncode(workspace)}/umodel`, method = 'POST', authType = 'AK', style = 'ROA', reqBodyType = 'json', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary 创建Umodel配置 * * @param request CreateUmodelRequest * @return CreateUmodelResponse */ async function createUmodel(workspace: string, request: CreateUmodelRequest): CreateUmodelResponse { var runtime = new $RuntimeOptions{}; var headers : map[string]string = {}; return createUmodelWithOptions(workspace, request, headers, runtime); } model DeleteEntityStoreResponseBody = { requestId?: string(name='requestId', example='264C3E89-XXXX-XXXX-XXXX-CE9C2196C7DC'), } model DeleteEntityStoreResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: DeleteEntityStoreResponseBody(name='body'), } /** * @summary 删除EntityStore相关存储 * * @param headers map * @param runtime runtime options for this request RuntimeOptions * @return DeleteEntityStoreResponse */ async function deleteEntityStoreWithOptions(workspaceName: string, headers: map[string]string, runtime: $RuntimeOptions): DeleteEntityStoreResponse { var req = new OpenApiUtil.OpenApiRequest{ headers = headers, }; var params = new OpenApiUtil.Params{ action = 'DeleteEntityStore', version = '2024-03-30', protocol = 'HTTPS', pathname = `/workspace/${$URL.percentEncode(workspaceName)}/entitystore`, method = 'DELETE', authType = 'AK', style = 'ROA', reqBodyType = 'json', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary 删除EntityStore相关存储 * * @return DeleteEntityStoreResponse */ async function deleteEntityStore(workspaceName: string): DeleteEntityStoreResponse { var runtime = new $RuntimeOptions{}; var headers : map[string]string = {}; return deleteEntityStoreWithOptions(workspaceName, headers, runtime); } model DeleteUmodelResponseBody = { requestId?: string(name='requestId', example='123123-3213-345-9941-345345345'), } model DeleteUmodelResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: DeleteUmodelResponseBody(name='body'), } /** * @summary 删除Umodel配置信息 * * @param headers map * @param runtime runtime options for this request RuntimeOptions * @return DeleteUmodelResponse */ async function deleteUmodelWithOptions(workspace: string, headers: map[string]string, runtime: $RuntimeOptions): DeleteUmodelResponse { var req = new OpenApiUtil.OpenApiRequest{ headers = headers, }; var params = new OpenApiUtil.Params{ action = 'DeleteUmodel', version = '2024-03-30', protocol = 'HTTPS', pathname = `/workspace/${$URL.percentEncode(workspace)}/umodel`, method = 'DELETE', authType = 'AK', style = 'ROA', reqBodyType = 'json', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary 删除Umodel配置信息 * * @return DeleteUmodelResponse */ async function deleteUmodel(workspace: string): DeleteUmodelResponse { var runtime = new $RuntimeOptions{}; var headers : map[string]string = {}; return deleteUmodelWithOptions(workspace, headers, runtime); } model DeleteUmodelDataRequest { domain?: string(name='domain', example='apm'), kind?: string(name='kind', example='metric_set'), name?: string(name='name', example='test'), } model DeleteUmodelDataResponseBody = { requestId?: string(name='requestId', example='111111-222-333-1111-33333'), } model DeleteUmodelDataResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: DeleteUmodelDataResponseBody(name='body'), } /** * @summary 删除 Umodel Elements * * @param request DeleteUmodelDataRequest * @param headers map * @param runtime runtime options for this request RuntimeOptions * @return DeleteUmodelDataResponse */ async function deleteUmodelDataWithOptions(workspace: string, request: DeleteUmodelDataRequest, headers: map[string]string, runtime: $RuntimeOptions): DeleteUmodelDataResponse { request.validate(); var query : map[string]any = {}; if (!$isNull(request.domain)) { query['domain'] = request.domain; } if (!$isNull(request.kind)) { query['kind'] = request.kind; } if (!$isNull(request.name)) { query['name'] = request.name; } var req = new OpenApiUtil.OpenApiRequest{ headers = headers, query = OpenApiUtil.query(query), }; var params = new OpenApiUtil.Params{ action = 'DeleteUmodelData', version = '2024-03-30', protocol = 'HTTPS', pathname = `/workspace/${$URL.percentEncode(workspace)}/umodel/data`, method = 'DELETE', authType = 'AK', style = 'ROA', reqBodyType = 'json', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary 删除 Umodel Elements * * @param request DeleteUmodelDataRequest * @return DeleteUmodelDataResponse */ async function deleteUmodelData(workspace: string, request: DeleteUmodelDataRequest): DeleteUmodelDataResponse { var runtime = new $RuntimeOptions{}; var headers : map[string]string = {}; return deleteUmodelDataWithOptions(workspace, request, headers, runtime); } model DeleteWorkspaceResponseBody = { requestId?: string(name='requestId', example='264C3E89-XXXX-XXXX-XXXX-CE9C2196C7DC'), } model DeleteWorkspaceResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: DeleteWorkspaceResponseBody(name='body'), } /** * @summary 删除工作空间 * * @param headers map * @param runtime runtime options for this request RuntimeOptions * @return DeleteWorkspaceResponse */ async function deleteWorkspaceWithOptions(workspaceName: string, headers: map[string]string, runtime: $RuntimeOptions): DeleteWorkspaceResponse { var req = new OpenApiUtil.OpenApiRequest{ headers = headers, }; var params = new OpenApiUtil.Params{ action = 'DeleteWorkspace', version = '2024-03-30', protocol = 'HTTPS', pathname = `/workspace/${$URL.percentEncode(workspaceName)}`, method = 'DELETE', authType = 'AK', style = 'ROA', reqBodyType = 'json', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary 删除工作空间 * * @return DeleteWorkspaceResponse */ async function deleteWorkspace(workspaceName: string): DeleteWorkspaceResponse { var runtime = new $RuntimeOptions{}; var headers : map[string]string = {}; return deleteWorkspaceWithOptions(workspaceName, headers, runtime); } model GetEntityStoreResponseBody = { regionId?: string(name='regionId', example='cn-heyuan'), requestId?: string(name='requestId', example='264C3E89-XXXX-XXXX-XXXX-CE9C2196C7DC'), workspaceName?: string(name='workspaceName', example='workspace-test-001'), } model GetEntityStoreResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: GetEntityStoreResponseBody(name='body'), } /** * @summary 获取EntityStore相关存储信息 * * @param headers map * @param runtime runtime options for this request RuntimeOptions * @return GetEntityStoreResponse */ async function getEntityStoreWithOptions(workspaceName: string, headers: map[string]string, runtime: $RuntimeOptions): GetEntityStoreResponse { var req = new OpenApiUtil.OpenApiRequest{ headers = headers, }; var params = new OpenApiUtil.Params{ action = 'GetEntityStore', version = '2024-03-30', protocol = 'HTTPS', pathname = `/workspace/${$URL.percentEncode(workspaceName)}/entitystore`, method = 'GET', authType = 'AK', style = 'ROA', reqBodyType = 'json', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary 获取EntityStore相关存储信息 * * @return GetEntityStoreResponse */ async function getEntityStore(workspaceName: string): GetEntityStoreResponse { var runtime = new $RuntimeOptions{}; var headers : map[string]string = {}; return getEntityStoreWithOptions(workspaceName, headers, runtime); } model GetEntityStoreDataHeaders { commonHeaders?: map[string]string, acceptEncoding?: string(name='acceptEncoding', example='gzip'), } model GetEntityStoreDataRequest { from?: int32(name='from', description='This parameter is required.', example='1721767203'), query?: string(name='query', description='This parameter is required.', example='.entity with(domain=\\\\"acs\\\\", type=\\\\"acs.k8s.node\\\\") | limit 0, 10'), to?: int32(name='to', description='This parameter is required.', example='1721767283'), } model GetEntityStoreDataResponseBody = { data?: [[ string ] ](name='data'), header?: [ string ](name='header'), requestId?: string(name='requestId', example='264C3E89-XXXX-XXXX-XXXX-CE9C2196C7DC'), } model GetEntityStoreDataResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: GetEntityStoreDataResponseBody(name='body'), } /** * @summary 查询指定Workspace下的实体和关系数据,返回结果显示某时间区间中的实体数据(返回结果压缩后传输)。 * * @param request GetEntityStoreDataRequest * @param headers GetEntityStoreDataHeaders * @param runtime runtime options for this request RuntimeOptions * @return GetEntityStoreDataResponse */ async function getEntityStoreDataWithOptions(workspace: string, request: GetEntityStoreDataRequest, headers: GetEntityStoreDataHeaders, runtime: $RuntimeOptions): GetEntityStoreDataResponse { request.validate(); var body : map[string]any = {}; if (!$isNull(request.from)) { body['from'] = request.from; } if (!$isNull(request.query)) { body['query'] = request.query; } if (!$isNull(request.to)) { body['to'] = request.to; } var realHeaders : map[string]string = {}; if (!$isNull(headers.commonHeaders)) { realHeaders = headers.commonHeaders; } if (!$isNull(headers.acceptEncoding)) { realHeaders['acceptEncoding'] = $string(headers.acceptEncoding); } var req = new OpenApiUtil.OpenApiRequest{ headers = realHeaders, body = OpenApiUtil.parseToMap(body), }; var params = new OpenApiUtil.Params{ action = 'GetEntityStoreData', version = '2024-03-30', protocol = 'HTTPS', pathname = `/workspace/${$URL.percentEncode(workspace)}/entitiesAndRelations`, method = 'POST', authType = 'AK', style = 'ROA', reqBodyType = 'json', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary 查询指定Workspace下的实体和关系数据,返回结果显示某时间区间中的实体数据(返回结果压缩后传输)。 * * @param request GetEntityStoreDataRequest * @return GetEntityStoreDataResponse */ async function getEntityStoreData(workspace: string, request: GetEntityStoreDataRequest): GetEntityStoreDataResponse { var runtime = new $RuntimeOptions{}; var headers = new GetEntityStoreDataHeaders{}; return getEntityStoreDataWithOptions(workspace, request, headers, runtime); } model GetUmodelResponseBody = { commonSchemaRef?: [ { group?: string(name='group', example='test-job-123123'), items?: [ string ](name='items'), version?: string(name='version', example='5'), } ](name='commonSchemaRef'), description?: string(name='description', example='workspace test'), regionId?: string(name='regionId', example='cn-heyuan'), requestId?: string(name='requestId', example='123-123123-sdf-435-3123'), workspace?: string(name='workspace', example='workspace-test'), } model GetUmodelResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: GetUmodelResponseBody(name='body'), } /** * @summary 获取Umodel配置信息 * * @param headers map * @param runtime runtime options for this request RuntimeOptions * @return GetUmodelResponse */ async function getUmodelWithOptions(workspace: string, headers: map[string]string, runtime: $RuntimeOptions): GetUmodelResponse { var req = new OpenApiUtil.OpenApiRequest{ headers = headers, }; var params = new OpenApiUtil.Params{ action = 'GetUmodel', version = '2024-03-30', protocol = 'HTTPS', pathname = `/workspace/${$URL.percentEncode(workspace)}/umodel`, method = 'GET', authType = 'AK', style = 'ROA', reqBodyType = 'json', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary 获取Umodel配置信息 * * @return GetUmodelResponse */ async function getUmodel(workspace: string): GetUmodelResponse { var runtime = new $RuntimeOptions{}; var headers : map[string]string = {}; return getUmodelWithOptions(workspace, headers, runtime); } model GetUmodelDataRequest { content?: any(name='content', example='{ "filter": { "domains": [] }, "offset": 0, "size": 100000 }'), method?: string(name='method', description='This parameter is required.', example='ListData'), } model GetUmodelDataResponseBody = { errors?: [ { message?: string(name='message', example='ok'), type?: string(name='type', example='external'), } ](name='errors'), links?: [ any ](name='links'), nodes?: [ any ](name='nodes'), requestId?: string(name='requestId', example='123-123-234-345-123'), totalLinksCount?: int32(name='totalLinksCount', example='0'), totalNodesCount?: int32(name='totalNodesCount', example='0'), } model GetUmodelDataResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: GetUmodelDataResponseBody(name='body'), } /** * @summary 获取相关联的 Umodel 图数据 * * @param request GetUmodelDataRequest * @param headers map * @param runtime runtime options for this request RuntimeOptions * @return GetUmodelDataResponse */ async function getUmodelDataWithOptions(workspace: string, request: GetUmodelDataRequest, headers: map[string]string, runtime: $RuntimeOptions): GetUmodelDataResponse { request.validate(); var query : map[string]any = {}; if (!$isNull(request.method)) { query['method'] = request.method; } var body : map[string]any = {}; if (!$isNull(request.content)) { body['content'] = request.content; } var req = new OpenApiUtil.OpenApiRequest{ headers = headers, query = OpenApiUtil.query(query), body = OpenApiUtil.parseToMap(body), }; var params = new OpenApiUtil.Params{ action = 'GetUmodelData', version = '2024-03-30', protocol = 'HTTPS', pathname = `/workspace/${$URL.percentEncode(workspace)}/umodel/graph`, method = 'POST', authType = 'AK', style = 'ROA', reqBodyType = 'json', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary 获取相关联的 Umodel 图数据 * * @param request GetUmodelDataRequest * @return GetUmodelDataResponse */ async function getUmodelData(workspace: string, request: GetUmodelDataRequest): GetUmodelDataResponse { var runtime = new $RuntimeOptions{}; var headers : map[string]string = {}; return getUmodelDataWithOptions(workspace, request, headers, runtime); } model GetWorkspaceResponseBody = { createTime?: string(name='createTime', description='Use the UTC time format: yyyy-MM-ddTHH:mm:ss.SSSZ', example='2025-03-11T08:21:58Z'), description?: string(name='description', description='工作空间描述', example='workspace test'), displayName?: string(name='displayName', example='workspace-test'), lastModifyTime?: string(name='lastModifyTime', description='Use the UTC time format: yyyy-MM-ddTHH:mm:ssZ', example='2025-03-11T08:21:58Z'), regionId?: string(name='regionId', description='地域ID', example='cn-heyuan'), requestId?: string(name='requestId', example='264C3E89-XXXX-XXXX-XXXX-CE9C2196C7DC'), slsProject?: string(name='slsProject', description='工作空间绑定的日志服务项目名称', example='sls-project-test-001'), workspaceName?: string(name='workspaceName', description='工作空间名称 This parameter is required.', example='workspace-test-001'), } model GetWorkspaceResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: GetWorkspaceResponseBody(name='body'), } /** * @summary 获取工作空间 * * @param headers map * @param runtime runtime options for this request RuntimeOptions * @return GetWorkspaceResponse */ async function getWorkspaceWithOptions(workspaceName: string, headers: map[string]string, runtime: $RuntimeOptions): GetWorkspaceResponse { var req = new OpenApiUtil.OpenApiRequest{ headers = headers, }; var params = new OpenApiUtil.Params{ action = 'GetWorkspace', version = '2024-03-30', protocol = 'HTTPS', pathname = `/workspace/${$URL.percentEncode(workspaceName)}`, method = 'GET', authType = 'AK', style = 'ROA', reqBodyType = 'json', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary 获取工作空间 * * @return GetWorkspaceResponse */ async function getWorkspace(workspaceName: string): GetWorkspaceResponse { var runtime = new $RuntimeOptions{}; var headers : map[string]string = {}; return getWorkspaceWithOptions(workspaceName, headers, runtime); } model ListAlertActionsRequest { alertActionIds?: [ string ](name='alertActionIds'), alertActionName?: string(name='alertActionName'), pageNumber?: int32(name='pageNumber'), pageSize?: int32(name='pageSize'), type?: string(name='type'), } model ListAlertActionsShrinkRequest { alertActionIdsShrink?: string(name='alertActionIds'), alertActionName?: string(name='alertActionName'), pageNumber?: int32(name='pageNumber'), pageSize?: int32(name='pageSize'), type?: string(name='type'), } model ListAlertActionsResponseBody = { alertActions?: [ { alertActionId?: string(name='alertActionId'), alertActionName?: string(name='alertActionName'), essParam?: { essGroupId?: string(name='essGroupId'), essRuleId?: string(name='essRuleId'), regionId?: string(name='regionId'), }(name='essParam'), fcParam?: { function?: string(name='function'), regionId?: string(name='regionId'), service?: string(name='service'), }(name='fcParam'), mnsParam?: { mnsType?: string(name='mnsType'), name?: string(name='name'), regionId?: string(name='regionId'), }(name='mnsParam'), pagerDutyParam?: { key?: string(name='key'), url?: string(name='url'), }(name='pagerDutyParam'), slsParam?: { logstore?: string(name='logstore'), project?: string(name='project'), regionId?: string(name='regionId'), }(name='slsParam'), type?: string(name='type'), webhookParam?: { contentType?: string(name='contentType'), headers?: map[string]string(name='headers'), method?: string(name='method'), url?: string(name='url'), }(name='webhookParam'), } ](name='alertActions'), pageNumber?: long(name='pageNumber'), pageSize?: long(name='pageSize'), requestId?: string(name='requestId'), total?: int32(name='total'), } model ListAlertActionsResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: ListAlertActionsResponseBody(name='body'), } /** * @summary 查询告警动作 * * @param tmpReq ListAlertActionsRequest * @param headers map * @param runtime runtime options for this request RuntimeOptions * @return ListAlertActionsResponse */ async function listAlertActionsWithOptions(tmpReq: ListAlertActionsRequest, headers: map[string]string, runtime: $RuntimeOptions): ListAlertActionsResponse { tmpReq.validate(); var request = new ListAlertActionsShrinkRequest{}; OpenApiUtil.convert(tmpReq, request); if (!$isNull(tmpReq.alertActionIds)) { request.alertActionIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.alertActionIds, 'alertActionIds', 'json'); } var query : map[string]any = {}; if (!$isNull(request.alertActionIdsShrink)) { query['alertActionIds'] = request.alertActionIdsShrink; } if (!$isNull(request.alertActionName)) { query['alertActionName'] = request.alertActionName; } if (!$isNull(request.pageNumber)) { query['pageNumber'] = request.pageNumber; } if (!$isNull(request.pageSize)) { query['pageSize'] = request.pageSize; } if (!$isNull(request.type)) { query['type'] = request.type; } var req = new OpenApiUtil.OpenApiRequest{ headers = headers, query = OpenApiUtil.query(query), }; var params = new OpenApiUtil.Params{ action = 'ListAlertActions', version = '2024-03-30', protocol = 'HTTPS', pathname = `/alertActions`, method = 'GET', authType = 'AK', style = 'ROA', reqBodyType = 'json', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary 查询告警动作 * * @param request ListAlertActionsRequest * @return ListAlertActionsResponse */ async function listAlertActions(request: ListAlertActionsRequest): ListAlertActionsResponse { var runtime = new $RuntimeOptions{}; var headers : map[string]string = {}; return listAlertActionsWithOptions(request, headers, runtime); } model ListWorkspacesRequest { maxResults?: int32(name='maxResults', example='10'), nextToken?: string(name='nextToken', example='xxxxxxxxxx'), region?: string(name='region', example='cn-heyuan', nullable=true), workspaceName?: string(name='workspaceName', example='workspace-test-001'), workspaceNameList?: [ string ](name='workspaceNameList', example='workspace-test-001', nullable=true), } model ListWorkspacesShrinkRequest { maxResults?: int32(name='maxResults', example='10'), nextToken?: string(name='nextToken', example='xxxxxxxxxx'), region?: string(name='region', example='cn-heyuan', nullable=true), workspaceName?: string(name='workspaceName', example='workspace-test-001'), workspaceNameListShrink?: string(name='workspaceNameList', example='workspace-test-001', nullable=true), } model ListWorkspacesResponseBody = { maxResults?: int32(name='maxResults', example='10'), nextToken?: string(name='nextToken', example='xxxxxxxxxx'), requestId?: string(name='requestId', example='264C3E89-XXXX-XXXX-XXXX-CE9C2196C7DC'), total?: int32(name='total', example='1'), workspaces?: [ { createTime?: string(name='createTime', description='Use the UTC time format: yyyy-MM-ddTHH:mm:ssZ', example='2025-03-11T08:21:58Z'), description?: string(name='description', description='工作空间描述', example='workspace test'), displayName?: string(name='displayName', example='workspace-test'), lastModifyTime?: string(name='lastModifyTime', description='Use the UTC time format: yyyy-MM-ddTHH:mm:ssZ', example='2025-03-11T08:21:58Z'), regionId?: string(name='regionId', description='地域ID', example='cn-heyuan'), slsProject?: string(name='slsProject', description='工作空间绑定的日志服务项目名称', example='sls-project-test-001'), workspaceName?: string(name='workspaceName', description='工作空间名称 This parameter is required.', example='workspace-test-001'), } ](name='workspaces'), } model ListWorkspacesResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: ListWorkspacesResponseBody(name='body'), } /** * @summary 获取工作空间列表 * * @param tmpReq ListWorkspacesRequest * @param headers map * @param runtime runtime options for this request RuntimeOptions * @return ListWorkspacesResponse */ async function listWorkspacesWithOptions(tmpReq: ListWorkspacesRequest, headers: map[string]string, runtime: $RuntimeOptions): ListWorkspacesResponse { tmpReq.validate(); var request = new ListWorkspacesShrinkRequest{}; OpenApiUtil.convert(tmpReq, request); if (!$isNull(tmpReq.workspaceNameList)) { request.workspaceNameListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.workspaceNameList, 'workspaceNameList', 'simple'); } var query : map[string]any = {}; if (!$isNull(request.maxResults)) { query['maxResults'] = request.maxResults; } if (!$isNull(request.nextToken)) { query['nextToken'] = request.nextToken; } if (!$isNull(request.region)) { query['region'] = request.region; } if (!$isNull(request.workspaceName)) { query['workspaceName'] = request.workspaceName; } if (!$isNull(request.workspaceNameListShrink)) { query['workspaceNameList'] = request.workspaceNameListShrink; } var req = new OpenApiUtil.OpenApiRequest{ headers = headers, query = OpenApiUtil.query(query), }; var params = new OpenApiUtil.Params{ action = 'ListWorkspaces', version = '2024-03-30', protocol = 'HTTPS', pathname = `/workspace`, method = 'GET', authType = 'AK', style = 'ROA', reqBodyType = 'json', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary 获取工作空间列表 * * @param request ListWorkspacesRequest * @return ListWorkspacesResponse */ async function listWorkspaces(request: ListWorkspacesRequest): ListWorkspacesResponse { var runtime = new $RuntimeOptions{}; var headers : map[string]string = {}; return listWorkspacesWithOptions(request, headers, runtime); } model PutWorkspaceRequest { description?: string(name='description', description='工作空间描述', example='workspace test'), displayName?: string(name='displayName', example='workspace-test'), slsProject?: string(name='slsProject', description='工作空间绑定的日志服务项目名称 This parameter is required.', example='sls-project-test-001'), } model PutWorkspaceResponseBody = { requestId?: string(name='requestId', description='Id of the request', example='264C3E89-XXXX-XXXX-XXXX-CE9C2196C7DC'), workspaceName?: string(name='workspaceName', example='workspace-test-001'), } model PutWorkspaceResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: PutWorkspaceResponseBody(name='body'), } /** * @summary 创建工作空间 * * @param request PutWorkspaceRequest * @param headers map * @param runtime runtime options for this request RuntimeOptions * @return PutWorkspaceResponse */ async function putWorkspaceWithOptions(workspaceName: string, request: PutWorkspaceRequest, headers: map[string]string, runtime: $RuntimeOptions): PutWorkspaceResponse { request.validate(); var body : map[string]any = {}; if (!$isNull(request.description)) { body['description'] = request.description; } if (!$isNull(request.displayName)) { body['displayName'] = request.displayName; } if (!$isNull(request.slsProject)) { body['slsProject'] = request.slsProject; } var req = new OpenApiUtil.OpenApiRequest{ headers = headers, body = OpenApiUtil.parseToMap(body), }; var params = new OpenApiUtil.Params{ action = 'PutWorkspace', version = '2024-03-30', protocol = 'HTTPS', pathname = `/workspace/${$URL.percentEncode(workspaceName)}`, method = 'POST', authType = 'AK', style = 'ROA', reqBodyType = 'json', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary 创建工作空间 * * @param request PutWorkspaceRequest * @return PutWorkspaceResponse */ async function putWorkspace(workspaceName: string, request: PutWorkspaceRequest): PutWorkspaceResponse { var runtime = new $RuntimeOptions{}; var headers : map[string]string = {}; return putWorkspaceWithOptions(workspaceName, request, headers, runtime); } model UpdateUmodelRequest { commonSchemaRef?: [ { group?: string(name='group', example='test-bmp-123123'), items?: [ string ](name='items'), version?: string(name='version', example='2.5.'), } ](name='commonSchemaRef'), description?: string(name='description', example='workspace test'), } model UpdateUmodelResponseBody = { requestId?: string(name='requestId', example='234324-123-123-123-23423'), workspace?: string(name='workspace', example='workspace-test'), } model UpdateUmodelResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: UpdateUmodelResponseBody(name='body'), } /** * @summary 更新Umodel配置信息 * * @param request UpdateUmodelRequest * @param headers map * @param runtime runtime options for this request RuntimeOptions * @return UpdateUmodelResponse */ async function updateUmodelWithOptions(workspace: string, request: UpdateUmodelRequest, headers: map[string]string, runtime: $RuntimeOptions): UpdateUmodelResponse { request.validate(); var body : map[string]any = {}; if (!$isNull(request.commonSchemaRef)) { body['commonSchemaRef'] = request.commonSchemaRef; } if (!$isNull(request.description)) { body['description'] = request.description; } var req = new OpenApiUtil.OpenApiRequest{ headers = headers, body = OpenApiUtil.parseToMap(body), }; var params = new OpenApiUtil.Params{ action = 'UpdateUmodel', version = '2024-03-30', protocol = 'HTTPS', pathname = `/workspace/${$URL.percentEncode(workspace)}/umodel`, method = 'PUT', authType = 'AK', style = 'ROA', reqBodyType = 'json', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary 更新Umodel配置信息 * * @param request UpdateUmodelRequest * @return UpdateUmodelResponse */ async function updateUmodel(workspace: string, request: UpdateUmodelRequest): UpdateUmodelResponse { var runtime = new $RuntimeOptions{}; var headers : map[string]string = {}; return updateUmodelWithOptions(workspace, request, headers, runtime); } model UpsertUmodelDataRequest { elements?: [ any ](name='elements'), method?: string(name='method', example='Upsert'), } model UpsertUmodelDataResponseBody = { requestId?: string(name='requestId', example='0CEC5375-C554-562B-A65F-9A629907C1F0'), } model UpsertUmodelDataResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: UpsertUmodelDataResponseBody(name='body'), } /** * @summary 写入 Umodel Elements * * @param request UpsertUmodelDataRequest * @param headers map * @param runtime runtime options for this request RuntimeOptions * @return UpsertUmodelDataResponse */ async function upsertUmodelDataWithOptions(workspace: string, request: UpsertUmodelDataRequest, headers: map[string]string, runtime: $RuntimeOptions): UpsertUmodelDataResponse { request.validate(); var query : map[string]any = {}; if (!$isNull(request.method)) { query['method'] = request.method; } var body : map[string]any = {}; if (!$isNull(request.elements)) { body['elements'] = request.elements; } var req = new OpenApiUtil.OpenApiRequest{ headers = headers, query = OpenApiUtil.query(query), body = OpenApiUtil.parseToMap(body), }; var params = new OpenApiUtil.Params{ action = 'UpsertUmodelData', version = '2024-03-30', protocol = 'HTTPS', pathname = `/workspace/${$URL.percentEncode(workspace)}/umodel/data`, method = 'PATCH', authType = 'AK', style = 'ROA', reqBodyType = 'json', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary 写入 Umodel Elements * * @param request UpsertUmodelDataRequest * @return UpsertUmodelDataResponse */ async function upsertUmodelData(workspace: string, request: UpsertUmodelDataRequest): UpsertUmodelDataResponse { var runtime = new $RuntimeOptions{}; var headers : map[string]string = {}; return upsertUmodelDataWithOptions(workspace, request, headers, runtime); }