eflo-controller-20221215/main.tea (4,269 lines of code) (raw):

/** * */ import Util; import OpenApi; import OpenApiUtil; import EndpointUtil; extends OpenApi; init(config: OpenApi.Config){ super(config); @endpointRule = ''; checkConfig(config); @endpoint = getEndpoint('eflo-controller', @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 ApproveOperationRequest { nodeId?: string(name='NodeId', description='Node ID', example='e01-cn-zvp2tgykr08'), operationType?: string(name='OperationType', description='Operation Type', example='RepairMachine'), } model ApproveOperationResponseBody = { errorMessage?: string(name='ErrorMessage', description='Error Message', example='Resource not found'), requestId?: string(name='RequestId', description='Request ID', example='8F065DDD-6996-5973-9691-9EC57BD0072E'), } model ApproveOperationResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: ApproveOperationResponseBody(name='body'), } /** * @summary Approve Operation * * @param request ApproveOperationRequest * @param runtime runtime options for this request RuntimeOptions * @return ApproveOperationResponse */ async function approveOperationWithOptions(request: ApproveOperationRequest, runtime: Util.RuntimeOptions): ApproveOperationResponse { Util.validateModel(request); var body : map[string]any = {}; if (!Util.isUnset(request.nodeId)) { body['NodeId'] = request.nodeId; } if (!Util.isUnset(request.operationType)) { body['OperationType'] = request.operationType; } var req = new OpenApi.OpenApiRequest{ body = OpenApiUtil.parseToMap(body), }; var params = new OpenApi.Params{ action = 'ApproveOperation', version = '2022-12-15', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Approve Operation * * @param request ApproveOperationRequest * @return ApproveOperationResponse */ async function approveOperation(request: ApproveOperationRequest): ApproveOperationResponse { var runtime = new Util.RuntimeOptions{}; return approveOperationWithOptions(request, runtime); } model ChangeResourceGroupRequest { resourceGroupId?: string(name='ResourceGroupId', description='System-defined parameter. Value: **ChangeResourceGroup**. This parameter is required.', example='rg-aekzyqdwnfabx6q'), resourceId?: string(name='ResourceId', description='$.parameters[1].schema.example This parameter is required.', example='i118099391667548921125'), resourceRegionId?: string(name='ResourceRegionId', description='Resource Group Change This parameter is required.', example='cn-wulanchabu'), resourceType?: string(name='ResourceType', description='$.parameters[3].schema.enumValueTitles', example='Node'), } model ChangeResourceGroupResponseBody = { requestId?: string(name='RequestId', description='Id of the request', example='8F065DDD-6996-5973-9691-9EC57BD0072E'), } model ChangeResourceGroupResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: ChangeResourceGroupResponseBody(name='body'), } /** * @summary Target Resource Group * * @param request ChangeResourceGroupRequest * @param runtime runtime options for this request RuntimeOptions * @return ChangeResourceGroupResponse */ async function changeResourceGroupWithOptions(request: ChangeResourceGroupRequest, runtime: Util.RuntimeOptions): ChangeResourceGroupResponse { Util.validateModel(request); var query = {}; if (!Util.isUnset(request.resourceGroupId)) { query['ResourceGroupId'] = request.resourceGroupId; } if (!Util.isUnset(request.resourceId)) { query['ResourceId'] = request.resourceId; } if (!Util.isUnset(request.resourceRegionId)) { query['ResourceRegionId'] = request.resourceRegionId; } if (!Util.isUnset(request.resourceType)) { query['ResourceType'] = request.resourceType; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApi.Params{ action = 'ChangeResourceGroup', version = '2022-12-15', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Target Resource Group * * @param request ChangeResourceGroupRequest * @return ChangeResourceGroupResponse */ async function changeResourceGroup(request: ChangeResourceGroupRequest): ChangeResourceGroupResponse { var runtime = new Util.RuntimeOptions{}; return changeResourceGroupWithOptions(request, runtime); } model CloseSessionRequest { sessionId?: string(name='SessionId', description='Session ID', example='i207023871669364793713'), sessionToken?: string(name='SessionToken', description='Session token', example='03f53c719015a9ad4f4f55d66cac2dac161b18e8065ca75a3220b89de389c980'), } model CloseSessionResponseBody = { requestId?: string(name='RequestId', description='Request ID.', example='07AA3A1F-321E-50D8-B834-88C411331C94'), sessionId?: string(name='SessionId', description='Session ID.', example='i206495551737511455528'), state?: string(name='State', description='ClosingActive', example='Inactive'), } model CloseSessionResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: CloseSessionResponseBody(name='body'), } /** * @summary Disconnect Connection * * @description An interface for creating a session, returning the front-end EndPoint, and initiating a periodic task to track the session status * * @param request CloseSessionRequest * @param runtime runtime options for this request RuntimeOptions * @return CloseSessionResponse */ async function closeSessionWithOptions(request: CloseSessionRequest, runtime: Util.RuntimeOptions): CloseSessionResponse { Util.validateModel(request); var body : map[string]any = {}; if (!Util.isUnset(request.sessionId)) { body['SessionId'] = request.sessionId; } if (!Util.isUnset(request.sessionToken)) { body['SessionToken'] = request.sessionToken; } var req = new OpenApi.OpenApiRequest{ body = OpenApiUtil.parseToMap(body), }; var params = new OpenApi.Params{ action = 'CloseSession', version = '2022-12-15', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Disconnect Connection * * @description An interface for creating a session, returning the front-end EndPoint, and initiating a periodic task to track the session status * * @param request CloseSessionRequest * @return CloseSessionResponse */ async function closeSession(request: CloseSessionRequest): CloseSessionResponse { var runtime = new Util.RuntimeOptions{}; return closeSessionWithOptions(request, runtime); } model CreateClusterRequest { clusterDescription?: string(name='ClusterDescription', description='Cluster description', example='Cluster description'), clusterName?: string(name='ClusterName', description='Cluster name', example='Standard_Cluster'), clusterType?: string(name='ClusterType', description='Cluster type', example='Lite'), components?: [ { componentConfig?: { basicArgs?: any(name='BasicArgs', description='Basic component parameters', example='{ "EndpointPublicAccess": false, "ContainerCidr": "10.4.0.0/24", "KeyPair": "test", "NodeCidrMask": "25", "ResourceGroupId": "rg-axsadm3sdzsdvdsndstdisd", "WorkerSystemDiskCategory": "da", "WorkerSystemDiskSize": 40, "DeletionProtection": false, "KubeProxy": "iptables", "Name": "da", "LoadBalancerSpec": "slb.s1.small", "Runtime": { "Version": "19.03.15", "Name": "docker" }, "IsEnterpriseSecurityGroup": true, "Vpcid": "192.168.23.0/24", "NumOfNodes": 1, "VswitchIds": [ "dad" ], "ServiceCidr": "10.0.0.0/16", "SnatEntry": false, "kubernetesVersion": "1.20.11-aliyunedge.1", "WorkerInstanceTypes": [ "da" ] }'), nodeUnits?: [ any ](name='NodeUnits', description='Node pool configuration, used to establish the correspondence between node groups and node pools. Required when ComponentType is "ACKEdge", otherwise it can be empty.'), }(name='ComponentConfig', description='Component configuration'), componentType?: string(name='ComponentType', description='Component type', example='ACKEdge'), } ](name='Components', description='Components (software instances)'), hpnZone?: string(name='HpnZone', description='Cluster number', example='A1'), ignoreFailedNodeTasks?: boolean(name='IgnoreFailedNodeTasks', description='Whether to allow skipping failed nodes, default value is False', example='False'), networks?: { ipAllocationPolicy?: [ { bondPolicy?: { bondDefaultSubnet?: string(name='BondDefaultSubnet', description='Default bond cluster subnet', example='172.168.0.0/24'), bonds?: [ { name?: string(name='Name', description='Bond name', example='bond0'), subnet?: string(name='Subnet', description='IP source cluster subnet', example='172.16.0.0/24'), } ](name='Bonds', description='Bond information'), }(name='BondPolicy', description='Bond policy'), machineTypePolicy?: [ { bonds?: [ { name?: string(name='Name', description='Bond name', example='bond0'), subnet?: string(name='Subnet', description='IP source cluster subnet', example='192.168.1.0/24'), } ](name='Bonds', description='Bond information'), machineType?: string(name='MachineType', description='Machine type', example='efg1.nvga8n'), } ](name='MachineTypePolicy', description='Machine type allocation policy'), nodePolicy?: [ { bonds?: [ { name?: string(name='Name', description='Bond name', example='bond0'), subnet?: string(name='Subnet', description='IP source cluster subnet', example='10.0.0.0/24'), } ](name='Bonds', description='Bond information'), nodeId?: string(name='NodeId', description='Node ID', example='e01-cn-2r42vq62001'), } ](name='NodePolicy', description='Node allocation policy'), } ](name='IpAllocationPolicy', description='IP allocation policy'), newVpdInfo?: { cenId?: string(name='CenId', description='Cloud Enterprise Network ID', example='cen-1gb1eftc5qp2ao75fo'), cloudLinkCidr?: string(name='CloudLinkCidr', description='Cloud link CIDR', example='172.16.0.0/24'), cloudLinkId?: string(name='CloudLinkId', description='Cloud link ID', example='vcc-cn-c4dtycm5i08'), monitorVpcId?: string(name='MonitorVpcId', description='VPC', example='vpc-0jl2x45apm6odc2c10h25'), monitorVswitchId?: string(name='MonitorVswitchId', description='VPC switch', example='vsw-0jl2w3ffbghkss0x2foff'), vpdCidr?: string(name='VpdCidr', description='Cluster Network Segment', example='192.168.0.0/16'), vpdSubnets?: [ { subnetCidr?: string(name='SubnetCidr', description='Subnet CIDR', example='10.0.1.8/24'), subnetType?: string(name='SubnetType', description='Subnet type', example='10.0.2.8/24'), zoneId?: string(name='ZoneId', description='Zone ID', example='cn-wulanchabu-b'), } ](name='VpdSubnets', description='Cluster subnets'), }(name='NewVpdInfo', description='Vpd configuration information'), securityGroupId?: string(name='SecurityGroupId', description='Security group ID', example='sg-bp1d3dvbh9by7j5rujax'), tailIpVersion?: string(name='TailIpVersion', description='IP version', example='IPv4'), vSwitchId?: string(name='VSwitchId', description='VSwitch ID', example='vsw-asjdfklj'), vSwitchZoneId?: string(name='VSwitchZoneId', description='VSwitch Zone ID', example='cn-shanghai-b'), vpcId?: string(name='VpcId', description='VPC ID', example='vpc-0jl36lqzmc06qogy0t5ll'), vpdInfo?: { vpdId?: string(name='VpdId', description='VPC ID', example='vpd-vfuz6ejv'), vpdSubnets?: [ string ](name='VpdSubnets', description='List of cluster subnet IDs'), }(name='VpdInfo', description='Reuse VPD information'), }(name='Networks', description='Network information'), nimizVSwitches?: [ string ](name='NimizVSwitches', description='Node VSwitches'), nodeGroups?: [ { fileSystemMountEnabled?: boolean(name='FileSystemMountEnabled'), imageId?: string(name='ImageId', description='System image ID', example='i190297201634099844192'), keyPairName?: string(name='KeyPairName', description='The name of the key pair.', example='sc-key'), machineType?: string(name='MachineType', description='Machine type', example='efg1.nvga1'), nodeGroupDescription?: string(name='NodeGroupDescription', description='Node group description', example='Node group description'), nodeGroupName?: string(name='NodeGroupName', description='Node group name', example='emr-default'), nodes?: [ { hostname?: string(name='Hostname', description='Hostname', example='8d13b784-17a9-11ed-bc7b-acde48001122'), loginPassword?: string(name='LoginPassword', description='Login password', example='***'), nodeId?: string(name='NodeId', description='Node ID', example='e01poc-cn-i7m2wnivf0d'), vSwitchId?: string(name='VSwitchId', description='Virtual switch ID', example='vsw-bp169pi5fj151rrms4sia'), vpcId?: string(name='VpcId', description='VPC ID', example='vpc-0jlasms92fdxqd3wlf8ny'), } ](name='Nodes', description='Node list'), systemDisk?: { category?: string(name='Category', description='The disk type. Valid values: * cloud_ssd: standard SSD', example='cloud_essd'), performanceLevel?: string(name='PerformanceLevel', description='The performance level of the ESSD that is used as the system disk. Valid values: * PL0: A single ESSD can provide up to 10,000 random read/write IOPS. * PL1: A single ESSD can provide up to 50,000 random read/write IOPS. Default value: PL1.', example='PL1'), size?: int32(name='Size', description='The size. Unit: GB.', example='20'), }(name='SystemDisk', description='SystemDisk'), userData?: string(name='UserData', description='Instance custom data. It needs to be Base64 encoded, and the original data should not exceed 16 KB.', example='ZWNobyBoZWxsbyBlY3Mh'), zoneId?: string(name='ZoneId', description='Zone ID', example='cn-hangzhou-i'), } ](name='NodeGroups', description='Node group list'), openEniJumboFrame?: boolean(name='OpenEniJumboFrame', description='Open Eni Jumbo Frame', example='false'), resourceGroupId?: string(name='ResourceGroupId', description='Resource group ID', example='rg-aek2xdkc6icwfha'), tag?: [ { key?: string(name='Key', description='Key', example='env-name'), value?: string(name='Value', description='Value', example='dev'), } ](name='Tag', description='Resource tags'), } model CreateClusterShrinkRequest { clusterDescription?: string(name='ClusterDescription', description='Cluster description', example='Cluster description'), clusterName?: string(name='ClusterName', description='Cluster name', example='Standard_Cluster'), clusterType?: string(name='ClusterType', description='Cluster type', example='Lite'), componentsShrink?: string(name='Components', description='Components (software instances)'), hpnZone?: string(name='HpnZone', description='Cluster number', example='A1'), ignoreFailedNodeTasks?: boolean(name='IgnoreFailedNodeTasks', description='Whether to allow skipping failed nodes, default value is False', example='False'), networksShrink?: string(name='Networks', description='Network information'), nimizVSwitchesShrink?: string(name='NimizVSwitches', description='Node VSwitches'), nodeGroupsShrink?: string(name='NodeGroups', description='Node group list'), openEniJumboFrame?: boolean(name='OpenEniJumboFrame', description='Open Eni Jumbo Frame', example='false'), resourceGroupId?: string(name='ResourceGroupId', description='Resource group ID', example='rg-aek2xdkc6icwfha'), tag?: [ { key?: string(name='Key', description='Key', example='env-name'), value?: string(name='Value', description='Value', example='dev'), } ](name='Tag', description='Resource tags'), } model CreateClusterResponseBody = { clusterId?: string(name='ClusterId', description='Cluster ID', example='i116913051663373010974'), requestId?: string(name='RequestId', description='Request ID', example='3C683243-7915-57FB-9570-A2932C1C0F78'), taskId?: string(name='TaskId', description='Task Id', example='i159809891662373011015'), } model CreateClusterResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: CreateClusterResponseBody(name='body'), } /** * @summary Create a large-scale computing cluster * * @param tmpReq CreateClusterRequest * @param runtime runtime options for this request RuntimeOptions * @return CreateClusterResponse */ async function createClusterWithOptions(tmpReq: CreateClusterRequest, runtime: Util.RuntimeOptions): CreateClusterResponse { Util.validateModel(tmpReq); var request = new CreateClusterShrinkRequest{}; OpenApiUtil.convert(tmpReq, request); if (!Util.isUnset(tmpReq.components)) { request.componentsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.components, 'Components', 'json'); } if (!Util.isUnset(tmpReq.networks)) { request.networksShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.networks, 'Networks', 'json'); } if (!Util.isUnset(tmpReq.nimizVSwitches)) { request.nimizVSwitchesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.nimizVSwitches, 'NimizVSwitches', 'json'); } if (!Util.isUnset(tmpReq.nodeGroups)) { request.nodeGroupsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.nodeGroups, 'NodeGroups', 'json'); } var query = {}; if (!Util.isUnset(request.tag)) { query['Tag'] = request.tag; } var body : map[string]any = {}; if (!Util.isUnset(request.clusterDescription)) { body['ClusterDescription'] = request.clusterDescription; } if (!Util.isUnset(request.clusterName)) { body['ClusterName'] = request.clusterName; } if (!Util.isUnset(request.clusterType)) { body['ClusterType'] = request.clusterType; } if (!Util.isUnset(request.componentsShrink)) { body['Components'] = request.componentsShrink; } if (!Util.isUnset(request.hpnZone)) { body['HpnZone'] = request.hpnZone; } if (!Util.isUnset(request.ignoreFailedNodeTasks)) { body['IgnoreFailedNodeTasks'] = request.ignoreFailedNodeTasks; } if (!Util.isUnset(request.networksShrink)) { body['Networks'] = request.networksShrink; } if (!Util.isUnset(request.nimizVSwitchesShrink)) { body['NimizVSwitches'] = request.nimizVSwitchesShrink; } if (!Util.isUnset(request.nodeGroupsShrink)) { body['NodeGroups'] = request.nodeGroupsShrink; } if (!Util.isUnset(request.openEniJumboFrame)) { body['OpenEniJumboFrame'] = request.openEniJumboFrame; } if (!Util.isUnset(request.resourceGroupId)) { body['ResourceGroupId'] = request.resourceGroupId; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), body = OpenApiUtil.parseToMap(body), }; var params = new OpenApi.Params{ action = 'CreateCluster', version = '2022-12-15', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Create a large-scale computing cluster * * @param request CreateClusterRequest * @return CreateClusterResponse */ async function createCluster(request: CreateClusterRequest): CreateClusterResponse { var runtime = new Util.RuntimeOptions{}; return createClusterWithOptions(request, runtime); } model CreateDiagnosticTaskRequest { aiJobLogInfo?: { aiJobLogs?: [ { aiInstance?: string(name='AiInstance', description='Instance ID', example='null'), logs?: [ { datetime?: string(name='Datetime', description='Sent date, in the format yyyymmdd.', example='2024-08-05T10:10:01'), logContent?: string(name='LogContent', description='Log content', example='success'), } ](name='Logs', description='Log object'), nodeId?: string(name='NodeId', description='Node ID', example='e01-tw-p2p2al5u1hn'), } ](name='AiJobLogs', description='Task logs'), endTime?: string(name='EndTime', description='End time. In timestamp format, unit: seconds. > Must be on the hour or half-hour mark.', example='2024-08-05T10:10:01'), startTime?: string(name='StartTime', description='Start time. In timestamp format, unit: seconds. > Must be on the hour or half-hour mark.', example='2024-10-11T00:00:00Z'), }(name='AiJobLogInfo', description='Log information'), clusterId?: string(name='ClusterId', description='Cluster ID', example='i118913031696573280136'), diagnosticType?: string(name='DiagnosticType', description='Diagnostic type.', example='CheckByAiJobLogs'), nodeIds?: [ string ](name='NodeIds', description='List of node IDs'), } model CreateDiagnosticTaskShrinkRequest { aiJobLogInfoShrink?: string(name='AiJobLogInfo', description='Log information'), clusterId?: string(name='ClusterId', description='Cluster ID', example='i118913031696573280136'), diagnosticType?: string(name='DiagnosticType', description='Diagnostic type.', example='CheckByAiJobLogs'), nodeIdsShrink?: string(name='NodeIds', description='List of node IDs'), } model CreateDiagnosticTaskResponseBody = { diagnosticId?: string(name='DiagnosticId', description='Diagnosis ID', example='diag-i150553931717380274931'), requestId?: string(name='RequestId', description='Request ID', example='A511C02A-0127-51AA-A9F9-966382C9A1B5'), } model CreateDiagnosticTaskResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: CreateDiagnosticTaskResponseBody(name='body'), } /** * @summary Diagnostic Task Creation Interface * * @param tmpReq CreateDiagnosticTaskRequest * @param runtime runtime options for this request RuntimeOptions * @return CreateDiagnosticTaskResponse */ async function createDiagnosticTaskWithOptions(tmpReq: CreateDiagnosticTaskRequest, runtime: Util.RuntimeOptions): CreateDiagnosticTaskResponse { Util.validateModel(tmpReq); var request = new CreateDiagnosticTaskShrinkRequest{}; OpenApiUtil.convert(tmpReq, request); if (!Util.isUnset(tmpReq.aiJobLogInfo)) { request.aiJobLogInfoShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.aiJobLogInfo, 'AiJobLogInfo', 'json'); } if (!Util.isUnset(tmpReq.nodeIds)) { request.nodeIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.nodeIds, 'NodeIds', 'simple'); } var body : map[string]any = {}; if (!Util.isUnset(request.aiJobLogInfoShrink)) { body['AiJobLogInfo'] = request.aiJobLogInfoShrink; } if (!Util.isUnset(request.clusterId)) { body['ClusterId'] = request.clusterId; } if (!Util.isUnset(request.diagnosticType)) { body['DiagnosticType'] = request.diagnosticType; } if (!Util.isUnset(request.nodeIdsShrink)) { body['NodeIds'] = request.nodeIdsShrink; } var req = new OpenApi.OpenApiRequest{ body = OpenApiUtil.parseToMap(body), }; var params = new OpenApi.Params{ action = 'CreateDiagnosticTask', version = '2022-12-15', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Diagnostic Task Creation Interface * * @param request CreateDiagnosticTaskRequest * @return CreateDiagnosticTaskResponse */ async function createDiagnosticTask(request: CreateDiagnosticTaskRequest): CreateDiagnosticTaskResponse { var runtime = new Util.RuntimeOptions{}; return createDiagnosticTaskWithOptions(request, runtime); } model CreateNetTestTaskRequest { clusterId?: string(name='ClusterId', description='Cluster ID', example='i119982311660892626523'), clusterName?: string(name='ClusterName', description='Cluster name', example='Eflo-YJ-Test-Cluster'), commTest?: { GPUNum?: long(name='GPUNum', description='Number of GPUs', example='1'), hosts?: [ { IP?: string(name='IP', description='IP address.', example='169.253.253.15'), nodeId?: string(name='NodeId', description='Node ID.', example='e01-tw-bqisacl3z6l'), resourceId?: string(name='ResourceId', description='Resource ID', example='i111670831721110797708'), serverName?: string(name='ServerName', description='Service name.', example='VBw'), } ](name='Hosts', description='Resource ID'), model?: string(name='Model', description='Communication library model', example='intention_v4'), type?: string(name='Type', description='Communication library test category: ACCL or NCCL', example='ACCL'), }(name='CommTest', description='Required when the test type is communication library testing'), delayTest?: { hosts?: [ { bond?: string(name='Bond', description='Network interface bond port', example='bond1'), IP?: string(name='IP', description='Node IP', example='125.210.225.48'), nodeId?: string(name='NodeId', description='Node ID.', example='e01-cn-fou43an0a05'), resourceId?: string(name='ResourceId', description='Resource ID', example='e01-cn-bcd3u1aee06'), serverName?: string(name='ServerName', description='Service name.', example='NQU'), } ](name='Hosts', description='输入测试节点的hosts'), }(name='DelayTest', description='Fill in this field when the network test type is delay testing.'), netTestType?: string(name='NetTestType', description='Network test type. For example: DelayTest for latency testing, TrafficTest for traffic testing, CommTest for communication library testing.', example='DelayTest'), networkMode?: string(name='NetworkMode', description='Network mode', example='2'), port?: string(name='Port', description='Test port number.', example='23604'), trafficTest?: { clients?: [ { bond?: string(name='Bond', description='Network card bond interface', example='bond1'), IP?: string(name='IP', description='Node IP', example='192.168.1.1'), nodeId?: string(name='NodeId', description='Node ID', example='e01-tw-w5elqg7pw18'), resourceId?: string(name='ResourceId', description='Resource ID', example='e01-cn-20s41p6cx01'), serverName?: string(name='ServerName', description='Service name.', example='xMv'), } ](name='Clients', description='Resource ID.'), duration?: long(name='Duration', description='The duration of the workflow task in seconds.', example='1'), GDR?: boolean(name='GDR', description='Enter True/False when the protocol is RDMA, this field is empty when the protocol is TCP.', example='False'), protocol?: string(name='Protocol', description='Network protocol, either RDMA or TCP.', example='TCP'), QP?: long(name='QP', description='Enter the number of concurrent connections when the protocol is TCP, or enter the configured QP value when the protocol is RDMA.', example='1'), servers?: [ { bond?: string(name='Bond', description='Network card bond interface', example='bond1'), IP?: string(name='IP', description='Node IP', example='47.121.110.190'), nodeId?: string(name='NodeId', description='Node ID', example='e01-tw-bqisacl3z6l'), resourceId?: string(name='ResourceId', description='Resource ID', example='e01-cn-wwo3etaqu0b'), serverName?: string(name='ServerName', description='Service name.', example='xMv'), } ](name='Servers', description='Service list'), trafficModel?: string(name='TrafficModel', description='Traffic model, either MTON or Fullmesh.', example='Fullmesh'), }(name='TrafficTest', description='This field is empty if the TrafficModel is Fullmesh.'), } model CreateNetTestTaskShrinkRequest { clusterId?: string(name='ClusterId', description='Cluster ID', example='i119982311660892626523'), clusterName?: string(name='ClusterName', description='Cluster name', example='Eflo-YJ-Test-Cluster'), commTestShrink?: string(name='CommTest', description='Required when the test type is communication library testing'), delayTestShrink?: string(name='DelayTest', description='Fill in this field when the network test type is delay testing.'), netTestType?: string(name='NetTestType', description='Network test type. For example: DelayTest for latency testing, TrafficTest for traffic testing, CommTest for communication library testing.', example='DelayTest'), networkMode?: string(name='NetworkMode', description='Network mode', example='2'), port?: string(name='Port', description='Test port number.', example='23604'), trafficTestShrink?: string(name='TrafficTest', description='This field is empty if the TrafficModel is Fullmesh.'), } model CreateNetTestTaskResponseBody = { requestId?: string(name='RequestId', description='ID of the request', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE*****'), testId?: string(name='TestId', description='启动测试任务ID,网络测试任务的唯一标志。', example='dr-uf6i0tv2refv8wz*****'), } model CreateNetTestTaskResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: CreateNetTestTaskResponseBody(name='body'), } /** * @summary Create Network Test Task * * @description An interface for creating a session, which returns the frontend EndPoint and initiates a periodic task to track the session status. * * @param tmpReq CreateNetTestTaskRequest * @param runtime runtime options for this request RuntimeOptions * @return CreateNetTestTaskResponse */ async function createNetTestTaskWithOptions(tmpReq: CreateNetTestTaskRequest, runtime: Util.RuntimeOptions): CreateNetTestTaskResponse { Util.validateModel(tmpReq); var request = new CreateNetTestTaskShrinkRequest{}; OpenApiUtil.convert(tmpReq, request); if (!Util.isUnset(tmpReq.commTest)) { request.commTestShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.commTest, 'CommTest', 'json'); } if (!Util.isUnset(tmpReq.delayTest)) { request.delayTestShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.delayTest, 'DelayTest', 'json'); } if (!Util.isUnset(tmpReq.trafficTest)) { request.trafficTestShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.trafficTest, 'TrafficTest', 'json'); } var body : map[string]any = {}; if (!Util.isUnset(request.clusterId)) { body['ClusterId'] = request.clusterId; } if (!Util.isUnset(request.clusterName)) { body['ClusterName'] = request.clusterName; } if (!Util.isUnset(request.commTestShrink)) { body['CommTest'] = request.commTestShrink; } if (!Util.isUnset(request.delayTestShrink)) { body['DelayTest'] = request.delayTestShrink; } if (!Util.isUnset(request.netTestType)) { body['NetTestType'] = request.netTestType; } if (!Util.isUnset(request.networkMode)) { body['NetworkMode'] = request.networkMode; } if (!Util.isUnset(request.port)) { body['Port'] = request.port; } if (!Util.isUnset(request.trafficTestShrink)) { body['TrafficTest'] = request.trafficTestShrink; } var req = new OpenApi.OpenApiRequest{ body = OpenApiUtil.parseToMap(body), }; var params = new OpenApi.Params{ action = 'CreateNetTestTask', version = '2022-12-15', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Create Network Test Task * * @description An interface for creating a session, which returns the frontend EndPoint and initiates a periodic task to track the session status. * * @param request CreateNetTestTaskRequest * @return CreateNetTestTaskResponse */ async function createNetTestTask(request: CreateNetTestTaskRequest): CreateNetTestTaskResponse { var runtime = new Util.RuntimeOptions{}; return createNetTestTaskWithOptions(request, runtime); } model CreateNodeGroupRequest { clusterId?: string(name='ClusterId', description='Cluster ID This parameter is required.', example='i118191731740041623425'), nodeGroup?: { az?: string(name='Az', description='Availability Zone This parameter is required.', example='cn-wulanchabu-b'), fileSystemMountEnabled?: boolean(name='FileSystemMountEnabled'), imageId?: string(name='ImageId', description='Image ID. This parameter is required.', example='i191887641687336652616'), keyPairName?: string(name='KeyPairName', description='The name of the key pair.', example='test-keypair'), machineType?: string(name='MachineType', description='Machine type This parameter is required.', example='mock-machine-type3'), nodeGroupDescription?: string(name='NodeGroupDescription', description='Node group description', example='describe for node group'), nodeGroupName?: string(name='NodeGroupName', description='Node group name This parameter is required.', example='PAI-LINGJUN'), systemDisk?: { category?: string(name='Category', description='Disk performance level', example='cloud_essd'), performanceLevel?: string(name='PerformanceLevel', description='The performance level of the disk if the disk is an ESSD. Valid values: * PL0: A single ESSD can deliver up to 10,000 random read/write IOPS. * PL1: A single ESSD can deliver up to 50,000 random read/write IOPS. Default value: PL1. For information about ESSD performance levels, see [ESSDs](https://help.aliyun.com/document_detail/122389.html).', example='PL!'), size?: int32(name='Size', description='System disk size', example='250'), }(name='SystemDisk', description='SystemDisk'), userData?: string(name='UserData', description='user data', example='#!/bin/bash uptime echo "aaaaaaa" >> /tmp/ttttt20250110141010.sh'), }(name='NodeGroup', description='Node ID. This parameter is required.'), nodeUnit?: map[string]any(name='NodeUnit', description='Node information'), } model CreateNodeGroupShrinkRequest { clusterId?: string(name='ClusterId', description='Cluster ID This parameter is required.', example='i118191731740041623425'), nodeGroupShrink?: string(name='NodeGroup', description='Node ID. This parameter is required.'), nodeUnitShrink?: string(name='NodeUnit', description='Node information'), } model CreateNodeGroupResponseBody = { nodeGroupId?: string(name='NodeGroupId', description='Node group ID', example='ng-ec3c96ff0aa4c60d'), nodeGroupName?: string(name='NodeGroupName', description='Node group name', example='emr-default'), requestId?: string(name='RequestId', description='ID of the request', example='887FA855-89F4-5DB3-B305-C5879EC480E6'), } model CreateNodeGroupResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: CreateNodeGroupResponseBody(name='body'), } /** * @summary Create Node Group under Cluster * * @description An interface for creating a session, which returns the frontend EndPoint and initiates a periodic task to track the session status * * @param tmpReq CreateNodeGroupRequest * @param runtime runtime options for this request RuntimeOptions * @return CreateNodeGroupResponse */ async function createNodeGroupWithOptions(tmpReq: CreateNodeGroupRequest, runtime: Util.RuntimeOptions): CreateNodeGroupResponse { Util.validateModel(tmpReq); var request = new CreateNodeGroupShrinkRequest{}; OpenApiUtil.convert(tmpReq, request); if (!Util.isUnset(tmpReq.nodeGroup)) { request.nodeGroupShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.nodeGroup, 'NodeGroup', 'json'); } if (!Util.isUnset(tmpReq.nodeUnit)) { request.nodeUnitShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.nodeUnit, 'NodeUnit', 'json'); } var body : map[string]any = {}; if (!Util.isUnset(request.clusterId)) { body['ClusterId'] = request.clusterId; } if (!Util.isUnset(request.nodeGroupShrink)) { body['NodeGroup'] = request.nodeGroupShrink; } if (!Util.isUnset(request.nodeUnitShrink)) { body['NodeUnit'] = request.nodeUnitShrink; } var req = new OpenApi.OpenApiRequest{ body = OpenApiUtil.parseToMap(body), }; var params = new OpenApi.Params{ action = 'CreateNodeGroup', version = '2022-12-15', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Create Node Group under Cluster * * @description An interface for creating a session, which returns the frontend EndPoint and initiates a periodic task to track the session status * * @param request CreateNodeGroupRequest * @return CreateNodeGroupResponse */ async function createNodeGroup(request: CreateNodeGroupRequest): CreateNodeGroupResponse { var runtime = new Util.RuntimeOptions{}; return createNodeGroupWithOptions(request, runtime); } model CreateSessionRequest { nodeId?: string(name='NodeId', description='Instance ID.', example='e01-cn-kvw44e6dn04'), sessionType?: string(name='SessionType', description='Session type corresponding to the session package.', example='N 两种: Sol:基于串口[默认] Assistant:基于云助手'), startTime?: string(name='StartTime', description='Initiation time, 13-digit timestamp.', example='1669340937156'), } model CreateSessionResponseBody = { requestId?: string(name='RequestId', description='ID of the request', example='887FA855-89F4-5DB3-B305-C5879EC480E6'), serverSn?: string(name='ServerSn', description='节点 ID。', example='2A59143F1'), sessionId?: string(name='SessionId', description='Session ID.', example='i207023871669364793713'), sessionToken?: string(name='SessionToken', description='Session token.', example='03f53c719015a9ad4f4f55d66cac2dac161b18e8065ca75a3220b89de389c980'), wssEndpoint?: string(name='WssEndpoint', description='WebSocket address', example='ws://x.x.x.x:xx/calypso_web_console'), } model CreateSessionResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: CreateSessionResponseBody(name='body'), } /** * @summary Create Web Terminal Session * * @description An interface for creating a session, which returns the frontend EndPoint and initiates a periodic task to track the session status. * * @param request CreateSessionRequest * @param runtime runtime options for this request RuntimeOptions * @return CreateSessionResponse */ async function createSessionWithOptions(request: CreateSessionRequest, runtime: Util.RuntimeOptions): CreateSessionResponse { Util.validateModel(request); var body : map[string]any = {}; if (!Util.isUnset(request.nodeId)) { body['NodeId'] = request.nodeId; } if (!Util.isUnset(request.sessionType)) { body['SessionType'] = request.sessionType; } if (!Util.isUnset(request.startTime)) { body['StartTime'] = request.startTime; } var req = new OpenApi.OpenApiRequest{ body = OpenApiUtil.parseToMap(body), }; var params = new OpenApi.Params{ action = 'CreateSession', version = '2022-12-15', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Create Web Terminal Session * * @description An interface for creating a session, which returns the frontend EndPoint and initiates a periodic task to track the session status. * * @param request CreateSessionRequest * @return CreateSessionResponse */ async function createSession(request: CreateSessionRequest): CreateSessionResponse { var runtime = new Util.RuntimeOptions{}; return createSessionWithOptions(request, runtime); } model CreateVscRequest { clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'), nodeId?: string(name='NodeId', description='This parameter is required.', example='e01-cn-zvp2tgykr08'), resourceGroupId?: string(name='ResourceGroupId', example='rg-aek2xdkc6icwfha'), tag?: [ { key?: string(name='Key', example='key001'), value?: string(name='Value', example='value001'), } ](name='Tag'), vscName?: string(name='VscName', example='test_name'), vscType?: string(name='VscType', example='primary'), } model CreateVscResponseBody = { requestId?: string(name='RequestId', description='Id of the request', example='887FA855-89F4-5DB3-B305-C5879EC480E6'), vscId?: string(name='VscId', example='vsc-001'), } model CreateVscResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: CreateVscResponseBody(name='body'), } /** * @summary 创建Vsc * * @param request CreateVscRequest * @param runtime runtime options for this request RuntimeOptions * @return CreateVscResponse */ async function createVscWithOptions(request: CreateVscRequest, runtime: Util.RuntimeOptions): CreateVscResponse { Util.validateModel(request); var query = {}; if (!Util.isUnset(request.clientToken)) { query['ClientToken'] = request.clientToken; } var body : map[string]any = {}; if (!Util.isUnset(request.nodeId)) { body['NodeId'] = request.nodeId; } if (!Util.isUnset(request.resourceGroupId)) { body['ResourceGroupId'] = request.resourceGroupId; } if (!Util.isUnset(request.tag)) { body['Tag'] = request.tag; } if (!Util.isUnset(request.vscName)) { body['VscName'] = request.vscName; } if (!Util.isUnset(request.vscType)) { body['VscType'] = request.vscType; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), body = OpenApiUtil.parseToMap(body), }; var params = new OpenApi.Params{ action = 'CreateVsc', version = '2022-12-15', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary 创建Vsc * * @param request CreateVscRequest * @return CreateVscResponse */ async function createVsc(request: CreateVscRequest): CreateVscResponse { var runtime = new Util.RuntimeOptions{}; return createVscWithOptions(request, runtime); } model DeleteClusterRequest { clusterId?: string(name='ClusterId', description='Cluster ID This parameter is required.', example='i116913051662373010974'), } model DeleteClusterResponseBody = { requestId?: string(name='RequestId', description='Request Id', example='0FC4A1C7-421C-5EAB-9361-4C0338EFA287'), } model DeleteClusterResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: DeleteClusterResponseBody(name='body'), } /** * @summary Delete cluster instance * * @param request DeleteClusterRequest * @param runtime runtime options for this request RuntimeOptions * @return DeleteClusterResponse */ async function deleteClusterWithOptions(request: DeleteClusterRequest, runtime: Util.RuntimeOptions): DeleteClusterResponse { Util.validateModel(request); var body : map[string]any = {}; if (!Util.isUnset(request.clusterId)) { body['ClusterId'] = request.clusterId; } var req = new OpenApi.OpenApiRequest{ body = OpenApiUtil.parseToMap(body), }; var params = new OpenApi.Params{ action = 'DeleteCluster', version = '2022-12-15', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Delete cluster instance * * @param request DeleteClusterRequest * @return DeleteClusterResponse */ async function deleteCluster(request: DeleteClusterRequest): DeleteClusterResponse { var runtime = new Util.RuntimeOptions{}; return deleteClusterWithOptions(request, runtime); } model DeleteNodeGroupRequest { clusterId?: string(name='ClusterId', description='Cluster ID', example='i114444141733395242745'), nodeGroupId?: string(name='NodeGroupId', description='Node Group ID', example='i121824791737080429819'), } model DeleteNodeGroupResponseBody = { requestId?: string(name='RequestId', description='ID of the request', example='887FA855-89F4-5DB3-B305-C5879EC480E6'), } model DeleteNodeGroupResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: DeleteNodeGroupResponseBody(name='body'), } /** * @summary Delete Node Group * * @description An interface for creating a session, which returns the front-end EndPoint and initiates a periodic task to track the session status. * * @param request DeleteNodeGroupRequest * @param runtime runtime options for this request RuntimeOptions * @return DeleteNodeGroupResponse */ async function deleteNodeGroupWithOptions(request: DeleteNodeGroupRequest, runtime: Util.RuntimeOptions): DeleteNodeGroupResponse { Util.validateModel(request); var body : map[string]any = {}; if (!Util.isUnset(request.clusterId)) { body['ClusterId'] = request.clusterId; } if (!Util.isUnset(request.nodeGroupId)) { body['NodeGroupId'] = request.nodeGroupId; } var req = new OpenApi.OpenApiRequest{ body = OpenApiUtil.parseToMap(body), }; var params = new OpenApi.Params{ action = 'DeleteNodeGroup', version = '2022-12-15', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Delete Node Group * * @description An interface for creating a session, which returns the front-end EndPoint and initiates a periodic task to track the session status. * * @param request DeleteNodeGroupRequest * @return DeleteNodeGroupResponse */ async function deleteNodeGroup(request: DeleteNodeGroupRequest): DeleteNodeGroupResponse { var runtime = new Util.RuntimeOptions{}; return deleteNodeGroupWithOptions(request, runtime); } model DeleteVscRequest { clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'), vscId?: string(name='VscId', description='This parameter is required.', example='vsc-001'), } model DeleteVscResponseBody = { requestId?: string(name='RequestId', description='Id of the request', example='4FD06DF0-9167-5C6F-A145-F30CA4A15D54'), } model DeleteVscResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: DeleteVscResponseBody(name='body'), } /** * @summary 删除Vsc * * @param request DeleteVscRequest * @param runtime runtime options for this request RuntimeOptions * @return DeleteVscResponse */ async function deleteVscWithOptions(request: DeleteVscRequest, runtime: Util.RuntimeOptions): DeleteVscResponse { Util.validateModel(request); var query = {}; if (!Util.isUnset(request.clientToken)) { query['ClientToken'] = request.clientToken; } var body : map[string]any = {}; if (!Util.isUnset(request.vscId)) { body['VscId'] = request.vscId; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), body = OpenApiUtil.parseToMap(body), }; var params = new OpenApi.Params{ action = 'DeleteVsc', version = '2022-12-15', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary 删除Vsc * * @param request DeleteVscRequest * @return DeleteVscResponse */ async function deleteVsc(request: DeleteVscRequest): DeleteVscResponse { var runtime = new Util.RuntimeOptions{}; return deleteVscWithOptions(request, runtime); } model DescribeClusterRequest { clusterId?: string(name='ClusterId', description='Cluster ID. This parameter is required.', example='i119982311660892626523'), } model DescribeClusterResponseBody = { clusterDescription?: string(name='ClusterDescription', description='Cluster Description', example='Default cluster'), clusterId?: string(name='ClusterId', description='Cluster ID', example='i116913051662373010974'), clusterName?: string(name='ClusterName', description='Cluster Name', example='Eflo-YJ-Test-Cluster'), clusterType?: string(name='ClusterType', description='Cluster Type', example='AckEdgePro'), components?: [ { componentId?: string(name='ComponentId', description='Component ID', example='i149549021660892626529'), componentType?: string(name='ComponentType', description='Component Type', example='ACKEdge'), } ](name='Components', description='Component Information'), computingIpVersion?: string(name='ComputingIpVersion', description='Type of IP in the compute network', example='IPv4'), createTime?: string(name='CreateTime', description='Creation Time', example='2022-06-08T07:05:11Z'), hpnZone?: string(name='HpnZone', description='Cluster Number', example='A2'), networks?: { vpdId?: string(name='VpdId'), }(name='Networks', description='Network Information'), nodeCount?: long(name='NodeCount', description='Number of Nodes', example='2'), nodeGroupCount?: long(name='NodeGroupCount', description='Number of Node Groups', example='2'), openEniJumboFrame?: string(name='OpenEniJumboFrame', description='Open Eni Jumbo Frame', example='close'), operatingState?: string(name='OperatingState', description='Cluster State', example='running'), requestId?: string(name='RequestId', description='Request ID.', example='887FA855-89F4-5DB3-B305-C5879EC480E6'), resourceGroupId?: string(name='ResourceGroupId', description='Resource Group ID', example='rg-aek2k3rqlvv6ytq'), taskId?: string(name='TaskId', description='Task ID', example='i152609221670466904596'), updateTime?: string(name='UpdateTime', description='Update Time', example='2022-08-23T06:36:17.000Z'), vpcId?: string(name='VpcId', description='VPC ID', example='vpc-0jlkqysom5dmcviymep3f'), } model DescribeClusterResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: DescribeClusterResponseBody(name='body'), } /** * @summary Cluster Details * * @param request DescribeClusterRequest * @param runtime runtime options for this request RuntimeOptions * @return DescribeClusterResponse */ async function describeClusterWithOptions(request: DescribeClusterRequest, runtime: Util.RuntimeOptions): DescribeClusterResponse { Util.validateModel(request); var body : map[string]any = {}; if (!Util.isUnset(request.clusterId)) { body['ClusterId'] = request.clusterId; } var req = new OpenApi.OpenApiRequest{ body = OpenApiUtil.parseToMap(body), }; var params = new OpenApi.Params{ action = 'DescribeCluster', version = '2022-12-15', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Cluster Details * * @param request DescribeClusterRequest * @return DescribeClusterResponse */ async function describeCluster(request: DescribeClusterRequest): DescribeClusterResponse { var runtime = new Util.RuntimeOptions{}; return describeClusterWithOptions(request, runtime); } model DescribeDiagnosticResultRequest { diagnosticId?: string(name='DiagnosticId', description='Diagnostic ID', example='diag-i151942361720577788844'), } model DescribeDiagnosticResultResponseBody = { clusterId?: string(name='ClusterId', description='Cluster ID', example='i118913031696573280136'), createdTime?: string(name='CreatedTime', description='Device creation time.', example='2024-06-15T10:17:56'), diagnosticId?: string(name='DiagnosticId', description='Diagnostic ID', example='diag-i155363241720059671316'), diagnosticResults?: [ any ](name='DiagnosticResults', description='Diagnostic Information'), diagnosticState?: string(name='DiagnosticState', description='Diagnostic State', example='Fault'), diagnosticType?: string(name='DiagnosticType', description='Diagnostic Type', example='CheckByAiJobLogs'), endTime?: string(name='EndTime', description='End time of node anomaly issues. Represented according to the ISO8601 standard, in a timezone-aware format, formatted as yyyy-MM-ddTHH:mm:ss+0800', example='2024-06-11T10:00:30'), nodeIds?: [ string ](name='NodeIds', description='List of Node IDs'), requestId?: string(name='RequestId', description='Request ID', example='8F065DDD-6996-5973-9691-9EC57BD0072E'), } model DescribeDiagnosticResultResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: DescribeDiagnosticResultResponseBody(name='body'), } /** * @summary Diagnostic Task Query Interface * * @description An interface for creating a session, which returns the front-end EndPoint and initiates a periodic task to track the session status. * * @param request DescribeDiagnosticResultRequest * @param runtime runtime options for this request RuntimeOptions * @return DescribeDiagnosticResultResponse */ async function describeDiagnosticResultWithOptions(request: DescribeDiagnosticResultRequest, runtime: Util.RuntimeOptions): DescribeDiagnosticResultResponse { Util.validateModel(request); var body : map[string]any = {}; if (!Util.isUnset(request.diagnosticId)) { body['DiagnosticId'] = request.diagnosticId; } var req = new OpenApi.OpenApiRequest{ body = OpenApiUtil.parseToMap(body), }; var params = new OpenApi.Params{ action = 'DescribeDiagnosticResult', version = '2022-12-15', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Diagnostic Task Query Interface * * @description An interface for creating a session, which returns the front-end EndPoint and initiates a periodic task to track the session status. * * @param request DescribeDiagnosticResultRequest * @return DescribeDiagnosticResultResponse */ async function describeDiagnosticResult(request: DescribeDiagnosticResultRequest): DescribeDiagnosticResultResponse { var runtime = new Util.RuntimeOptions{}; return describeDiagnosticResultWithOptions(request, runtime); } model DescribeInvocationsRequest { contentEncoding?: string(name='ContentEncoding', description='Sets the encoding method for the `CommandContent` and `Output` fields in the returned data. Possible values: - PlainText: Returns the original command content and output information. - Base64: Returns the Base64-encoded command content and output information. Default value: Base64.', example='PlainText'), includeOutput?: boolean(name='IncludeOutput', description='Indicates whether to return the output information of the command execution in the result. - true: Return. In this case, you must specify at least the `InvokeId` or `InstanceId` parameter. - false: Do not return. Default value: false.', example='true'), invokeId?: string(name='InvokeId', description='Command execution ID This parameter is required.', example='t-cd03crwys0lrls0'), nodeId?: string(name='NodeId', description='Instance ID', example='e01-cn-zvp2tgykr08'), } model DescribeInvocationsResponseBody = { invocations?: { invocation?: [ { commandContent?: string(name='CommandContent', description='Command content. - If `ContentEncoding` is set to `PlainText`, the original script content is returned. - If `ContentEncoding` is set to `Base64`, the Base64-encoded script content is returned.', example='cnBtIC1xYSB8IGdyZXAgdnNm****'), commandDescription?: string(name='CommandDescription', description='Command description.', example='testDescription'), commandName?: string(name='CommandName', description='Command name.', example='CommandTestName'), creationTime?: string(name='CreationTime', description='The creation time of the task.', example='2020-01-19T09:15:46Z'), frequency?: string(name='Frequency', description='The execution time for scheduled commands.'), invocationStatus?: string(name='InvocationStatus', description='The overall execution status of the command, which depends on the common execution status of all instances involved in the call. Possible values: - Pending: The system is validating or sending the command. If at least one instance has a command execution status of Pending, the overall status is Pending. - Scheduled: The scheduled command has been sent and is waiting to run. If at least one instance has a command execution status of Scheduled, the overall status is Scheduled. - Running: The command is running on the instance. If at least one instance has a command execution status of Running, the overall status is Running. - Success: The command execution status of all instances is Stopped or Success, and at least one instance\\\\"s command execution status is Success. The overall status is Success. - For immediately executed tasks: The command has completed with an exit code of 0. - For periodically executed tasks: The most recent execution was successful with an exit code of 0, and the specified times have all been completed. - Failed: The command execution status of all instances is Stopped or Failed. The overall status is Failed if any of the following conditions apply to the instance\\\\"s command execution status: - Command validation failed (Invalid). - Command sending failed (Aborted). - Command completed but the exit code is not 0 (Failed). - Command execution timed out (Timeout). - Command execution encountered an error (Error). - Stopping: The task is being stopped. If at least one instance has a command execution status of Stopping, the overall status is Stopping. - Stopped: The task has been stopped. If all instances\\\\" command execution statuses are Stopped, the overall status is Stopped. The overall status is Stopped if the instance\\\\"s command execution status is any of the following: - The task was canceled (Cancelled). - The task was terminated (Terminated). - PartialFailed: Some instances succeeded and some failed. If the command execution statuses of all instances are Success, Failed, or Stopped, the overall status is PartialFailed. > The `InvokeStatus` in the response parameters is similar in meaning to this parameter, but it is recommended that you check this return value.', example='Success'), invokeId?: string(name='InvokeId', description='Command execution ID.', example='t-ind3k9ytvvduoe8'), invokeNodes?: { invokeNode?: [ { creationTime?: string(name='CreationTime', description='The start time of the command execution.', example='2023-02-06T07:12:50Z'), dropped?: int32(name='Dropped', description='The length of the text that is truncated and discarded when the length of the `Output` field exceeds 24 KB.', example='0'), errorCode?: string(name='ErrorCode', description='Reason code for file delivery failure. Possible values: - Empty: File delivery is normal. - NodeNotExists: The specified instance does not exist or has been released. - NodeReleased: The instance was released during the file delivery process. - NodeNotRunning: The instance was not running when the file delivery task was created. - AccountNotExists: The specified account does not exist. - ClientNotRunning: The Cloud Assistant Agent is not running. - ClientNotResponse: The Cloud Assistant Agent is not responding. - ClientIsUpgrading: The Cloud Assistant Agent is currently upgrading. - ClientNeedUpgrade: The Cloud Assistant Agent needs to be upgraded. - DeliveryTimeout: File sending timed out. - FileCreateFail: File creation failed. - FileAlreadyExists: A file with the same name already exists at the specified path. - FileContentInvalid: The file content is invalid. - FileNameInvalid: The file name is invalid. - FilePathInvalid: The file path is invalid. - FileAuthorityInvalid: The file permissions are invalid. - UserGroupNotExists: The user group specified for file sending does not exist.', example='NodeNotExists:'), errorInfo?: string(name='ErrorInfo', description='Details of the reason for command delivery failure or execution failure, possible values: - Empty: The command executed normally. - the specified node does not exist: The specified instance does not exist or has been released. - the node was released when creating the task: The instance was released during command execution. - the node is not running when creating the task: The instance was not in a running state when the command was executed. - the command is not applicable: The command is not applicable to the specified instance. - the specified account does not exist: The specified account does not exist. - the specified directory does not exist: The specified directory does not exist. - the cron job expression is invalid: The specified execution time expression is invalid. - the aliyun service is not running on the instance: The Cloud Assistant Agent is not running. - the aliyun service in the instance does not respond: The Cloud Assistant Agent is not responding. - the aliyun service in the node is upgrading now: The Cloud Assistant Agent is currently being upgraded. - the aliyun service in the node needs upgrade: The Cloud Assistant Agent needs an upgrade. - the command delivery has timed out: Command delivery has timed out. - the command execution has timed out: Command execution has timed out. - the command execution got an exception: An exception occurred during command execution. - the command execution was interrupted: Command execution was interrupted. - the command execution exit code is not zero: Command execution completed with a non-zero exit code. - the specified node has been released: The instance was released during file delivery.', example='the specified node does not exists'), exitCode?: int32(name='ExitCode', description='The exit code of the command process. Possible values: - For Linux instances, it is the exit code of the Shell process. - For Windows instances, it is the exit code of the Bat or PowerShell process.', example='0'), finishTime?: string(name='FinishTime', description='Completion time.', example='2023-02-06T07:12:50Z'), invocationStatus?: string(name='InvocationStatus', description='The command progress status for a single instance. Possible values: - Pending: The system is validating or sending the command. - Invalid: The specified command type or parameters are incorrect. - Aborted: Failed to send the command to the instance. The instance must be running, and the command should be sent within 1 minute. - Running: The command is running on the instance. - Success: - For a one-time execution command: The command has completed with an exit code of 0. - For a periodic execution command: The last run was successful with an exit code of 0, and the specified period has ended. - Failed: - For a one-time execution command: The command has completed with a non-zero exit code. - For a periodic execution command: The last run was successful with a non-zero exit code, and the specified period will be terminated. - Error: An exception occurred during command execution, and it cannot continue. - Timeout: The command execution timed out. - Cancelled: The command execution action has been canceled, and the command was never started. - Stopping: The task is being stopped. - Terminated: The command was terminated while running. - Scheduled: - For a one-time execution command: Not applicable, will not appear. - For a periodic execution command: Waiting to run.', example='Pending'), nodeId?: string(name='NodeId', description='Node ID', example='e01-cn-lbj36wkp70b'), nodeInvokeStatus?: string(name='NodeInvokeStatus', description='The command progress status of a single instance.', example='Finished'), output?: string(name='Output', description='The output information of the command. - If `ContentEncoding` is set to `PlainText`, the original output information is returned. - If `ContentEncoding` is set to `Base64`, the Base64-encoded output information is returned.', example='OutPutTestmsg'), repeats?: int32(name='Repeats', description='The number of times the command has been executed on this instance. - If the execution mode is one-time, the value is 0 or 1. - If the execution mode is periodic, the value is the number of times it has been executed.', example='0'), startTime?: string(name='StartTime', description='Start Time', example='2019-12-20T06:15:55Z'), stopTime?: string(name='StopTime', description='The time when `StopInvocation` was called to stop the command execution.', example='2019-12-20T06:15:55Z'), timed?: string(name='Timed', description='Whether the queried command will be automatically executed in the future. The value range is as follows: - true: The command, when executed by calling `RunCommand` or `InvokeCommand`, has the `RepeatMode` parameter set to `Period`, `NextRebootOnly`, or `EveryReboot`. - false: Queries commands in the following two states. - When executing a command via `RunCommand` or `InvokeCommand`, the `RepeatMode` parameter is set to `Once`. - Commands that have been canceled, stopped, or completed. Default value: false.', example='false'), updateTime?: string(name='UpdateTime', description='Update Time', example='2023-02-06T07:12:50Z'), } ](name='InvokeNode', description='Command execution records for nodes.'), }(name='InvokeNodes', description='Command execution records.'), invokeStatus?: string(name='InvokeStatus', description='The overall execution status of the command. The overall execution status depends on the common execution status of one or more instances in the execution. Possible values: - Running: - For scheduled execution: The execution status remains ongoing until the scheduled command is manually stopped. - For single execution: If there is any command process running, the overall execution status is ongoing. - Finished: - For scheduled execution: The command process cannot be completed. - For single execution: All instances have completed execution, or some instances\\\\" command processes are manually stopped and the rest have completed. - Failed: - For scheduled execution: The command process cannot fail. - For single execution: All instances have failed to execute. - Stopped: The command has been stopped. - Stopping: The command is being stopped. - PartialFailed: Partial failure; if the `InstanceId` parameter is set, this does not apply.', example='Running'), parameters?: string(name='Parameters', description='Custom parameters in the command.', example='{}'), repeatMode?: string(name='RepeatMode', description='命令执行的方式。可能值: Once:立即执行命令。 Period:定时执行命令。 NextRebootOnly:当实例下一次启动时,自动执行命令。 EveryReboot:实例每一次启动都将自动执行命令。', example='Once'), timeout?: int32(name='Timeout', description='Timeout for executing the command, in seconds.', example='60'), username?: string(name='Username', description='Username for executing the command.', example='root'), workingDir?: string(name='WorkingDir', description='The working directory of the command on the instance.', example='/home'), } ](name='Invocation', description='File delivery record.'), }(name='Invocations', description='Script execution record object.'), requestId?: string(name='RequestId', description='Request ID', example='4FD06DF0-9167-5C6F-A145-F30CA4A15D54'), } model DescribeInvocationsResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: DescribeInvocationsResponseBody(name='body'), } /** * @summary Query the list and status of operations assistant command executions * * @param request DescribeInvocationsRequest * @param runtime runtime options for this request RuntimeOptions * @return DescribeInvocationsResponse */ async function describeInvocationsWithOptions(request: DescribeInvocationsRequest, runtime: Util.RuntimeOptions): DescribeInvocationsResponse { Util.validateModel(request); var body : map[string]any = {}; if (!Util.isUnset(request.contentEncoding)) { body['ContentEncoding'] = request.contentEncoding; } if (!Util.isUnset(request.includeOutput)) { body['IncludeOutput'] = request.includeOutput; } if (!Util.isUnset(request.invokeId)) { body['InvokeId'] = request.invokeId; } if (!Util.isUnset(request.nodeId)) { body['NodeId'] = request.nodeId; } var req = new OpenApi.OpenApiRequest{ body = OpenApiUtil.parseToMap(body), }; var params = new OpenApi.Params{ action = 'DescribeInvocations', version = '2022-12-15', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Query the list and status of operations assistant command executions * * @param request DescribeInvocationsRequest * @return DescribeInvocationsResponse */ async function describeInvocations(request: DescribeInvocationsRequest): DescribeInvocationsResponse { var runtime = new Util.RuntimeOptions{}; return describeInvocationsWithOptions(request, runtime); } model DescribeNetTestResultRequest { testId?: string(name='TestId', description='Test task ID.', example='dr-uf6i0tv2refv8wz*****'), } model DescribeNetTestResultResponseBody = { clusterId?: string(name='ClusterId', description='Cluster ID.', example='i119982311660892626523'), clusterName?: string(name='ClusterName', description='Cluster name.', example='Standard_Cluster'), commTest?: { GPUNum?: string(name='GPUNum', description='Number of GPUs', example='1'), hosts?: [ { IP?: string(name='IP', description='IP address', example='169.253.253.15'), resourceId?: string(name='ResourceId', description='Resource ID', example='i111670831721110797708'), serverName?: string(name='ServerName', description='服务名称。', example='VBw'), } ](name='Hosts', description='Resource ID'), model?: string(name='Model', description='Communication library model', example='intention_v4'), type?: string(name='Type', description='Communication library test category: ACCL or NCCL', example='ACCL'), }(name='CommTest', description='Fill in when the traffic test type is communication library test'), creationTime?: string(name='CreationTime', description='Diagnosis task creation time.', example='2024-10-15T10:25:42+08:00'), delayTest?: { hosts?: [ { bond?: string(name='Bond', description='Network card bond interface', example='bond1'), IP?: string(name='IP', description='Node IP', example='125.210.225.48'), resourceId?: string(name='ResourceId', description='Resource ID', example='e01-cn-bcd3u1aee06'), serverName?: string(name='ServerName', description='Service name', example='NQU'), } ](name='Hosts', description='Input the hosts of the test nodes'), }(name='DelayTest', description='Fill in when the network test type is latency test'), finishedTime?: string(name='FinishedTime', description='Diagnosis task completion time.', example='2024-10-16T02:04Z'), netTestType?: string(name='NetTestType', description='Network test type.', example='DelayTest'), port?: string(name='Port', description='Test port number.', example='23604'), requestId?: string(name='RequestId', description='Request ID', example='8F065DDD-6996-5973-9691-9EC57BD0072E'), resultDetial?: string(name='ResultDetial', description='Details of the diagnosis result. Returned as a JSON string.', example='{}'), status?: string(name='Status', description='Diagnosis task status. Possible values: - InProgress: Diagnosis in progress. - Finished: Diagnosis completed. - Failed: Diagnosis failed.', example='Failed'), testId?: string(name='TestId', description='Initiated test task ID, which is the unique identifier for the network test task.', example='af35ce53-7c35-4277-834a-fbf49c316a96'), trafficTest?: { clients?: [ { bond?: string(name='Bond', description='Network card bond interface', example='bond1'), IP?: string(name='IP', description='Node IP', example='192.168.1.1'), resourceId?: string(name='ResourceId', description='Resource ID', example='e01-cn-20s41p6cx01'), serverName?: string(name='ServerName', description='服务名称。', example='xMv'), } ](name='Clients', description='Resource ID.'), duration?: long(name='Duration', description='Duration of the workflow task in seconds.', example='1'), GDR?: string(name='GDR', description='For RDMA, enter True/False; for TCP, this field is empty.', example='False'), protocol?: string(name='Protocol', description='Network protocol, either RDMA or TCP.', example='TCP'), QP?: long(name='QP', description='For TCP, enter the number of concurrent test connections; for RDMA, enter the configured QP value.', example='1'), servers?: [ { bond?: string(name='Bond', description='Network card bond interface', example='bond1'), IP?: string(name='IP', description='Node IP', example='47.121.110.190'), resourceId?: string(name='ResourceId', description='Resource ID', example='e01-cn-wwo3etaqu0b'), serverName?: string(name='ServerName', description='Service name', example='xMv'), } ](name='Servers', description='List of servers'), trafficModel?: string(name='TrafficModel', description='Traffic model, either MTON or Fullmesh.', example='Fullmesh'), }(name='TrafficTest', description='This field is empty if the traffic model (TrafficModel) is Fullmesh.'), } model DescribeNetTestResultResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: DescribeNetTestResultResponseBody(name='body'), } /** * @summary Query Network Test Result * * @description An interface for creating a session, returning the front-end EndPoint, and initiating a periodic task to track the session status * * @param request DescribeNetTestResultRequest * @param runtime runtime options for this request RuntimeOptions * @return DescribeNetTestResultResponse */ async function describeNetTestResultWithOptions(request: DescribeNetTestResultRequest, runtime: Util.RuntimeOptions): DescribeNetTestResultResponse { Util.validateModel(request); var body : map[string]any = {}; if (!Util.isUnset(request.testId)) { body['TestId'] = request.testId; } var req = new OpenApi.OpenApiRequest{ body = OpenApiUtil.parseToMap(body), }; var params = new OpenApi.Params{ action = 'DescribeNetTestResult', version = '2022-12-15', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Query Network Test Result * * @description An interface for creating a session, returning the front-end EndPoint, and initiating a periodic task to track the session status * * @param request DescribeNetTestResultRequest * @return DescribeNetTestResultResponse */ async function describeNetTestResult(request: DescribeNetTestResultRequest): DescribeNetTestResultResponse { var runtime = new Util.RuntimeOptions{}; return describeNetTestResultWithOptions(request, runtime); } model DescribeNodeRequest { nodeId?: string(name='NodeId', description='Node ID This parameter is required.', example='mock-sn-2060'), } model DescribeNodeResponseBody = { clusterId?: string(name='ClusterId', description='Cluster ID', example='i116913051662373010974'), clusterName?: string(name='ClusterName', description='Cluster name', example='Standard_Cluster'), createTime?: string(name='CreateTime', description='Creation time', example='2022-09-30T03:35:53Z'), disks?: [ { category?: string(name='Category', description='The category of the disk. * cloud_ssd: all-flash disk.', example='cloud_essd'), diskId?: string(name='DiskId', description='The ID of the disk.', example='d-bp1fi88ryk4yah8a6yos'), performanceLevel?: string(name='PerformanceLevel', description='The performance level of the ESSD. Valid values: * PL0: A single ESSD can deliver up to 10,000 random read/write IOPS. * PL1: A single ESSD can deliver up to 50,000 random read/write IOPS.', example='PL1'), size?: int32(name='Size', description='The size of the disk. Unit: GiB.', example='100'), type?: string(name='Type', description='The type of the disk. Valid values: * system: system disk', example='system'), } ](name='Disks', description='Disk infos'), expiredTime?: string(name='ExpiredTime', description='Expiration time', example='2022-06-23T16:00:00Z'), fileSystemMountEnabled?: boolean(name='FileSystemMountEnabled', description='是否支持文件存储挂载'), hostname?: string(name='Hostname', description='Hostname', example='31d38530-241e-11ed-bc63-acde48001122'), hpnZone?: string(name='HpnZone', description='Cluster number', example='A1'), imageId?: string(name='ImageId', description='Image ID', example='i190297201634099844192'), imageName?: string(name='ImageName', description='Image name', example='Centos7.9_all_0811'), machineType?: string(name='MachineType', description='Machine type', example='efg1.nvga1'), networks?: [ { bondName?: string(name='BondName', description='Network interface port information', example='Bond0'), ip?: string(name='Ip', description='Machine IP', example='47.254.235.44'), subnetId?: string(name='SubnetId', description='Cluster subnet ID', example='vsw-uf68v51fldm5egmui5a6k'), vpdId?: string(name='VpdId', description='Cluster network ID', example='vpd-xcuhjyrj'), } ](name='Networks', description='Network information'), nodeGroupId?: string(name='NodeGroupId', description='Node group ID', example='ng-ec3c96ff0aa4c60d'), nodeGroupName?: string(name='NodeGroupName', description='Node group name', example='emr-default'), nodeId?: string(name='NodeId', description='Node ID', example='e01-cn-zvp2tgykr08'), operatingState?: string(name='OperatingState', description='Node status', example='Using'), requestId?: string(name='RequestId', description='Request ID', example='AC4F0004-7BCE-52E0-891B-CAC7D64E3368'), resourceGroupId?: string(name='ResourceGroupId', description='Resource group ID', example='rg-acfmywpvugkh7kq'), sn?: string(name='Sn', description='Unique machine identifier', example='sag42ckf4jx'), userData?: string(name='UserData', description='The script by user defined', example='#!/bin/bash uptime echo "aaaaaaa" >> /tmp/ttttt20250110141010.sh'), zoneId?: string(name='ZoneId', description='Zone ID', example='cn-hangzhou-i'), } model DescribeNodeResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: DescribeNodeResponseBody(name='body'), } /** * @summary Query node list * * @param request DescribeNodeRequest * @param runtime runtime options for this request RuntimeOptions * @return DescribeNodeResponse */ async function describeNodeWithOptions(request: DescribeNodeRequest, runtime: Util.RuntimeOptions): DescribeNodeResponse { Util.validateModel(request); var body : map[string]any = {}; if (!Util.isUnset(request.nodeId)) { body['NodeId'] = request.nodeId; } var req = new OpenApi.OpenApiRequest{ body = OpenApiUtil.parseToMap(body), }; var params = new OpenApi.Params{ action = 'DescribeNode', version = '2022-12-15', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Query node list * * @param request DescribeNodeRequest * @return DescribeNodeResponse */ async function describeNode(request: DescribeNodeRequest): DescribeNodeResponse { var runtime = new Util.RuntimeOptions{}; return describeNodeWithOptions(request, runtime); } model DescribeRegionsRequest { acceptLanguage?: string(name='AcceptLanguage', description='Filter the returned results based on Chinese, English, and Japanese. For more information, see RFC7231. Valid values: zh-CN en-US Default value: zh-CN', example='zh-CN'), } model DescribeRegionsResponseBody = { regions?: [ { localName?: string(name='LocalName', description='Region name', example='Hang Zhou'), regionId?: string(name='RegionId', description='region id', example='cn-hangzhou'), } ](name='Regions', description='List of region information.'), requestId?: string(name='RequestId', description='Request ID', example='1D2FBB36-C39B-5EBB-9928-FCC1A236D65D'), } model DescribeRegionsResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: DescribeRegionsResponseBody(name='body'), } /** * @summary Region List * * @param request DescribeRegionsRequest * @param runtime runtime options for this request RuntimeOptions * @return DescribeRegionsResponse */ async function describeRegionsWithOptions(request: DescribeRegionsRequest, runtime: Util.RuntimeOptions): DescribeRegionsResponse { Util.validateModel(request); var body : map[string]any = {}; if (!Util.isUnset(request.acceptLanguage)) { body['AcceptLanguage'] = request.acceptLanguage; } var req = new OpenApi.OpenApiRequest{ body = OpenApiUtil.parseToMap(body), }; var params = new OpenApi.Params{ action = 'DescribeRegions', version = '2022-12-15', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Region List * * @param request DescribeRegionsRequest * @return DescribeRegionsResponse */ async function describeRegions(request: DescribeRegionsRequest): DescribeRegionsResponse { var runtime = new Util.RuntimeOptions{}; return describeRegionsWithOptions(request, runtime); } model DescribeSendFileResultsRequest { invokeId?: string(name='InvokeId', description='Command execution ID. This parameter is required.', example='t-bj038i0d6r8zoqo'), nodeId?: string(name='NodeId', description='Node ID', example='e01-cn-zvp2tgykr08'), } model DescribeSendFileResultsResponseBody = { invocations?: { invocation?: [ { content?: string(name='Content', description='Output information after command execution. If ContentEncoding is specified as PlainText, the original output information is returned. If ContentEncoding is specified as Base64, the Base64 encoded output information is returned.', example='Base64'), contentType?: string(name='ContentType', description='File content type. PlainText: Plain text. Base64: Base64 encoding. The default value is PlainText.', example='PlainText'), creationTime?: string(name='CreationTime', description='Creation time of the distribution.', example='2023-04-10T10:53:46.156+08:00'), description?: string(name='Description', description='Command description.', example='描述信息。'), fileGroup?: string(name='FileGroup', description='The user group of the file.', example='root'), fileMode?: string(name='FileMode', description='File permissions.', example='0644'), fileOwner?: string(name='FileOwner', description='The owner of the file.', example='root'), invocationStatus?: string(name='InvocationStatus', description='Overall status of the file distribution. The overall status depends on the common execution status of all instances involved in this distribution, possible values are: - Pending: The system is verifying or distributing the file. If at least one instance has a file distribution status of Pending, the overall execution status will be Pending. - Running: The file is being distributed on the instance. If at least one instance has a file distribution status of Running, the overall execution status will be Running. - Success: All instances have a file distribution status of Success, then the overall execution status will be Success. - Failed: All instances have a file distribution status of Failed, then the overall execution status will be Failed. If any of the following conditions occur for the file distribution status on an instance, the return value will be Failed: - The specified file parameters are incorrect, verification failed (Invalid). - Failed to distribute the file to the instance (Aborted). - The file creation failed within the instance (Failed). - The file distribution timed out (Timeout). - An exception occurred during file distribution and could not continue (Error). - PartialFailed: Some instances successfully received the file while others failed. If the file distribution status of all instances is either Success or Failed, the overall execution status will be PartialFailed.', example='Pending'), invokeNodes?: { invokeNode?: [ { creationTime?: string(name='CreationTime', description='The creation time of the file distribution task.', example='2023-02-06T07:12:50Z'), errorCode?: string(name='ErrorCode', description='The failure reason code for file distribution. Possible values: - Empty: The file was distributed normally. - NodeNotExists: The specified instance does not exist or has been released. - NodeReleased: The instance was released during the file distribution process. - NodeNotRunning: The instance was not running when the file distribution task was created. - AccountNotExists: The specified account does not exist. - ClientNotRunning: The Cloud Assistant Agent is not running. - ClientNotResponse: The Cloud Assistant Agent is not responding. - ClientIsUpgrading: The Cloud Assistant Agent is currently being upgraded. - ClientNeedUpgrade: The Cloud Assistant Agent needs to be upgraded. - DeliveryTimeout: File delivery timed out. - FileCreateFail: Failed to create the file. - FileAlreadyExists: A file with the same name already exists at the specified path. - FileContentInvalid: The file content is invalid. - FileNameInvalid: The file name is invalid. - FilePathInvalid: The file path is invalid. - FileAuthorityInvalid: The file permissions are invalid. - UserGroupNotExists: The user group specified for file delivery does not exist.', example='AccountNotExists'), errorInfo?: string(name='ErrorInfo', description='Details of the reason for command delivery failure or execution failure, possible values: - Empty: The command executed normally. - the specified instance does not exist: The specified instance does not exist or has been released. - the node has been released when creating task: The instance was released during the command execution. - the node is not running when creating task: The instance was not in a running state when the command was executed. - the command is not applicable: The command is not applicable to the specified instance. - the specified account does not exist: The specified account does not exist. - the specified directory does not exist: The specified directory does not exist. - the cron job expression is invalid: The specified execution time expression is invalid. - the aliyun service is not running on the instance: The Cloud Assistant Agent is not running. - the aliyun service in the instance does not respond: The Cloud Assistant Agent is not responding. - the aliyun service in the node is upgrading now: The Cloud Assistant Agent is currently being upgraded. - the aliyun service in the node needs upgrade: The Cloud Assistant Agent needs an upgrade. - the command delivery has timed out: Command delivery has timed out. - the command execution has timed out: Command execution has timed out. - the command execution got an exception: An exception occurred during command execution. - the command execution has been interrupted: The command execution was interrupted. - the command execution exit code is not zero: The command execution completed with a non-zero exit code. - the specified instance has been released: The instance was released during file delivery.', example='the specified instance does not exists'), finishTime?: string(name='FinishTime', description='Completion time, format: "2020-05-22T17:04:18".', example='2023-04-10T10:53:46.156+08:00'), invocationStatus?: string(name='InvocationStatus', description='Status of the task on a single instance. Possible values: - Pending: The system is validating or distributing the file. - Invalid: The specified file parameters are incorrect, and validation failed. - Running: The file is being distributed to the instance. - Aborted: Failed to distribute the file to the instance. - Success: The file distribution is complete. - Failed: The file creation failed within the instance. - Error: An exception occurred during file distribution and could not continue. - Timeout: The file distribution timed out.', example='Success'), nodeId?: string(name='NodeId', description='Node ID.', example='e01-cn-9lb3c15m81j'), startTime?: string(name='StartTime', description='Start Time', example='2023-03-30T16:00:00Z'), updateTime?: string(name='UpdateTime', description='Update Time', example='2023-03-30T16:00:00Z'), } ](name='InvokeNode', description='Record of file distribution for the node.'), }(name='InvokeNodes', description='Record of file distribution.'), name?: string(name='Name', description='Name of the file distribution.', example='test'), nodeCount?: int32(name='NodeCount', description='Number of nodes', example='3'), overwrite?: boolean(name='Overwrite', description='Whether to overwrite the file if a file with the same name already exists in the target directory. - true: Overwrite. - false: Do not overwrite. The default value is false.', example='true'), targetDir?: string(name='TargetDir', description='Target path.', example='/home/user'), } ](name='Invocation', description='Command execution ID.'), }(name='Invocations', description='Record of file distribution.'), requestId?: string(name='RequestId', description='ID of the request', example='4FD06DF0-9167-5C6F-A145-F30CA4A15D54'), totalCount?: string(name='TotalCount', description='Total number of commands.', example='1'), } model DescribeSendFileResultsResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: DescribeSendFileResultsResponseBody(name='body'), } /** * @summary Query the list and status of files sent by the operation assistant * * @param request DescribeSendFileResultsRequest * @param runtime runtime options for this request RuntimeOptions * @return DescribeSendFileResultsResponse */ async function describeSendFileResultsWithOptions(request: DescribeSendFileResultsRequest, runtime: Util.RuntimeOptions): DescribeSendFileResultsResponse { Util.validateModel(request); var body : map[string]any = {}; if (!Util.isUnset(request.invokeId)) { body['InvokeId'] = request.invokeId; } if (!Util.isUnset(request.nodeId)) { body['NodeId'] = request.nodeId; } var req = new OpenApi.OpenApiRequest{ body = OpenApiUtil.parseToMap(body), }; var params = new OpenApi.Params{ action = 'DescribeSendFileResults', version = '2022-12-15', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Query the list and status of files sent by the operation assistant * * @param request DescribeSendFileResultsRequest * @return DescribeSendFileResultsResponse */ async function describeSendFileResults(request: DescribeSendFileResultsRequest): DescribeSendFileResultsResponse { var runtime = new Util.RuntimeOptions{}; return describeSendFileResultsWithOptions(request, runtime); } model DescribeTaskRequest { taskId?: string(name='TaskId', description='Task ID This parameter is required.', example='i156331731670384438138'), } model DescribeTaskResponseBody = { clusterId?: string(name='ClusterId', description='Cluster ID', example='i119982311660892626523'), clusterName?: string(name='ClusterName', description='Cluster Name', example='Standard_Cluster'), createTime?: string(name='CreateTime', description='Start Time', example='2022-11-30T02:00:00.852Z'), message?: string(name='Message', description='Task Failure Message', example='Releasing [prod_main_mid_26e234cf] in region [cn-beijing] with weight [0]'), nodeIds?: [ string ](name='NodeIds', description='List of node IDs'), requestId?: string(name='RequestId', description='Request ID', example='A7FD7411-9395-52E8-AF42-EB3A4A55446D'), steps?: [ { message?: string(name='Message', description='Step Failure Message', example='get taskinfo failed'), stageTag?: string(name='StageTag', description='Stage Tag', example='Node scaling'), startTime?: string(name='StartTime', description='Start Time', example='2022-11-30T2:00:00.852Z'), stepName?: string(name='StepName', description='Step Name', example='create_vpd'), stepState?: string(name='StepState', description='Step Execution State', example='execution_success'), stepType?: string(name='StepType', description='Step Type', example='normal'), subTasks?: [ { createTime?: string(name='CreateTime', description='Creation Time', example='2022-11-30T2:00:00.852Z'), message?: string(name='Message', description='Subtask Failure Message', example='Releasing [prod_main_mid_26e234cf] in region [cn-beijing] with weight [0]'), taskId?: string(name='TaskId', description='Task ID', example='i158805051661047928377'), taskState?: string(name='TaskState', description='Task Execution State', example='running'), taskType?: string(name='TaskType', description='Task Type', example='cut_node_sub_task'), updateTime?: string(name='UpdateTime', description='Update Time', example='2022-11-30T02:20:14.852Z'), } ](name='SubTasks', description='Subtasks'), updateTime?: string(name='UpdateTime', description='Update Time', example='2022-11-30T02:20:14.852Z'), } ](name='Steps', description='Execution Steps'), taskState?: string(name='TaskState', description='Task State', example='running'), taskType?: string(name='TaskType', description='Task Type', example='cut_cluster'), updateTime?: string(name='UpdateTime', description='Update Time', example='2022-11-30T03:40:14.852Z'), } model DescribeTaskResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: DescribeTaskResponseBody(name='body'), } /** * @summary Query Task Details * * @param request DescribeTaskRequest * @param runtime runtime options for this request RuntimeOptions * @return DescribeTaskResponse */ async function describeTaskWithOptions(request: DescribeTaskRequest, runtime: Util.RuntimeOptions): DescribeTaskResponse { Util.validateModel(request); var body : map[string]any = {}; if (!Util.isUnset(request.taskId)) { body['TaskId'] = request.taskId; } var req = new OpenApi.OpenApiRequest{ body = OpenApiUtil.parseToMap(body), }; var params = new OpenApi.Params{ action = 'DescribeTask', version = '2022-12-15', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Query Task Details * * @param request DescribeTaskRequest * @return DescribeTaskResponse */ async function describeTask(request: DescribeTaskRequest): DescribeTaskResponse { var runtime = new Util.RuntimeOptions{}; return describeTaskWithOptions(request, runtime); } model DescribeVscRequest { vscId?: string(name='VscId', description='This parameter is required.', example='vsc-001'), } model DescribeVscResponseBody = { nodeId?: string(name='NodeId', example='e01-cn-kvw44e6dn04'), requestId?: string(name='RequestId', description='Id of the request', example='4FD06DF0-9167-5C6F-A145-F30CA4A15D54'), resourceGroupId?: string(name='ResourceGroupId', example='rg-aek2k3rqlvv6ytq'), status?: string(name='Status', example='NORMAL'), vscId?: string(name='VscId', description='VscId', example='vsc-001'), vscName?: string(name='VscName', example='test_name'), vscType?: string(name='VscType', example='primary'), } model DescribeVscResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: DescribeVscResponseBody(name='body'), } /** * @summary 获取单个Vsc详情 * * @param request DescribeVscRequest * @param runtime runtime options for this request RuntimeOptions * @return DescribeVscResponse */ async function describeVscWithOptions(request: DescribeVscRequest, runtime: Util.RuntimeOptions): DescribeVscResponse { Util.validateModel(request); var body : map[string]any = {}; if (!Util.isUnset(request.vscId)) { body['VscId'] = request.vscId; } var req = new OpenApi.OpenApiRequest{ body = OpenApiUtil.parseToMap(body), }; var params = new OpenApi.Params{ action = 'DescribeVsc', version = '2022-12-15', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary 获取单个Vsc详情 * * @param request DescribeVscRequest * @return DescribeVscResponse */ async function describeVsc(request: DescribeVscRequest): DescribeVscResponse { var runtime = new Util.RuntimeOptions{}; return describeVscWithOptions(request, runtime); } model DescribeZonesRequest { acceptLanguage?: string(name='AcceptLanguage', description='Filter the returned results based on Chinese or English. For more information, see RFC7231. Valid values: zh-CN en-US Default value: zh-CN', example='zh-CN'), } model DescribeZonesResponseBody = { requestId?: string(name='RequestId', description='Request ID', example='E9116F2D-82F8-501E-9ADB-2BE0C02B6A84'), zones?: [ { localName?: string(name='LocalName', description='Zone name', example='Hang Zhou'), zoneId?: string(name='ZoneId', description='Zone ID', example='cn-hangzhou-i'), } ](name='Zones', description='List of available zones'), } model DescribeZonesResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: DescribeZonesResponseBody(name='body'), } /** * @summary List of Available Zones * * @param request DescribeZonesRequest * @param runtime runtime options for this request RuntimeOptions * @return DescribeZonesResponse */ async function describeZonesWithOptions(request: DescribeZonesRequest, runtime: Util.RuntimeOptions): DescribeZonesResponse { Util.validateModel(request); var body : map[string]any = {}; if (!Util.isUnset(request.acceptLanguage)) { body['AcceptLanguage'] = request.acceptLanguage; } var req = new OpenApi.OpenApiRequest{ body = OpenApiUtil.parseToMap(body), }; var params = new OpenApi.Params{ action = 'DescribeZones', version = '2022-12-15', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary List of Available Zones * * @param request DescribeZonesRequest * @return DescribeZonesResponse */ async function describeZones(request: DescribeZonesRequest): DescribeZonesResponse { var runtime = new Util.RuntimeOptions{}; return describeZonesWithOptions(request, runtime); } model ExtendClusterRequest { clusterId?: string(name='ClusterId', description='Cluster ID', example='i15b480fbd2fcdbc2869cd80'), ignoreFailedNodeTasks?: boolean(name='IgnoreFailedNodeTasks', description='Whether to allow skipping failed node tasks, default value is False', example='False'), ipAllocationPolicy?: [ { bondPolicy?: { bondDefaultSubnet?: string(name='BondDefaultSubnet', description='Default bond cluster subnet', example='subnet-3od2fe'), bonds?: [ { name?: string(name='Name', description='Bond name', example='Bond0'), subnet?: string(name='Subnet', description='IP source cluster subnet', example='subnet-3od2fe'), } ](name='Bonds', description='Bond information'), }(name='BondPolicy', description='Specify the cluster subnet ID based on the bond name'), machineTypePolicy?: [ { bonds?: [ { name?: string(name='Name', description='Bond name', example='Bond0'), subnet?: string(name='Subnet', description='IP source cluster subnet', example='subnet-fdo3dv'), } ](name='Bonds', description='Bond information'), machineType?: string(name='MachineType', description='Machine Type', example='efg1.nvga1'), } ](name='MachineTypePolicy', description='Machine type allocation policy'), nodePolicy?: [ { bonds?: [ { name?: string(name='Name', description='Bond name', example='Bond0'), subnet?: string(name='Subnet', description='IP source cluster subnet', example='subnet-fdo3dv'), } ](name='Bonds', description='Bond information'), hostname?: string(name='Hostname', description='Host name', example='i22c11282.eu95sqa'), nodeId?: string(name='NodeId', description='Node ID', example='i-3fdodw2'), } ](name='NodePolicy', description='Node allocation policy'), } ](name='IpAllocationPolicy', description='IP allocation policy combination: Each policy can only choose one type, and multiple policies can be combined'), nodeGroups?: [ { amount?: long(name='Amount', description='Number of nodes to purchase. Value range: 0–500. If the Amount parameter is set to 0, no nodes will be purchased. Existing nodes will be used for scaling. If the Amount parameter is set to 1–500, the specified number of nodes will be purchased and used for scaling. Default value: 0', example='4'), autoRenew?: boolean(name='AutoRenew', description='Whether to enable auto-renewal for purchased nodes. Conditions: This parameter takes effect only when the Amount parameter is set to a non-zero value and the ChargeType is PrePaid. Valid values: True: Enable auto-renewal. False: Disable auto-renewal. Default value: False', example='True'), chargeType?: string(name='ChargeType', description='Billing method for nodes. This parameter takes effect only when the Amount parameter is set to a value other than 0. Valid values: PrePaid: Subscription (prepaid). PostPaid: Pay-as-you-go (postpaid). Default value: PrePaid', example='PostPaid'), hostnames?: [ string ](name='Hostnames', description='The hostnames of purchased nodes. This parameter takes effect only when the Amount parameter is set to a non-zero value.'), loginPassword?: string(name='LoginPassword', description='The login password of node.', example='Addk(*78'), nodeGroupId?: string(name='NodeGroupId', description='Node Group ID', example='i16d4883a46cbadeb4bc9'), nodeTag?: [ { key?: string(name='Key', description='The key of tag.', example='my_key'), value?: string(name='Value', description='The value of tag.', example='my_value'), } ](name='NodeTag', description='The tag of node'), nodes?: [ { hostname?: string(name='Hostname', description='Hostname', example='d044d220-33fd-11ed-86a6'), loginPassword?: string(name='LoginPassword', description='Login Password', example='***'), nodeId?: string(name='NodeId', description='Node ID', example='e01-cn-zvp2zdpy601'), vSwitchId?: string(name='VSwitchId', description='VSwitch ID', example='vsw-bp169pi5fj151rrms4sia'), vpcId?: string(name='VpcId', description='VPC ID', example='vpc-0jlasms92fdxqd3wlf8ny'), } ](name='Nodes', description='List of Nodes'), period?: long(name='Period', description='Purchase duration for nodes (unit: month). Valid values: 1, 6, 12, 24, 36, 48. Conditions: This parameter takes effect only when the Amount parameter is set to a non-zero value and the ChargeType is PrePaid.', example='6'), userData?: string(name='UserData', description='Custom Data', example='#!/bin/sh echo "Hello World. The time is now $(date -R)!" | tee /root/userdata_test.txt'), vSwitchId?: string(name='VSwitchId', description='VSwitch Id', example='vsw-0jly2d537ejphyq6h13ke'), vpcId?: string(name='VpcId', description='Vpc Id', example='vpc-zq1econyv63tvyci5hefw'), zoneId?: string(name='ZoneId', description='Zone ID', example='cn-hangzhou-i'), } ](name='NodeGroups', description='Node Group'), vSwitchZoneId?: string(name='VSwitchZoneId', description='VSwitch availability zone ID', example='cn-shanghai-b'), vpdSubnets?: [ string ](name='VpdSubnets', description='List of cluster subnets'), } model ExtendClusterShrinkRequest { clusterId?: string(name='ClusterId', description='Cluster ID', example='i15b480fbd2fcdbc2869cd80'), ignoreFailedNodeTasks?: boolean(name='IgnoreFailedNodeTasks', description='Whether to allow skipping failed node tasks, default value is False', example='False'), ipAllocationPolicyShrink?: string(name='IpAllocationPolicy', description='IP allocation policy combination: Each policy can only choose one type, and multiple policies can be combined'), nodeGroupsShrink?: string(name='NodeGroups', description='Node Group'), vSwitchZoneId?: string(name='VSwitchZoneId', description='VSwitch availability zone ID', example='cn-shanghai-b'), vpdSubnetsShrink?: string(name='VpdSubnets', description='List of cluster subnets'), } model ExtendClusterResponseBody = { requestId?: string(name='RequestId', description='Request ID', example='03668372-18FF-5959-98D9-6B36A4643C7A'), taskId?: string(name='TaskId', description='Task ID', example='i158475611663639202234'), } model ExtendClusterResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: ExtendClusterResponseBody(name='body'), } /** * @summary Cluster Scaling * * @param tmpReq ExtendClusterRequest * @param runtime runtime options for this request RuntimeOptions * @return ExtendClusterResponse */ async function extendClusterWithOptions(tmpReq: ExtendClusterRequest, runtime: Util.RuntimeOptions): ExtendClusterResponse { Util.validateModel(tmpReq); var request = new ExtendClusterShrinkRequest{}; OpenApiUtil.convert(tmpReq, request); if (!Util.isUnset(tmpReq.ipAllocationPolicy)) { request.ipAllocationPolicyShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.ipAllocationPolicy, 'IpAllocationPolicy', 'json'); } if (!Util.isUnset(tmpReq.nodeGroups)) { request.nodeGroupsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.nodeGroups, 'NodeGroups', 'json'); } if (!Util.isUnset(tmpReq.vpdSubnets)) { request.vpdSubnetsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.vpdSubnets, 'VpdSubnets', 'json'); } var body : map[string]any = {}; if (!Util.isUnset(request.clusterId)) { body['ClusterId'] = request.clusterId; } if (!Util.isUnset(request.ignoreFailedNodeTasks)) { body['IgnoreFailedNodeTasks'] = request.ignoreFailedNodeTasks; } if (!Util.isUnset(request.ipAllocationPolicyShrink)) { body['IpAllocationPolicy'] = request.ipAllocationPolicyShrink; } if (!Util.isUnset(request.nodeGroupsShrink)) { body['NodeGroups'] = request.nodeGroupsShrink; } if (!Util.isUnset(request.vSwitchZoneId)) { body['VSwitchZoneId'] = request.vSwitchZoneId; } if (!Util.isUnset(request.vpdSubnetsShrink)) { body['VpdSubnets'] = request.vpdSubnetsShrink; } var req = new OpenApi.OpenApiRequest{ body = OpenApiUtil.parseToMap(body), }; var params = new OpenApi.Params{ action = 'ExtendCluster', version = '2022-12-15', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Cluster Scaling * * @param request ExtendClusterRequest * @return ExtendClusterResponse */ async function extendCluster(request: ExtendClusterRequest): ExtendClusterResponse { var runtime = new Util.RuntimeOptions{}; return extendClusterWithOptions(request, runtime); } model ListClusterNodesRequest { clusterId?: string(name='ClusterId', description='Cluster ID This parameter is required.', example='i15b480fbd2fcdbc2869cd80'), maxResults?: long(name='MaxResults', description='Number of items per page in a paginated query, with a default value of 20.', example='20'), nextToken?: string(name='NextToken', description='Query token (Token), which is the value of the NextToken parameter returned by the previous API call.', example='AAAAAdQ3Z+oPlg49gsr2y8jb6wY='), nodeGroupId?: string(name='NodeGroupId', description='Node group ID', example='ng-ec3c96ff0aa4c60d'), resourceGroupId?: string(name='ResourceGroupId', description='resource group id', example='rg-xxkxkllss'), tags?: [ { key?: string(name='Key', description='The key of tag object', example='aa_key'), value?: string(name='Value', description='The value of tag object', example='aa_value'), } ](name='Tags', description='tag information'), } model ListClusterNodesResponseBody = { nextToken?: string(name='NextToken', description='The query token value returned by this call.', example='AAAAAXW/ZB9TBvH+0ZK0phtCibQgQmu1RbqplAI6Velo2OKR'), nodes?: [ { commodityCode?: string(name='CommodityCode', description='product code', example='bcccluster'), createTime?: string(name='CreateTime', description='Creation time', example='1642472468000'), expiredTime?: string(name='ExpiredTime', description='Machine expiration time', example='1762185600000'), fileSystemMountEnabled?: boolean(name='FileSystemMountEnabled', description='whether or not support file system mount'), hostname?: string(name='Hostname', description='Hostname', example='72432f80-273e-11ed-b57a-acde48001122'), hpnZone?: string(name='HpnZone', description='Hpn Zone', example='A1'), imageId?: string(name='ImageId', description='System image ID', example='i190297201669099844192'), imageName?: string(name='ImageName', description='image name', example='Alinux3_x86_AMD_R_Host_D3_E3_24.13.00_UEFI_N_250121'), machineType?: string(name='MachineType', description='Machine type', example='cn-wulanchabu-b11'), networks?: [ { bondName?: string(name='BondName', description='Machine network interface name', example='bond0'), ip?: string(name='Ip', description='IP address within the VPC', example='192.168.22.2'), subnetId?: string(name='SubnetId', description='VPC subnet ID', example='subnet-fwekrvg9'), vpdId?: string(name='VpdId', description='VPC ID', example='vpd-eoiy88ju'), } ](name='Networks', description='Network information'), nodeGroupId?: string(name='NodeGroupId', description='Node group ID', example='ng-e9b74f4d450cf18d'), nodeGroupName?: string(name='NodeGroupName', description='Node group name', example='emr_master'), nodeId?: string(name='NodeId', description='Node ID', example='e01-cn-2r42tmj4z02'), operatingState?: string(name='OperatingState', description='Node status', example='Extending'), sn?: string(name='Sn', description='Machine SN', example='sn_tOuUk'), tags?: [ { key?: string(name='Key', description='The key of tag object', example='aa_key'), value?: string(name='Value', description='The value of tag object', example='aa_value'), } ](name='Tags', description='tag information'), taskId?: string(name='TaskId', description='task id', example='i28ddkdkkdkdd'), vSwitchId?: string(name='VSwitchId', description='The vSwitch ID.', example='vsw-bp1mxqhw8o20tgv3xk47h'), vpcId?: string(name='VpcId', description='VPC ID', example='vpc-0jltf9vinjz3if3lltdy7'), zoneId?: string(name='ZoneId', description='Zone ID', example='cn-hangzhou-b'), } ](name='Nodes', description='List of nodes'), requestId?: string(name='RequestId', description='Request ID', example='2BA76272-6608-5AEC-BBA8-B6F0D3D14CDB'), } model ListClusterNodesResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: ListClusterNodesResponseBody(name='body'), } /** * @summary List of host groups under the cluster, and list of hosts under each group * * @param request ListClusterNodesRequest * @param runtime runtime options for this request RuntimeOptions * @return ListClusterNodesResponse */ async function listClusterNodesWithOptions(request: ListClusterNodesRequest, runtime: Util.RuntimeOptions): ListClusterNodesResponse { Util.validateModel(request); var query = {}; if (!Util.isUnset(request.tags)) { query['Tags'] = request.tags; } var body : map[string]any = {}; if (!Util.isUnset(request.clusterId)) { body['ClusterId'] = request.clusterId; } if (!Util.isUnset(request.maxResults)) { body['MaxResults'] = request.maxResults; } if (!Util.isUnset(request.nextToken)) { body['NextToken'] = request.nextToken; } if (!Util.isUnset(request.nodeGroupId)) { body['NodeGroupId'] = request.nodeGroupId; } if (!Util.isUnset(request.resourceGroupId)) { body['ResourceGroupId'] = request.resourceGroupId; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), body = OpenApiUtil.parseToMap(body), }; var params = new OpenApi.Params{ action = 'ListClusterNodes', version = '2022-12-15', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary List of host groups under the cluster, and list of hosts under each group * * @param request ListClusterNodesRequest * @return ListClusterNodesResponse */ async function listClusterNodes(request: ListClusterNodesRequest): ListClusterNodesResponse { var runtime = new Util.RuntimeOptions{}; return listClusterNodesWithOptions(request, runtime); } model ListClustersRequest { maxResults?: long(name='MaxResults', description='Number of items per page for paginated queries, with a default value of 20.', example='20'), nextToken?: string(name='NextToken', description='Query token, which is the value of the NextToken parameter returned by the previous API call.', example='a3f2224a5ec7224116c4f5246120abe4'), resourceGroupId?: string(name='ResourceGroupId', description='Resource group ID', example='rg-aek2bg6wyoox6jq'), tags?: [ { key?: string(name='Key', description='The key of tag object', example='key_aa'), value?: string(name='Value', description='The value of tag object', example='value_aa'), } ](name='Tags', description='tag info'), } model ListClustersResponseBody = { clusters?: [ { clusterDescription?: string(name='ClusterDescription', description='Cluster description', example='PPU-cluster2 bz'), clusterId?: string(name='ClusterId', description='Cluster ID', example='i137590131672134915401'), clusterName?: string(name='ClusterName', description='Cluster name', example='cnp_test_cluster'), clusterType?: string(name='ClusterType', description='Cluster type', example='AckEdgePro'), components?: any(name='Components', description='Component information', example='{}'), computingIpVersion?: string(name='ComputingIpVersion', description='IP version of the computing network', example='IPv4'), createTime?: string(name='CreateTime', description='Creation time', example='1672134938'), hpnZone?: string(name='HpnZone', description='Cluster number', example='B1'), nodeCount?: long(name='NodeCount', description='Number of nodes', example='12'), nodeGroupCount?: long(name='NodeGroupCount', description='Number of node groups', example='2'), operatingState?: string(name='OperatingState', description='Cluster status', example='initializing'), resourceGroupId?: string(name='ResourceGroupId', description='Resource group ID', example='rg-aek2ajbjoloa23q'), tags?: [ { key?: string(name='Key', description='The key of tag object', example='aa_key'), value?: string(name='Value', description='The value of tag object', example='aa_value'), } ](name='Tags', description='tag information'), taskId?: string(name='TaskId', description='Task ID', example='i156365121663149566024'), updateTime?: string(name='UpdateTime', description='Update time', example='1672134968'), vpcId?: string(name='VpcId', description='VPC ID', example='vpc-0jlx4hol2bjboafzmffvd'), } ](name='Clusters', description='Cluster information'), nextToken?: string(name='NextToken', description='The query token value returned by this call.', example='f4f9a292c17072a2'), requestId?: string(name='RequestId', description='Request ID', example='2FE2B22C-CF9D-59DE-BF63-DC9B9B33A9D1'), } model ListClustersResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: ListClustersResponseBody(name='body'), } /** * @summary Get the list of cluster instances * * @param request ListClustersRequest * @param runtime runtime options for this request RuntimeOptions * @return ListClustersResponse */ async function listClustersWithOptions(request: ListClustersRequest, runtime: Util.RuntimeOptions): ListClustersResponse { Util.validateModel(request); var query = {}; if (!Util.isUnset(request.tags)) { query['Tags'] = request.tags; } var body : map[string]any = {}; if (!Util.isUnset(request.maxResults)) { body['MaxResults'] = request.maxResults; } if (!Util.isUnset(request.nextToken)) { body['NextToken'] = request.nextToken; } if (!Util.isUnset(request.resourceGroupId)) { body['ResourceGroupId'] = request.resourceGroupId; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), body = OpenApiUtil.parseToMap(body), }; var params = new OpenApi.Params{ action = 'ListClusters', version = '2022-12-15', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Get the list of cluster instances * * @param request ListClustersRequest * @return ListClustersResponse */ async function listClusters(request: ListClustersRequest): ListClustersResponse { var runtime = new Util.RuntimeOptions{}; return listClustersWithOptions(request, runtime); } model ListDiagnosticResultsRequest { diagType?: string(name='DiagType', description='Type of diagnosis', example='NetDiag'), maxResults?: long(name='MaxResults', description='Number of items per page in a paginated query. The maximum value is 100. Default value: - If no value is set or the set value is less than 20, the default is 20. - If the set value is greater than 100, the default is 100.', example='20'), nextToken?: string(name='NextToken', description='Query token (Token), the value should be the NextToken parameter value returned from the previous API call.', example='a3f2224a5ec7224116c4f5246120abe4'), resourceGroupId?: string(name='ResourceGroupId', description='Resource group ID', example='rg-acfmywpvugkh7kq'), } model ListDiagnosticResultsResponseBody = { diagnosticResults?: [ { clusterId?: string(name='ClusterId', description='Cluster ID', example='i118578141694745246055'), clusterName?: string(name='ClusterName', description='Cluster name', example='pjlab-lingjun'), creationTime?: string(name='CreationTime', description='Creation time of the diagnostic task.', example='2024-01-15T02:01:12Z'), diagContent?: string(name='DiagContent', description='Diagnosis content. For example, in network diagnosis, there are static configuration checks, dynamic operation checks, etc.', example='diagcontent'), diagId?: string(name='DiagId', description='Diagnosis ID', example='123'), diagResult?: string(name='DiagResult', description='Diagnosis result, success or failure.', example='Success'), finishedTime?: string(name='FinishedTime', description='Completion time of the diagnostic task.', example='2024-10-16T02:04Z'), resourceId?: string(name='ResourceId', description='Resource ID', example='e01-cn-bl03ofg6206'), serverName?: string(name='ServerName', description='Service name.', example='proxy-rps.mos.csvw.com'), status?: string(name='Status', description='Governance status', example='succeed'), } ](name='DiagnosticResults', description='Diagnostic information'), maxResults?: long(name='MaxResults', description='分页查询时每页行数。最大值为100。 默认值: •当不设置值或设置的值小于20时,默认值为20。 •当设置的值大于100时,默认值为100。', example='20'), nextToken?: string(name='NextToken', description='NextToken for the next page. Include this value when requesting the next page.', example='a3f2224a5ec7224116c4f5246120abe4'), requestId?: string(name='RequestId', description='ID of the request', example='AC4F0004-7BCE-52E0-891B-CAC7D64E3368'), } model ListDiagnosticResultsResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: ListDiagnosticResultsResponseBody(name='body'), } /** * @summary List of Diagnostic Tasks * * @description An interface for creating a session, which returns the frontend EndPoint and initiates a periodic task to track the session status. * * @param request ListDiagnosticResultsRequest * @param runtime runtime options for this request RuntimeOptions * @return ListDiagnosticResultsResponse */ async function listDiagnosticResultsWithOptions(request: ListDiagnosticResultsRequest, runtime: Util.RuntimeOptions): ListDiagnosticResultsResponse { Util.validateModel(request); var body : map[string]any = {}; if (!Util.isUnset(request.diagType)) { body['DiagType'] = request.diagType; } if (!Util.isUnset(request.maxResults)) { body['MaxResults'] = request.maxResults; } if (!Util.isUnset(request.nextToken)) { body['NextToken'] = request.nextToken; } if (!Util.isUnset(request.resourceGroupId)) { body['ResourceGroupId'] = request.resourceGroupId; } var req = new OpenApi.OpenApiRequest{ body = OpenApiUtil.parseToMap(body), }; var params = new OpenApi.Params{ action = 'ListDiagnosticResults', version = '2022-12-15', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary List of Diagnostic Tasks * * @description An interface for creating a session, which returns the frontend EndPoint and initiates a periodic task to track the session status. * * @param request ListDiagnosticResultsRequest * @return ListDiagnosticResultsResponse */ async function listDiagnosticResults(request: ListDiagnosticResultsRequest): ListDiagnosticResultsResponse { var runtime = new Util.RuntimeOptions{}; return listDiagnosticResultsWithOptions(request, runtime); } model ListFreeNodesRequest { hpnZone?: string(name='HpnZone', description='Cluster number', example='A1'), machineType?: string(name='MachineType', description='Machine type', example='mock-machine-type2'), maxResults?: long(name='MaxResults', description='Number of items per page for paginated queries, default is 20.', example='20'), nextToken?: string(name='NextToken', description='Query token (Token), the value should be the NextToken parameter value returned from the previous API call.', example='a3f2224a5ec7224116c4f5246120abe4'), operatingStates?: [ string ](name='OperatingStates'), resourceGroupId?: string(name='ResourceGroupId', description='Resource group ID', example='rg-acfmxno4vh5muoq'), tags?: [ { key?: string(name='Key', description='The key of tag object', example='key_aa'), value?: string(name='Value', description='The value of tag object', example='value_aa'), } ](name='Tags', description='Tag information'), } model ListFreeNodesResponseBody = { nextToken?: string(name='NextToken', description='The query token value returned by this call.', example='a3f2224a5ec7224116c4f5246120abe4'), nodes?: [ { commodityCode?: string(name='CommodityCode', description='Product Code', example='bccluster_eflocomputing_public_cn'), createTime?: string(name='CreateTime', description='Creation time', example='1652321554'), expiredTime?: string(name='ExpiredTime', description='Expiration time of the machine', example='1673107200'), hpnZone?: string(name='HpnZone', description='Cluster number', example='A1'), machineType?: string(name='MachineType', description='Machine type', example='efg1.nvga1'), nodeId?: string(name='NodeId', description='Node ID', example='e01-cn-7pp2x193801'), operatingState?: string(name='OperatingState', description='Node status', example='Unused'), resourceGroupId?: string(name='ResourceGroupId', description='Resource group ID', example='rg-aekzkkbrpl4owgy'), sn?: string(name='Sn', description='Machine SN', example='sn_pozkHBgicd'), tags?: [ { key?: string(name='Key', description='The key of tag object', example='aa_key'), value?: string(name='Value', description='The value of tag object', example='aa_vakye'), } ](name='Tags', description='Tags Info'), zoneId?: string(name='ZoneId', description='Availability zone ID', example='cn-hangzhou-j'), } ](name='Nodes', description='List of nodes'), requestId?: string(name='RequestId', description='Request ID', example='AA14CB86-70C4-5CB7-9E7B-6CCA77F3512B'), } model ListFreeNodesResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: ListFreeNodesResponseBody(name='body'), } /** * @summary List of Available Physical Machines * * @param request ListFreeNodesRequest * @param runtime runtime options for this request RuntimeOptions * @return ListFreeNodesResponse */ async function listFreeNodesWithOptions(request: ListFreeNodesRequest, runtime: Util.RuntimeOptions): ListFreeNodesResponse { Util.validateModel(request); var query = {}; if (!Util.isUnset(request.tags)) { query['Tags'] = request.tags; } var body : map[string]any = {}; if (!Util.isUnset(request.hpnZone)) { body['HpnZone'] = request.hpnZone; } if (!Util.isUnset(request.machineType)) { body['MachineType'] = request.machineType; } if (!Util.isUnset(request.maxResults)) { body['MaxResults'] = request.maxResults; } if (!Util.isUnset(request.nextToken)) { body['NextToken'] = request.nextToken; } if (!Util.isUnset(request.operatingStates)) { body['OperatingStates'] = request.operatingStates; } if (!Util.isUnset(request.resourceGroupId)) { body['ResourceGroupId'] = request.resourceGroupId; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), body = OpenApiUtil.parseToMap(body), }; var params = new OpenApi.Params{ action = 'ListFreeNodes', version = '2022-12-15', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary List of Available Physical Machines * * @param request ListFreeNodesRequest * @return ListFreeNodesResponse */ async function listFreeNodes(request: ListFreeNodesRequest): ListFreeNodesResponse { var runtime = new Util.RuntimeOptions{}; return listFreeNodesWithOptions(request, runtime); } model ListImagesRequest { architecture?: string(name='Architecture', description='Architecture', example='x86_64'), imageVersion?: string(name='ImageVersion', description='Image version', example='7.9'), platform?: string(name='Platform', description='Platform', example='ALinux3'), } model ListImagesResponseBody = { images?: [ { architecture?: string(name='Architecture', description='Architecture', example='x86_64'), description?: string(name='Description', description='Description', example='alibaba cloud linux 3 full for H800'), imageId?: string(name='ImageId', description='Image ID', example='i190951671671438639388'), imageName?: string(name='ImageName', description='Image name', example='CentOS_7.9_x86_64_FULL_20221110'), imageVersion?: string(name='ImageVersion', description='Image version', example='7.9'), nodeCount?: long(name='NodeCount', description='node count', example='20'), platform?: string(name='Platform', description='Platform', example='ALinux3'), releaseFileMd5?: string(name='ReleaseFileMd5', description='File MD5', example='40741292480fc6d778138adcf8c'), releaseFileSize?: string(name='ReleaseFileSize', description='Image size', example='5.8G'), type?: string(name='Type', description='image type', example='Public'), } ](name='Images', description='Image details'), nextToken?: string(name='NextToken', description='NextToken for the next page, include this value when requesting the next page', example='3a6b93229825ac667104463b56790c91'), requestId?: string(name='RequestId', description='Id of the request', example='0FC4A1C7-421C-5EAB-9361-4C0338EFA287'), } model ListImagesResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: ListImagesResponseBody(name='body'), } /** * @summary Query the list of images available to the user * * @param request ListImagesRequest * @param runtime runtime options for this request RuntimeOptions * @return ListImagesResponse */ async function listImagesWithOptions(request: ListImagesRequest, runtime: Util.RuntimeOptions): ListImagesResponse { Util.validateModel(request); var body : map[string]any = {}; if (!Util.isUnset(request.architecture)) { body['Architecture'] = request.architecture; } if (!Util.isUnset(request.imageVersion)) { body['ImageVersion'] = request.imageVersion; } if (!Util.isUnset(request.platform)) { body['Platform'] = request.platform; } var req = new OpenApi.OpenApiRequest{ body = OpenApiUtil.parseToMap(body), }; var params = new OpenApi.Params{ action = 'ListImages', version = '2022-12-15', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Query the list of images available to the user * * @param request ListImagesRequest * @return ListImagesResponse */ async function listImages(request: ListImagesRequest): ListImagesResponse { var runtime = new Util.RuntimeOptions{}; return listImagesWithOptions(request, runtime); } model ListMachineNetworkInfoRequest { machineHpnInfo?: [ { hpnZone?: string(name='HpnZone', description='Cluster ID', example='C1'), machineType?: string(name='MachineType', description='Machine type', example='efg2.C48cNHmcn'), regionId?: string(name='RegionId', description='Region ID', example='cn-heyuan'), } ](name='MachineHpnInfo', description='Array'), } model ListMachineNetworkInfoShrinkRequest { machineHpnInfoShrink?: string(name='MachineHpnInfo', description='Array'), } model ListMachineNetworkInfoResponseBody = { machineNetworkInfo?: [ { clusterNet?: string(name='ClusterNet', description='Cluster network', example='vpc/acl'), enableJumboFrame?: boolean(name='EnableJumboFrame', description='Whether jumbo frame capability is enabled', example='true'), hpnZone?: string(name='HpnZone', description='Cluster ID', example='B1'), isDpuMode?: boolean(name='IsDpuMode', description='Whether it is in DPU mode', example='true'), machineType?: string(name='MachineType', description='Machine type', example='efg1.nvga8n'), netArch?: string(name='NetArch', description='Network architecture', example='XX-7.0'), regionId?: string(name='RegionId', description='地域ID。', example='cn-heyuan'), } ](name='MachineNetworkInfo', description='Array'), requestId?: string(name='RequestId', description='ID of the request', example='4FD06DF0-9167-5C6F-A145-F30CA4A15D54'), } model ListMachineNetworkInfoResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: ListMachineNetworkInfoResponseBody(name='body'), } /** * @summary Query machine network configuration using HPNZone and machine type * * @description An interface for creating a session, returning the frontend EndPoint, and initiating a periodic task to track the session status * * @param tmpReq ListMachineNetworkInfoRequest * @param runtime runtime options for this request RuntimeOptions * @return ListMachineNetworkInfoResponse */ async function listMachineNetworkInfoWithOptions(tmpReq: ListMachineNetworkInfoRequest, runtime: Util.RuntimeOptions): ListMachineNetworkInfoResponse { Util.validateModel(tmpReq); var request = new ListMachineNetworkInfoShrinkRequest{}; OpenApiUtil.convert(tmpReq, request); if (!Util.isUnset(tmpReq.machineHpnInfo)) { request.machineHpnInfoShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.machineHpnInfo, 'MachineHpnInfo', 'json'); } var body : map[string]any = {}; if (!Util.isUnset(request.machineHpnInfoShrink)) { body['MachineHpnInfo'] = request.machineHpnInfoShrink; } var req = new OpenApi.OpenApiRequest{ body = OpenApiUtil.parseToMap(body), }; var params = new OpenApi.Params{ action = 'ListMachineNetworkInfo', version = '2022-12-15', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Query machine network configuration using HPNZone and machine type * * @description An interface for creating a session, returning the frontend EndPoint, and initiating a periodic task to track the session status * * @param request ListMachineNetworkInfoRequest * @return ListMachineNetworkInfoResponse */ async function listMachineNetworkInfo(request: ListMachineNetworkInfoRequest): ListMachineNetworkInfoResponse { var runtime = new Util.RuntimeOptions{}; return listMachineNetworkInfoWithOptions(request, runtime); } model ListMachineTypesRequest { name?: string(name='Name', description='Machine name', example='efg1.nvga1'), } model ListMachineTypesResponseBody = { machineTypes?: [ { bondNum?: int32(name='BondNum', description='Number of bonds', example='2'), cpuInfo?: string(name='CpuInfo', description='CPU information', example='2x Intel Icelake 8369B 32C CPU'), diskInfo?: string(name='DiskInfo', description='Disk information', example='2x 480GB SATA SSD'), gpuInfo?: string(name='GpuInfo', description='GPU information', example='8x NVIDIA SXM4 80GB A100 GPU'), memoryInfo?: string(name='MemoryInfo', description='Memory information', example='32x 64GB DDR4 3200 Memory'), name?: string(name='Name', description='Machine name', example='efg1.nvga1'), networkInfo?: string(name='NetworkInfo', description='Network information', example='2x 100Gbps DP NIC'), nodeCount?: string(name='NodeCount', description='Number of nodes', example='10'), totalCpuCore?: int32(name='TotalCpuCore', description='Number of CPU cores', example='48'), type?: string(name='Type', description='Type of machine', example='Public'), } ](name='MachineTypes', description='Details of the machine types'), nextToken?: string(name='NextToken', description='NextToken for the next page, include this value when requesting the next page', example='a3f2224a5ec7224116c4f5246120abe4'), requestId?: string(name='RequestId', description='Id of the request', example='F16BA4D8-FF50-53B6-A026-F443FE31006C'), } model ListMachineTypesResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: ListMachineTypesResponseBody(name='body'), } /** * @summary Query the list of machine types available to the user * * @param request ListMachineTypesRequest * @param runtime runtime options for this request RuntimeOptions * @return ListMachineTypesResponse */ async function listMachineTypesWithOptions(request: ListMachineTypesRequest, runtime: Util.RuntimeOptions): ListMachineTypesResponse { Util.validateModel(request); var body : map[string]any = {}; if (!Util.isUnset(request.name)) { body['Name'] = request.name; } var req = new OpenApi.OpenApiRequest{ body = OpenApiUtil.parseToMap(body), }; var params = new OpenApi.Params{ action = 'ListMachineTypes', version = '2022-12-15', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Query the list of machine types available to the user * * @param request ListMachineTypesRequest * @return ListMachineTypesResponse */ async function listMachineTypes(request: ListMachineTypesRequest): ListMachineTypesResponse { var runtime = new Util.RuntimeOptions{}; return listMachineTypesWithOptions(request, runtime); } model ListNetTestResultsRequest { maxResults?: long(name='MaxResults', description='Number of items per page in a paginated query. The maximum value is 100. Default value: - If no value is set or the set value is less than 20, the default is 20. - If the set value is greater than 100, the default is 100.', example='20'), netTestType?: string(name='NetTestType', description='Type of network test.', example='DelayTest'), nextToken?: string(name='NextToken', description='Query token (Token), which should be the value of the NextToken parameter returned from the previous API call.', example='3a6b93229825ac667104463b56790c91'), resourceGroupId?: string(name='ResourceGroupId', description='Resource group ID', example='rg-acfmxno4vh5muoq'), } model ListNetTestResultsResponseBody = { maxResults?: long(name='MaxResults', description='分页查询时每页行数。最大值为100。 默认值: •当不设置值或设置的值小于20时,默认值为20。 •当设置的值大于100时,默认值为100。', example='20'), netTestResults?: [ { clusterId?: string(name='ClusterId', description='Cluster ID', example='i110667211718265012218'), clusterName?: string(name='ClusterName', description='Cluster name', example='test'), commTest?: { GPUNum?: string(name='GPUNum', description='Number of GPUs', example='4'), hosts?: [ { IP?: string(name='IP', description='Node IP', example='10.51.16.21'), resourceId?: string(name='ResourceId', description='Resource ID', example='e01-cn-wwo3eteze19'), serverName?: string(name='ServerName', description='Service name', example='www.xinjiaoyu.com'), } ](name='Hosts', description='Input hosts for the test nodes'), model?: string(name='Model', description='Communication library model', example='AllToAll'), type?: string(name='Type', description='Communication library test category: ACCL or NCCL', example='ACCL'), }(name='CommTest', description='To be filled when the network test type is communication library test'), creationTime?: string(name='CreationTime', description='Creation time.', example='2024-01-19T02:18:12Z'), delayTest?: { hosts?: [ { bond?: string(name='Bond', description='Bond interface of the network card', example='bond1'), IP?: string(name='IP', description='Node IP', example='pgm-bp174z988a27wre71o.pg.rds.aliyuncs.com'), resourceId?: string(name='ResourceId', description='资源id', example='e01-cn-wwo3eteze19'), serverName?: string(name='ServerName', description='Service name', example='WrF'), } ](name='Hosts', description='Resource list'), }(name='DelayTest', description='Fill in when the network test type is latency test'), finishedTime?: string(name='FinishedTime', description='Completion time.', example='2024-10-30T02:07Z'), netTestType?: string(name='NetTestType', description='Type of network test.', example='NetDiag'), networkMode?: string(name='NetworkMode', description='Network mode', example='01'), port?: string(name='Port', description='Test port number.', example='80'), status?: string(name='Status', description='Status of the network test task. Possible values:</br> - InProgress: Testing in progress.</br> - Finished: Test completed.</br> - Failed: Test failed.', example='InProgress'), testId?: string(name='TestId', description='Test ID. A unique identifier for the resource test task.', example='String i-uf6i0tv2refv8wz*****'), trafficTest?: { clients?: [ { bond?: string(name='Bond', description='Network interface bond port', example='bond1'), IP?: string(name='IP', description='IP address.', example='74.73.100.1'), resourceId?: string(name='ResourceId', description='Resource ID.', example='e01-cn-20p36bqet39'), serverName?: string(name='ServerName', description='Service name.', example='prod-gf-cn.juequling.com'), } ](name='Clients', description='Clients'), duration?: long(name='Duration', description='Duration of the workflow task, in seconds.', example='1'), GDR?: string(name='GDR', description='协议为RDMA时,填写True/False, 协议为TCP时,此字段为空。', example='True'), protocol?: string(name='Protocol', description='Network protocol, either RDMA or TCP.', example='TCP'), QP?: long(name='QP', description='For TCP, enter the number of concurrent connections; for RDMA, enter the configured QP value.', example='RDMA'), servers?: [ { bond?: string(name='Bond', description='Network interface bond port', example='bond1'), IP?: string(name='IP', description='Node IP', example='10.1.168.183'), resourceId?: string(name='ResourceId', description='Resource ID.', example='e01-cn-wwo3eteze19'), serverName?: string(name='ServerName', description='Service name.', example='prod-gf-cn.juequling.com'), } ](name='Servers', description='This field is empty when the traffic model (TrafficModel) is Fullmesh.'), trafficModel?: string(name='TrafficModel', description='Traffic model, either MTON or Fullmesh.', example='Fullmesh'), }(name='TrafficTest', description='Fill in when the network test type is traffic test.'), } ](name='NetTestResults', description='List of nodes'), nextToken?: string(name='NextToken', description='NextToken for the next page, to be included in the request for the next page', example='3a6b93229825ac667104463b56790c91'), requestId?: string(name='RequestId', description='ID of the request', example='3C683243-7915-57FB-9570-A2932C1C0F78'), } model ListNetTestResultsResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: ListNetTestResultsResponseBody(name='body'), } /** * @summary Network Test List * * @description An interface for creating a session, returning the frontend EndPoint, and initiating a periodic task to track the session status. * * @param request ListNetTestResultsRequest * @param runtime runtime options for this request RuntimeOptions * @return ListNetTestResultsResponse */ async function listNetTestResultsWithOptions(request: ListNetTestResultsRequest, runtime: Util.RuntimeOptions): ListNetTestResultsResponse { Util.validateModel(request); var body : map[string]any = {}; if (!Util.isUnset(request.maxResults)) { body['MaxResults'] = request.maxResults; } if (!Util.isUnset(request.netTestType)) { body['NetTestType'] = request.netTestType; } if (!Util.isUnset(request.nextToken)) { body['NextToken'] = request.nextToken; } if (!Util.isUnset(request.resourceGroupId)) { body['ResourceGroupId'] = request.resourceGroupId; } var req = new OpenApi.OpenApiRequest{ body = OpenApiUtil.parseToMap(body), }; var params = new OpenApi.Params{ action = 'ListNetTestResults', version = '2022-12-15', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Network Test List * * @description An interface for creating a session, returning the frontend EndPoint, and initiating a periodic task to track the session status. * * @param request ListNetTestResultsRequest * @return ListNetTestResultsResponse */ async function listNetTestResults(request: ListNetTestResultsRequest): ListNetTestResultsResponse { var runtime = new Util.RuntimeOptions{}; return listNetTestResultsWithOptions(request, runtime); } model ListNodeGroupsRequest { clusterId?: string(name='ClusterId', description='Cluster ID', example='i119982311660892626523'), maxResults?: int32(name='MaxResults', description='Number of items per page in a paginated query. The maximum value is 100. Default value: - If no value is set or the set value is less than 20, the default value is 20. - If the set value is greater than 100, the default value is 100.', example='20'), nextToken?: string(name='NextToken', description='NextToken for the next page, include this value when requesting the next page', example='a3f2224a5ec7224116c4f5246120abe4'), nodeGroupId?: string(name='NodeGroupId', description='Node group ID', example='ng-ec3c96ff0aa4c60d'), } model ListNodeGroupsResponseBody = { groups?: [ { clusterId?: string(name='ClusterId', description='Cluster ID', example='i113952461729854708648'), clusterName?: string(name='ClusterName', description='Cluster name', example='wzq-exclusivelite-71'), createTime?: string(name='CreateTime', description='Creation time', example='2024-02-27T13:16:31.599'), description?: string(name='Description', description='Description', example='created by ga2_prepare'), fileSystemMountEnabled?: boolean(name='FileSystemMountEnabled'), groupId?: string(name='GroupId', description='Group ID.', example='238276221'), groupName?: string(name='GroupName', description='Group name.', example='backend-group'), imageId?: string(name='ImageId', description='Image ID', example='i194015071707321240258'), imageName?: string(name='ImageName', description='Image name', example='CentOS_7.9_x86_64_FULL_20221110'), machineType?: string(name='MachineType', description='Machine type', example='efg1.nvga1n'), nodeCount?: long(name='NodeCount', description='Number of nodes', example='2'), updateTime?: string(name='UpdateTime', description='Update time', example='2023-09-22T00:03:05.114'), zoneId?: string(name='ZoneId', description='可用区id', example='cn-shenzhen-c'), } ](name='Groups', description='Cluster group information'), nextToken?: string(name='NextToken', description='NextToken for the next page, include this value when requesting the next page', example='563d42ae0b17572449ec8c97f7f66069'), requestId?: string(name='RequestId', description='ID of the request', example='887FA855-89F4-5DB3-B305-C5879EC480E6'), } model ListNodeGroupsResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: ListNodeGroupsResponseBody(name='body'), } /** * @summary Query Node Group Information Under the Cluster * * @param request ListNodeGroupsRequest * @param runtime runtime options for this request RuntimeOptions * @return ListNodeGroupsResponse */ async function listNodeGroupsWithOptions(request: ListNodeGroupsRequest, runtime: Util.RuntimeOptions): ListNodeGroupsResponse { Util.validateModel(request); var body : map[string]any = {}; if (!Util.isUnset(request.clusterId)) { body['ClusterId'] = request.clusterId; } if (!Util.isUnset(request.maxResults)) { body['MaxResults'] = request.maxResults; } if (!Util.isUnset(request.nextToken)) { body['NextToken'] = request.nextToken; } if (!Util.isUnset(request.nodeGroupId)) { body['NodeGroupId'] = request.nodeGroupId; } var req = new OpenApi.OpenApiRequest{ body = OpenApiUtil.parseToMap(body), }; var params = new OpenApi.Params{ action = 'ListNodeGroups', version = '2022-12-15', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Query Node Group Information Under the Cluster * * @param request ListNodeGroupsRequest * @return ListNodeGroupsResponse */ async function listNodeGroups(request: ListNodeGroupsRequest): ListNodeGroupsResponse { var runtime = new Util.RuntimeOptions{}; return listNodeGroupsWithOptions(request, runtime); } model ListTagResourcesRequest { nextToken?: string(name='NextToken', description='Query token (Token), the value should be the NextToken returned from the previous API call', example='AAAAAdQ3Z+oPlg49gsr2y8jb6wY='), regionId?: string(name='RegionId', description='Region ID This parameter is required.', example='cn-hangzhou'), resourceId?: [ string ](name='ResourceId', description='List of resource IDs'), resourceType?: string(name='ResourceType', description='Resource type This parameter is required.', example='Node'), tag?: [ { key?: string(name='Key', description='Tag key', example='PodName'), value?: string(name='Value', description='Tag value', example='WFT-OTC'), } ](name='Tag', description='List of tags'), } model ListTagResourcesResponseBody = { nextToken?: string(name='NextToken', description='NextToken for the next page, include this returned value when requesting the next page', example='AAAAAdQ3Z+oPlg49gsr2y8jb6wY='), requestId?: string(name='RequestId', description='Request ID', example='8F208B6D-4C42-5FD3-B6BE-E826E92A44DD'), tagResources?: { tagResource?: [ { resourceId?: string(name='ResourceId', description='Resource ID', example='i15azeddnvf7uhw2oij57o0'), resourceType?: string(name='ResourceType', description='Resource type', example='Cluster'), tagKey?: string(name='TagKey', description='Tag key', example='env'), tagValue?: string(name='TagValue', description='Tag value', example='dev'), } ](name='TagResource') }(name='TagResources', description='Tagged resources.'), } model ListTagResourcesResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: ListTagResourcesResponseBody(name='body'), } /** * @summary Query Resource Tags * * @param request ListTagResourcesRequest * @param runtime runtime options for this request RuntimeOptions * @return ListTagResourcesResponse */ async function listTagResourcesWithOptions(request: ListTagResourcesRequest, runtime: Util.RuntimeOptions): ListTagResourcesResponse { Util.validateModel(request); var query = {}; if (!Util.isUnset(request.nextToken)) { query['NextToken'] = request.nextToken; } if (!Util.isUnset(request.regionId)) { query['RegionId'] = request.regionId; } if (!Util.isUnset(request.resourceId)) { query['ResourceId'] = request.resourceId; } if (!Util.isUnset(request.resourceType)) { query['ResourceType'] = request.resourceType; } if (!Util.isUnset(request.tag)) { query['Tag'] = request.tag; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApi.Params{ action = 'ListTagResources', version = '2022-12-15', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Query Resource Tags * * @param request ListTagResourcesRequest * @return ListTagResourcesResponse */ async function listTagResources(request: ListTagResourcesRequest): ListTagResourcesResponse { var runtime = new Util.RuntimeOptions{}; return listTagResourcesWithOptions(request, runtime); } model ListUserClusterTypesResponseBody = { clusterTypes?: [ { accessType?: string(name='AccessType', description='访问类型。', example='Public'), typeName?: string(name='TypeName', description='Type name', example='AckEdgePro'), } ](name='ClusterTypes', description='List of cluster types. The number of array elements N ranges from 1 to 100.'), nextToken?: string(name='NextToken', description='The NextToken for the next page. Include this value when requesting the next page.', example='3a6b93229825ac667104463b56790c91'), requestId?: string(name='RequestId', description='Id of the request', example='4FD06DF0-9167-5C6F-A145-F30CA4A15D54'), } model ListUserClusterTypesResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: ListUserClusterTypesResponseBody(name='body'), } /** * @summary Query the cluster types available to the user * * @description An interface for creating a session, which returns the front-end EndPoint and initiates a periodic task to track the session status * * @param request ListUserClusterTypesRequest * @param runtime runtime options for this request RuntimeOptions * @return ListUserClusterTypesResponse */ async function listUserClusterTypesWithOptions(runtime: Util.RuntimeOptions): ListUserClusterTypesResponse { var req = new OpenApi.OpenApiRequest{}; var params = new OpenApi.Params{ action = 'ListUserClusterTypes', version = '2022-12-15', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Query the cluster types available to the user * * @description An interface for creating a session, which returns the front-end EndPoint and initiates a periodic task to track the session status * * @return ListUserClusterTypesResponse */ async function listUserClusterTypes(): ListUserClusterTypesResponse { var runtime = new Util.RuntimeOptions{}; return listUserClusterTypesWithOptions(runtime); } model ListVscsRequest { maxResults?: int32(name='MaxResults', example='20'), nextToken?: string(name='NextToken', example='563d42ae0b17572449ec8c97f7f66069'), nodeIds?: [ string ](name='NodeIds'), resourceGroupId?: string(name='ResourceGroupId', example='rg-aek2xdkc6icwfha'), tag?: [ { key?: string(name='Key', example='key001'), value?: string(name='Value', example='value001'), } ](name='Tag'), vscName?: string(name='VscName', example='test_name'), } model ListVscsShrinkRequest { maxResults?: int32(name='MaxResults', example='20'), nextToken?: string(name='NextToken', example='563d42ae0b17572449ec8c97f7f66069'), nodeIdsShrink?: string(name='NodeIds'), resourceGroupId?: string(name='ResourceGroupId', example='rg-aek2xdkc6icwfha'), tag?: [ { key?: string(name='Key', example='key001'), value?: string(name='Value', example='value001'), } ](name='Tag'), vscName?: string(name='VscName', example='test_name'), } model ListVscsResponseBody = { maxResults?: int32(name='MaxResults', example='0'), nextToken?: string(name='NextToken', description='This parameter is required.', example='3a6b93229825ac667104463b56790c91'), requestId?: string(name='RequestId', description='Id of the request', example='03668372-18FF-5959-98D9-6B36A4643C7A'), totalCount?: int32(name='TotalCount', example='3'), vscs?: [ { nodeId?: string(name='NodeId', example='e01-cn-fzh47xd7u08'), resourceGroupId?: string(name='ResourceGroupId', example='rg-acfm2zkwhkns57i'), status?: string(name='Status', example='NORMAL'), tags?: [ { tagKey?: string(name='TagKey', example='key001'), tagValue?: string(name='TagValue', example='value001'), } ](name='Tags'), vscId?: string(name='VscId', description='VscId', example='vsc-001'), vscName?: string(name='VscName', example='test_name'), vscType?: string(name='VscType', example='primary'), } ](name='Vscs'), } model ListVscsResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: ListVscsResponseBody(name='body'), } /** * @summary 查询Vsc列表 * * @param tmpReq ListVscsRequest * @param runtime runtime options for this request RuntimeOptions * @return ListVscsResponse */ async function listVscsWithOptions(tmpReq: ListVscsRequest, runtime: Util.RuntimeOptions): ListVscsResponse { Util.validateModel(tmpReq); var request = new ListVscsShrinkRequest{}; OpenApiUtil.convert(tmpReq, request); if (!Util.isUnset(tmpReq.nodeIds)) { request.nodeIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.nodeIds, 'NodeIds', 'json'); } var query = {}; if (!Util.isUnset(request.tag)) { query['Tag'] = request.tag; } var body : map[string]any = {}; if (!Util.isUnset(request.maxResults)) { body['MaxResults'] = request.maxResults; } if (!Util.isUnset(request.nextToken)) { body['NextToken'] = request.nextToken; } if (!Util.isUnset(request.nodeIdsShrink)) { body['NodeIds'] = request.nodeIdsShrink; } if (!Util.isUnset(request.resourceGroupId)) { body['ResourceGroupId'] = request.resourceGroupId; } if (!Util.isUnset(request.vscName)) { body['VscName'] = request.vscName; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), body = OpenApiUtil.parseToMap(body), }; var params = new OpenApi.Params{ action = 'ListVscs', version = '2022-12-15', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary 查询Vsc列表 * * @param request ListVscsRequest * @return ListVscsResponse */ async function listVscs(request: ListVscsRequest): ListVscsResponse { var runtime = new Util.RuntimeOptions{}; return listVscsWithOptions(request, runtime); } model RebootNodesRequest { clusterId?: string(name='ClusterId', description='Cluster ID', example='i15b480fbd2fcdbc2869cd80'), ignoreFailedNodeTasks?: boolean(name='IgnoreFailedNodeTasks', description='Whether to allow skipping failed node tasks, default value is False', example='False'), nodes?: [ string ](name='Nodes', description='List of nodes'), } model RebootNodesShrinkRequest { clusterId?: string(name='ClusterId', description='Cluster ID', example='i15b480fbd2fcdbc2869cd80'), ignoreFailedNodeTasks?: boolean(name='IgnoreFailedNodeTasks', description='Whether to allow skipping failed node tasks, default value is False', example='False'), nodesShrink?: string(name='Nodes', description='List of nodes'), } model RebootNodesResponseBody = { requestId?: string(name='RequestId', description='Request ID', example='4FD06DF0-9167-5C6F-A145-F30CA4A15D54'), taskId?: string(name='TaskId', description='Task Id', example='i158475611663639202234'), } model RebootNodesResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: RebootNodesResponseBody(name='body'), } /** * @summary Reboot Machine * * @param tmpReq RebootNodesRequest * @param runtime runtime options for this request RuntimeOptions * @return RebootNodesResponse */ async function rebootNodesWithOptions(tmpReq: RebootNodesRequest, runtime: Util.RuntimeOptions): RebootNodesResponse { Util.validateModel(tmpReq); var request = new RebootNodesShrinkRequest{}; OpenApiUtil.convert(tmpReq, request); if (!Util.isUnset(tmpReq.nodes)) { request.nodesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.nodes, 'Nodes', 'json'); } var body : map[string]any = {}; if (!Util.isUnset(request.clusterId)) { body['ClusterId'] = request.clusterId; } if (!Util.isUnset(request.ignoreFailedNodeTasks)) { body['IgnoreFailedNodeTasks'] = request.ignoreFailedNodeTasks; } if (!Util.isUnset(request.nodesShrink)) { body['Nodes'] = request.nodesShrink; } var req = new OpenApi.OpenApiRequest{ body = OpenApiUtil.parseToMap(body), }; var params = new OpenApi.Params{ action = 'RebootNodes', version = '2022-12-15', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Reboot Machine * * @param request RebootNodesRequest * @return RebootNodesResponse */ async function rebootNodes(request: RebootNodesRequest): RebootNodesResponse { var runtime = new Util.RuntimeOptions{}; return rebootNodesWithOptions(request, runtime); } model ReimageNodesRequest { clusterId?: string(name='ClusterId', description='Cluster ID', example='i15dfa12e8f27c44f4a006c2c8bb'), ignoreFailedNodeTasks?: boolean(name='IgnoreFailedNodeTasks', description='Whether to allow skipping failed node tasks, default value is False', example='False'), nodes?: [ { hostname?: string(name='Hostname', description='Hostname', example='457db5ca-241d-11ed-9fd7-acde48001122'), imageId?: string(name='ImageId', description='System image ID', example='m-8vbf8rpv2nn14y7oybjy'), loginPassword?: string(name='LoginPassword', description='Login password', example='***'), nodeId?: string(name='NodeId', description='Node ID', example='e01-cn-zvp2tgykr0b'), } ](name='Nodes', description='Node list'), userData?: string(name='UserData', description='Custom data', example='#!/bin/sh echo "Hello World. The time is now $(date -R)!" | tee /root/userdata_test.txt'), } model ReimageNodesShrinkRequest { clusterId?: string(name='ClusterId', description='Cluster ID', example='i15dfa12e8f27c44f4a006c2c8bb'), ignoreFailedNodeTasks?: boolean(name='IgnoreFailedNodeTasks', description='Whether to allow skipping failed node tasks, default value is False', example='False'), nodesShrink?: string(name='Nodes', description='Node list'), userData?: string(name='UserData', description='Custom data', example='#!/bin/sh echo "Hello World. The time is now $(date -R)!" | tee /root/userdata_test.txt'), } model ReimageNodesResponseBody = { requestId?: string(name='RequestId', description='Request ID', example='15FBCD9B-C93F-54E8-A168-AADE7E66DAD2'), taskId?: string(name='TaskId', description='Task ID', example='i158782151663841517926'), } model ReimageNodesResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: ReimageNodesResponseBody(name='body'), } /** * @summary Machine Reinstallation * * @param tmpReq ReimageNodesRequest * @param runtime runtime options for this request RuntimeOptions * @return ReimageNodesResponse */ async function reimageNodesWithOptions(tmpReq: ReimageNodesRequest, runtime: Util.RuntimeOptions): ReimageNodesResponse { Util.validateModel(tmpReq); var request = new ReimageNodesShrinkRequest{}; OpenApiUtil.convert(tmpReq, request); if (!Util.isUnset(tmpReq.nodes)) { request.nodesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.nodes, 'Nodes', 'json'); } var body : map[string]any = {}; if (!Util.isUnset(request.clusterId)) { body['ClusterId'] = request.clusterId; } if (!Util.isUnset(request.ignoreFailedNodeTasks)) { body['IgnoreFailedNodeTasks'] = request.ignoreFailedNodeTasks; } if (!Util.isUnset(request.nodesShrink)) { body['Nodes'] = request.nodesShrink; } if (!Util.isUnset(request.userData)) { body['UserData'] = request.userData; } var req = new OpenApi.OpenApiRequest{ body = OpenApiUtil.parseToMap(body), }; var params = new OpenApi.Params{ action = 'ReimageNodes', version = '2022-12-15', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Machine Reinstallation * * @param request ReimageNodesRequest * @return ReimageNodesResponse */ async function reimageNodes(request: ReimageNodesRequest): ReimageNodesResponse { var runtime = new Util.RuntimeOptions{}; return reimageNodesWithOptions(request, runtime); } model RunCommandRequest { clientToken?: string(name='ClientToken', description='Ensures idempotence of the request. Generate a unique parameter value from your client to ensure that the value is unique across different requests. ClientToken supports only ASCII characters and cannot exceed 64 characters. For more information, see How to Ensure Idempotence.', example='123e4567-e89b-12d3-a456-426655440000'), commandContent?: string(name='CommandContent', description='Command content. Please note the following: - Specify `EnableParameter=true` to enable custom parameters in the command content. - Define custom parameters using the {{}} format; spaces and newlines within `{{}}` will be ignored. - The number of custom parameters cannot exceed 20. - Custom parameter names can only contain a-zA-Z0-9-_, and are case-insensitive. - A single custom parameter name cannot exceed 64 bytes.', example='ZWNobyAxMjM='), commandId?: string(name='CommandId', description='Command ID', example='c-e996287206324975b5fbe1d***'), contentEncoding?: string(name='ContentEncoding', description='Encoding method for the script content. Valid values: - PlainText: No encoding, transmitted in plain text. - Base64: Base64 encoding. Default value: PlainText. If an invalid value is provided, it will be treated as PlainText.', example='Base64'), description?: string(name='Description', description='Command description.', example='testDescription'), enableParameter?: boolean(name='EnableParameter', description='Whether the command contains custom parameters. Default value: false.', example='false'), frequency?: string(name='Frequency', description='Execution time for scheduled commands. Currently, three types of scheduling methods are supported: fixed interval (based on Rate expression), one-time execution at a specific time, and clock-based scheduling (based on Cron expression). Fixed interval execution: Based on the Rate expression, the command is executed at the set interval. The interval can be set in seconds (s), minutes (m), hours (h), and days (d), suitable for scenarios where tasks need to be executed at fixed intervals. The format is rate(<interval value><interval unit>), such as rate(5m) for every 5 minutes. The following restrictions apply to fixed interval execution: - The interval should not exceed 7 days and should be no less than 60 seconds, and it must be greater than the timeout of the scheduled task. - The interval is based on a fixed frequency and is independent of the actual execution time of the task. For example, if the command is set to execute every 5 minutes and the task takes 2 minutes to complete, the next round will start 3 minutes after the completion of the task. - The task will not be executed immediately upon creation. For example, if the command is set to execute every 5 minutes, it will not be executed immediately upon creation but will start 5 minutes after the task is created. One-time execution at a specific time: Executes the command once at the specified time and timezone. The format is at(yyyy-MM-dd HH:mm:ss <timezone>), which is at(year-month-day hour:minute:second <timezone>). If no timezone is specified, UTC is used by default. Timezones support the following three formats: - Full timezone name: e.g., Asia/Shanghai (China/Shanghai time), America/Los_Angeles (America/Los Angeles time), etc. - Timezone offset from GMT: e.g., GMT+8:00 (UTC+8:00), GMT-7:00 (UTC-7:00). When using the GMT format, leading zeros are not allowed in the hour position. - Timezone abbreviation: Only UTC (Coordinated Universal Time) is supported. For example, to execute once at 13:15:30 on June 6, 2022, in Shanghai, China, the format would be: at(2022-06-06 13:15:30 Asia/Shanghai); to execute once at 13:15:30 on June 6, 2022, in the GMT-7:00 timezone, the format would be: at(2022-06-06 13:15:30 GMT-7:00). Clock-based scheduling (based on Cron expression): Based on the Cron expression, the command is executed according to the set schedule. The format is <second> <minute> <hour> <day> <month> <weekday> <year (optional)> <timezone>, i.e., <Cron expression> <timezone>. In the specified timezone, the scheduled task execution time is calculated based on the Cron expression and then executed. If no timezone is specified, the system\\\\"s internal timezone of the instance running the scheduled task is used by default. For more information about Cron expressions, see Cron Expressions. Timezones support the following three formats: - Full timezone name: e.g., Asia/Shanghai (China/Shanghai time), America/Los_Angeles (America/Los Angeles time), etc. - Timezone offset from GMT: e.g., GMT+8:00 (UTC+8:00), GMT-7:00 (UTC-7:00). When using the GMT format, leading zeros are not allowed in the hour position. - Timezone abbreviation: Only UTC (Coordinated Universal Time) is supported. For example, to execute the command at 10:15 AM every day in 2022 in Shanghai, China, the format would be 0 15 10 ? * * 2022 Asia/Shanghai; to execute the command every 30 minutes between 10:00 AM and 11:30 AM every day in 2022 in the GMT+8:00 timezone, the format would be 0 0/30 10-11 * * ? 2022 GMT+8:00; to execute the command every 5 minutes between 2:00 PM and 2:55 PM every day in October every two years starting from 2022 in UTC, the format would be 0 0/5 14 * 10 ? 2022/2 UTC.'), launcher?: string(name='Launcher', description='Bootstrap for script execution. The length must not exceed 1 KB.', example='python3 -u {{ACS::ScriptFileName|Ext(".py")}}'), name?: string(name='Name', description='Command name.', example='testName'), nodeIdList?: [ string ](name='NodeIdList', description='List of nodes.'), parameters?: map[string]any(name='Parameters', description='When the command contains custom parameters, you need to pass in key-value pairs of these custom parameters when executing the command. For example, if the command content is `echo {{name}}`, you can pass in the key-value pair `{"name":"Jack"}` through the `Parameter` parameter. The custom parameter will automatically replace the variable value `name`, resulting in a new command, which actually executes as `echo Jack`. The number of custom parameters ranges from 0 to 10, and you should note: - Keys cannot be empty strings and support up to 64 characters at most. - Values can be empty strings. - When combined with the original command content and Base64 encoded, if the command is saved, the size after Base64 encoding must not exceed 18 KB; if the command is not saved, the size after Base64 encoding must not exceed 24 KB. You can set whether to keep the command via `KeepCommand`. - The set of custom parameter names must be a subset of the parameter set defined during command creation. For parameters that are not passed in, you can use an empty string as a substitute. The default value is empty, indicating that the parameter is not set, thus disabling custom parameters.', example='{"name":"Jack", "accessKey":"LTAIdyvdIqaRY****"}'), repeatMode?: string(name='RepeatMode', description='Set the command execution mode. Valid values: - Once: Execute the command immediately. - Period: Execute the command at a scheduled time. When this parameter is set to `Period`, you must also specify the `Frequency` parameter. - NextRebootOnly: Automatically execute the command when the instance starts next time. - EveryReboot: Automatically execute the command every time the instance starts. Default value: - If the `Frequency` parameter is not specified, the default value is `Once`. - If the `Frequency` parameter is specified, regardless of whether this parameter is already set, it will be processed as `Period`.', example='Once'), terminationMode?: string(name='TerminationMode', description='The mode when stopping a task (manually or due to execution timeout). Possible values: Process: Stops the current script process. ProcessTree: Stops the current process tree (a collection of the script process and all its child processes).', example='ProcessTree'), timeout?: int32(name='Timeout', description='Timeout for executing the command, in seconds. If the command cannot run due to process issues, missing modules, or the absence of the Cloud Assistant Agent, a timeout will occur. After a timeout, the command process will be forcibly terminated. Default value: 60.', example='3600'), username?: string(name='Username', description='The username to execute the command in the instance. The length must not exceed 255 characters. For Linux systems, the command is executed by the root user by default.', example='root'), workingDir?: string(name='WorkingDir', description='You can customize the execution path of the command. The default paths are as follows: - Linux instances: The default execution path is under the /home directory of the root user.', example='/home/user'), } model RunCommandShrinkRequest { clientToken?: string(name='ClientToken', description='Ensures idempotence of the request. Generate a unique parameter value from your client to ensure that the value is unique across different requests. ClientToken supports only ASCII characters and cannot exceed 64 characters. For more information, see How to Ensure Idempotence.', example='123e4567-e89b-12d3-a456-426655440000'), commandContent?: string(name='CommandContent', description='Command content. Please note the following: - Specify `EnableParameter=true` to enable custom parameters in the command content. - Define custom parameters using the {{}} format; spaces and newlines within `{{}}` will be ignored. - The number of custom parameters cannot exceed 20. - Custom parameter names can only contain a-zA-Z0-9-_, and are case-insensitive. - A single custom parameter name cannot exceed 64 bytes.', example='ZWNobyAxMjM='), commandId?: string(name='CommandId', description='Command ID', example='c-e996287206324975b5fbe1d***'), contentEncoding?: string(name='ContentEncoding', description='Encoding method for the script content. Valid values: - PlainText: No encoding, transmitted in plain text. - Base64: Base64 encoding. Default value: PlainText. If an invalid value is provided, it will be treated as PlainText.', example='Base64'), description?: string(name='Description', description='Command description.', example='testDescription'), enableParameter?: boolean(name='EnableParameter', description='Whether the command contains custom parameters. Default value: false.', example='false'), frequency?: string(name='Frequency', description='Execution time for scheduled commands. Currently, three types of scheduling methods are supported: fixed interval (based on Rate expression), one-time execution at a specific time, and clock-based scheduling (based on Cron expression). Fixed interval execution: Based on the Rate expression, the command is executed at the set interval. The interval can be set in seconds (s), minutes (m), hours (h), and days (d), suitable for scenarios where tasks need to be executed at fixed intervals. The format is rate(<interval value><interval unit>), such as rate(5m) for every 5 minutes. The following restrictions apply to fixed interval execution: - The interval should not exceed 7 days and should be no less than 60 seconds, and it must be greater than the timeout of the scheduled task. - The interval is based on a fixed frequency and is independent of the actual execution time of the task. For example, if the command is set to execute every 5 minutes and the task takes 2 minutes to complete, the next round will start 3 minutes after the completion of the task. - The task will not be executed immediately upon creation. For example, if the command is set to execute every 5 minutes, it will not be executed immediately upon creation but will start 5 minutes after the task is created. One-time execution at a specific time: Executes the command once at the specified time and timezone. The format is at(yyyy-MM-dd HH:mm:ss <timezone>), which is at(year-month-day hour:minute:second <timezone>). If no timezone is specified, UTC is used by default. Timezones support the following three formats: - Full timezone name: e.g., Asia/Shanghai (China/Shanghai time), America/Los_Angeles (America/Los Angeles time), etc. - Timezone offset from GMT: e.g., GMT+8:00 (UTC+8:00), GMT-7:00 (UTC-7:00). When using the GMT format, leading zeros are not allowed in the hour position. - Timezone abbreviation: Only UTC (Coordinated Universal Time) is supported. For example, to execute once at 13:15:30 on June 6, 2022, in Shanghai, China, the format would be: at(2022-06-06 13:15:30 Asia/Shanghai); to execute once at 13:15:30 on June 6, 2022, in the GMT-7:00 timezone, the format would be: at(2022-06-06 13:15:30 GMT-7:00). Clock-based scheduling (based on Cron expression): Based on the Cron expression, the command is executed according to the set schedule. The format is <second> <minute> <hour> <day> <month> <weekday> <year (optional)> <timezone>, i.e., <Cron expression> <timezone>. In the specified timezone, the scheduled task execution time is calculated based on the Cron expression and then executed. If no timezone is specified, the system\\\\"s internal timezone of the instance running the scheduled task is used by default. For more information about Cron expressions, see Cron Expressions. Timezones support the following three formats: - Full timezone name: e.g., Asia/Shanghai (China/Shanghai time), America/Los_Angeles (America/Los Angeles time), etc. - Timezone offset from GMT: e.g., GMT+8:00 (UTC+8:00), GMT-7:00 (UTC-7:00). When using the GMT format, leading zeros are not allowed in the hour position. - Timezone abbreviation: Only UTC (Coordinated Universal Time) is supported. For example, to execute the command at 10:15 AM every day in 2022 in Shanghai, China, the format would be 0 15 10 ? * * 2022 Asia/Shanghai; to execute the command every 30 minutes between 10:00 AM and 11:30 AM every day in 2022 in the GMT+8:00 timezone, the format would be 0 0/30 10-11 * * ? 2022 GMT+8:00; to execute the command every 5 minutes between 2:00 PM and 2:55 PM every day in October every two years starting from 2022 in UTC, the format would be 0 0/5 14 * 10 ? 2022/2 UTC.'), launcher?: string(name='Launcher', description='Bootstrap for script execution. The length must not exceed 1 KB.', example='python3 -u {{ACS::ScriptFileName|Ext(".py")}}'), name?: string(name='Name', description='Command name.', example='testName'), nodeIdListShrink?: string(name='NodeIdList', description='List of nodes.'), parametersShrink?: string(name='Parameters', description='When the command contains custom parameters, you need to pass in key-value pairs of these custom parameters when executing the command. For example, if the command content is `echo {{name}}`, you can pass in the key-value pair `{"name":"Jack"}` through the `Parameter` parameter. The custom parameter will automatically replace the variable value `name`, resulting in a new command, which actually executes as `echo Jack`. The number of custom parameters ranges from 0 to 10, and you should note: - Keys cannot be empty strings and support up to 64 characters at most. - Values can be empty strings. - When combined with the original command content and Base64 encoded, if the command is saved, the size after Base64 encoding must not exceed 18 KB; if the command is not saved, the size after Base64 encoding must not exceed 24 KB. You can set whether to keep the command via `KeepCommand`. - The set of custom parameter names must be a subset of the parameter set defined during command creation. For parameters that are not passed in, you can use an empty string as a substitute. The default value is empty, indicating that the parameter is not set, thus disabling custom parameters.', example='{"name":"Jack", "accessKey":"LTAIdyvdIqaRY****"}'), repeatMode?: string(name='RepeatMode', description='Set the command execution mode. Valid values: - Once: Execute the command immediately. - Period: Execute the command at a scheduled time. When this parameter is set to `Period`, you must also specify the `Frequency` parameter. - NextRebootOnly: Automatically execute the command when the instance starts next time. - EveryReboot: Automatically execute the command every time the instance starts. Default value: - If the `Frequency` parameter is not specified, the default value is `Once`. - If the `Frequency` parameter is specified, regardless of whether this parameter is already set, it will be processed as `Period`.', example='Once'), terminationMode?: string(name='TerminationMode', description='The mode when stopping a task (manually or due to execution timeout). Possible values: Process: Stops the current script process. ProcessTree: Stops the current process tree (a collection of the script process and all its child processes).', example='ProcessTree'), timeout?: int32(name='Timeout', description='Timeout for executing the command, in seconds. If the command cannot run due to process issues, missing modules, or the absence of the Cloud Assistant Agent, a timeout will occur. After a timeout, the command process will be forcibly terminated. Default value: 60.', example='3600'), username?: string(name='Username', description='The username to execute the command in the instance. The length must not exceed 255 characters. For Linux systems, the command is executed by the root user by default.', example='root'), workingDir?: string(name='WorkingDir', description='You can customize the execution path of the command. The default paths are as follows: - Linux instances: The default execution path is under the /home directory of the root user.', example='/home/user'), } model RunCommandResponseBody = { invokeId?: string(name='InvokeId', description='ID of the command execution.', example='t-7d2a745b412b4601b2d47f6a768d*'), requestId?: string(name='RequestId', description='ID of the request', example='2FE2B22C-CF9D-59DE-BF63-DC9B9B33A9D1'), } model RunCommandResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: RunCommandResponseBody(name='body'), } /** * @summary Execute a Shell script on one or more Lingjun machines * * @param tmpReq RunCommandRequest * @param runtime runtime options for this request RuntimeOptions * @return RunCommandResponse */ async function runCommandWithOptions(tmpReq: RunCommandRequest, runtime: Util.RuntimeOptions): RunCommandResponse { Util.validateModel(tmpReq); var request = new RunCommandShrinkRequest{}; OpenApiUtil.convert(tmpReq, request); if (!Util.isUnset(tmpReq.nodeIdList)) { request.nodeIdListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.nodeIdList, 'NodeIdList', 'json'); } if (!Util.isUnset(tmpReq.parameters)) { request.parametersShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.parameters, 'Parameters', 'json'); } var body : map[string]any = {}; if (!Util.isUnset(request.clientToken)) { body['ClientToken'] = request.clientToken; } if (!Util.isUnset(request.commandContent)) { body['CommandContent'] = request.commandContent; } if (!Util.isUnset(request.commandId)) { body['CommandId'] = request.commandId; } if (!Util.isUnset(request.contentEncoding)) { body['ContentEncoding'] = request.contentEncoding; } if (!Util.isUnset(request.description)) { body['Description'] = request.description; } if (!Util.isUnset(request.enableParameter)) { body['EnableParameter'] = request.enableParameter; } if (!Util.isUnset(request.frequency)) { body['Frequency'] = request.frequency; } if (!Util.isUnset(request.launcher)) { body['Launcher'] = request.launcher; } if (!Util.isUnset(request.name)) { body['Name'] = request.name; } if (!Util.isUnset(request.nodeIdListShrink)) { body['NodeIdList'] = request.nodeIdListShrink; } if (!Util.isUnset(request.parametersShrink)) { body['Parameters'] = request.parametersShrink; } if (!Util.isUnset(request.repeatMode)) { body['RepeatMode'] = request.repeatMode; } if (!Util.isUnset(request.terminationMode)) { body['TerminationMode'] = request.terminationMode; } if (!Util.isUnset(request.timeout)) { body['Timeout'] = request.timeout; } if (!Util.isUnset(request.username)) { body['Username'] = request.username; } if (!Util.isUnset(request.workingDir)) { body['WorkingDir'] = request.workingDir; } var req = new OpenApi.OpenApiRequest{ body = OpenApiUtil.parseToMap(body), }; var params = new OpenApi.Params{ action = 'RunCommand', version = '2022-12-15', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Execute a Shell script on one or more Lingjun machines * * @param request RunCommandRequest * @return RunCommandResponse */ async function runCommand(request: RunCommandRequest): RunCommandResponse { var runtime = new Util.RuntimeOptions{}; return runCommandWithOptions(request, runtime); } model SendFileRequest { content?: string(name='Content', description='The content of the file. After Base64 encoding, the size cannot exceed 32 KB. - When the `ContentType` parameter is `PlainText`, this field is plain text. - When the `ContentType` parameter is `Base64`, this field is Base64 encoded text. This parameter is required.', example='#!/bin/bash echo "Current User is :" echo $(ps | grep "$$" | awk \\\\"{print $2}\\\\") -------- oss://bucketName/objectName'), contentType?: string(name='ContentType', description='The content type of the file. PlainText: Plain text. Base64: Base64 encoded. The default value is PlainText.', example='PlainText'), description?: string(name='Description', description='Description information. Supports all character sets, and the length must not exceed 512 characters.', example='This is a test file.'), fileGroup?: string(name='FileGroup', description='The group of the file. Applies only to Linux instances, and the default is root. The length must not exceed 64 characters. Note When using other groups, ensure that the group exists in the instance.', example='test'), fileMode?: string(name='FileMode', description='The permissions of the file. Applies only to Linux instances, and the setting method is the same as the chmod command. The default value is 0644, which means the user has read and write permissions, while the group and other users have read-only permissions.', example='0644'), fileOwner?: string(name='FileOwner', description='The owner of the file. Applies only to Linux instances, and the default is root.', example='root'), name?: string(name='Name', description='The name of the file. Supports all character sets, and the length must not exceed 255 characters. This parameter is required.', example='file.txt'), nodeIdList?: [ string ](name='NodeIdList', description='List of nodes. This parameter is required.'), overwrite?: boolean(name='Overwrite', description='Whether to overwrite the file if a file with the same name already exists in the target directory. - true: Overwrite. - false: Do not overwrite. The default value is false.', example='True'), targetDir?: string(name='TargetDir', description='The directory in the target Lingjun node where the file will be sent. If it does not exist, it will be automatically created. This parameter is required.', example='/home'), timeout?: int32(name='Timeout', description='The timeout for sending the file. Unit: seconds. - A timeout may occur due to process reasons, missing modules, or missing Cloud Assistant Agent. - If the set timeout is less than 10 seconds, to ensure successful delivery, the system will automatically set the timeout to 10 seconds. The default value is 60.', example='600'), } model SendFileShrinkRequest { content?: string(name='Content', description='The content of the file. After Base64 encoding, the size cannot exceed 32 KB. - When the `ContentType` parameter is `PlainText`, this field is plain text. - When the `ContentType` parameter is `Base64`, this field is Base64 encoded text. This parameter is required.', example='#!/bin/bash echo "Current User is :" echo $(ps | grep "$$" | awk \\\\"{print $2}\\\\") -------- oss://bucketName/objectName'), contentType?: string(name='ContentType', description='The content type of the file. PlainText: Plain text. Base64: Base64 encoded. The default value is PlainText.', example='PlainText'), description?: string(name='Description', description='Description information. Supports all character sets, and the length must not exceed 512 characters.', example='This is a test file.'), fileGroup?: string(name='FileGroup', description='The group of the file. Applies only to Linux instances, and the default is root. The length must not exceed 64 characters. Note When using other groups, ensure that the group exists in the instance.', example='test'), fileMode?: string(name='FileMode', description='The permissions of the file. Applies only to Linux instances, and the setting method is the same as the chmod command. The default value is 0644, which means the user has read and write permissions, while the group and other users have read-only permissions.', example='0644'), fileOwner?: string(name='FileOwner', description='The owner of the file. Applies only to Linux instances, and the default is root.', example='root'), name?: string(name='Name', description='The name of the file. Supports all character sets, and the length must not exceed 255 characters. This parameter is required.', example='file.txt'), nodeIdListShrink?: string(name='NodeIdList', description='List of nodes. This parameter is required.'), overwrite?: boolean(name='Overwrite', description='Whether to overwrite the file if a file with the same name already exists in the target directory. - true: Overwrite. - false: Do not overwrite. The default value is false.', example='True'), targetDir?: string(name='TargetDir', description='The directory in the target Lingjun node where the file will be sent. If it does not exist, it will be automatically created. This parameter is required.', example='/home'), timeout?: int32(name='Timeout', description='The timeout for sending the file. Unit: seconds. - A timeout may occur due to process reasons, missing modules, or missing Cloud Assistant Agent. - If the set timeout is less than 10 seconds, to ensure successful delivery, the system will automatically set the timeout to 10 seconds. The default value is 60.', example='600'), } model SendFileResponseBody = { invokeId?: string(name='InvokeId', description='Command execution ID.', example='t-hz03la52z1zkvls'), requestId?: string(name='RequestId', description='ID of the request', example='3C683243-7915-57FB-9570-A2932C1C0F78'), } model SendFileResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: SendFileResponseBody(name='body'), } /** * @summary Send a remote file to one or more Lingjun machines * * @param tmpReq SendFileRequest * @param runtime runtime options for this request RuntimeOptions * @return SendFileResponse */ async function sendFileWithOptions(tmpReq: SendFileRequest, runtime: Util.RuntimeOptions): SendFileResponse { Util.validateModel(tmpReq); var request = new SendFileShrinkRequest{}; OpenApiUtil.convert(tmpReq, request); if (!Util.isUnset(tmpReq.nodeIdList)) { request.nodeIdListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.nodeIdList, 'NodeIdList', 'json'); } var body : map[string]any = {}; if (!Util.isUnset(request.content)) { body['Content'] = request.content; } if (!Util.isUnset(request.contentType)) { body['ContentType'] = request.contentType; } if (!Util.isUnset(request.description)) { body['Description'] = request.description; } if (!Util.isUnset(request.fileGroup)) { body['FileGroup'] = request.fileGroup; } if (!Util.isUnset(request.fileMode)) { body['FileMode'] = request.fileMode; } if (!Util.isUnset(request.fileOwner)) { body['FileOwner'] = request.fileOwner; } if (!Util.isUnset(request.name)) { body['Name'] = request.name; } if (!Util.isUnset(request.nodeIdListShrink)) { body['NodeIdList'] = request.nodeIdListShrink; } if (!Util.isUnset(request.overwrite)) { body['Overwrite'] = request.overwrite; } if (!Util.isUnset(request.targetDir)) { body['TargetDir'] = request.targetDir; } if (!Util.isUnset(request.timeout)) { body['Timeout'] = request.timeout; } var req = new OpenApi.OpenApiRequest{ body = OpenApiUtil.parseToMap(body), }; var params = new OpenApi.Params{ action = 'SendFile', version = '2022-12-15', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Send a remote file to one or more Lingjun machines * * @param request SendFileRequest * @return SendFileResponse */ async function sendFile(request: SendFileRequest): SendFileResponse { var runtime = new Util.RuntimeOptions{}; return sendFileWithOptions(request, runtime); } model ShrinkClusterRequest { clusterId?: string(name='ClusterId', description='Cluster ID', example='i15dfa12e8f27c44f4a006c2c8bb'), ignoreFailedNodeTasks?: boolean(name='IgnoreFailedNodeTasks', description='Whether to allow skipping failed node tasks, default value is False', example='False'), nodeGroups?: [ { nodeGroupId?: string(name='NodeGroupId', description='Node group ID', example='ng-3b6fbd24b1b845a0'), nodes?: [ { nodeId?: string(name='NodeId', description='Node ID', example='e01poc-cn-zmb2ypjdc01'), } ](name='Nodes', description='List of nodes'), } ](name='NodeGroups', description='Node group information'), } model ShrinkClusterShrinkRequest { clusterId?: string(name='ClusterId', description='Cluster ID', example='i15dfa12e8f27c44f4a006c2c8bb'), ignoreFailedNodeTasks?: boolean(name='IgnoreFailedNodeTasks', description='Whether to allow skipping failed node tasks, default value is False', example='False'), nodeGroupsShrink?: string(name='NodeGroups', description='Node group information'), } model ShrinkClusterResponseBody = { requestId?: string(name='RequestId', description='Request ID', example='CC9FEF89-9BE5-5E03-845E-238B48D7599B'), taskId?: string(name='TaskId', description='task id', example='i159136551662516768776'), } model ShrinkClusterResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: ShrinkClusterResponseBody(name='body'), } /** * @summary Shrink * * @param tmpReq ShrinkClusterRequest * @param runtime runtime options for this request RuntimeOptions * @return ShrinkClusterResponse */ async function shrinkClusterWithOptions(tmpReq: ShrinkClusterRequest, runtime: Util.RuntimeOptions): ShrinkClusterResponse { Util.validateModel(tmpReq); var request = new ShrinkClusterShrinkRequest{}; OpenApiUtil.convert(tmpReq, request); if (!Util.isUnset(tmpReq.nodeGroups)) { request.nodeGroupsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.nodeGroups, 'NodeGroups', 'json'); } var body : map[string]any = {}; if (!Util.isUnset(request.clusterId)) { body['ClusterId'] = request.clusterId; } if (!Util.isUnset(request.ignoreFailedNodeTasks)) { body['IgnoreFailedNodeTasks'] = request.ignoreFailedNodeTasks; } if (!Util.isUnset(request.nodeGroupsShrink)) { body['NodeGroups'] = request.nodeGroupsShrink; } var req = new OpenApi.OpenApiRequest{ body = OpenApiUtil.parseToMap(body), }; var params = new OpenApi.Params{ action = 'ShrinkCluster', version = '2022-12-15', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Shrink * * @param request ShrinkClusterRequest * @return ShrinkClusterResponse */ async function shrinkCluster(request: ShrinkClusterRequest): ShrinkClusterResponse { var runtime = new Util.RuntimeOptions{}; return shrinkClusterWithOptions(request, runtime); } model StopInvocationRequest { invokeId?: string(name='InvokeId', description='Command execution ID. This parameter is required.', example='f-hz044748dzepds0'), nodeIdList?: [ string ](name='NodeIdList', description='List of nodes.'), } model StopInvocationShrinkRequest { invokeId?: string(name='InvokeId', description='Command execution ID. This parameter is required.', example='f-hz044748dzepds0'), nodeIdListShrink?: string(name='NodeIdList', description='List of nodes.'), } model StopInvocationResponseBody = { requestId?: string(name='RequestId', description='Id of the request', example='A7FD7411-9395-52E8-AF42-EB3A4A55446D'), } model StopInvocationResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: StopInvocationResponseBody(name='body'), } /** * @summary Stop the operation assistant command process * * @param tmpReq StopInvocationRequest * @param runtime runtime options for this request RuntimeOptions * @return StopInvocationResponse */ async function stopInvocationWithOptions(tmpReq: StopInvocationRequest, runtime: Util.RuntimeOptions): StopInvocationResponse { Util.validateModel(tmpReq); var request = new StopInvocationShrinkRequest{}; OpenApiUtil.convert(tmpReq, request); if (!Util.isUnset(tmpReq.nodeIdList)) { request.nodeIdListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.nodeIdList, 'NodeIdList', 'json'); } var body : map[string]any = {}; if (!Util.isUnset(request.invokeId)) { body['InvokeId'] = request.invokeId; } if (!Util.isUnset(request.nodeIdListShrink)) { body['NodeIdList'] = request.nodeIdListShrink; } var req = new OpenApi.OpenApiRequest{ body = OpenApiUtil.parseToMap(body), }; var params = new OpenApi.Params{ action = 'StopInvocation', version = '2022-12-15', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Stop the operation assistant command process * * @param request StopInvocationRequest * @return StopInvocationResponse */ async function stopInvocation(request: StopInvocationRequest): StopInvocationResponse { var runtime = new Util.RuntimeOptions{}; return stopInvocationWithOptions(request, runtime); } model StopNodesRequest { ignoreFailedNodeTasks?: boolean(name='IgnoreFailedNodeTasks', description='Whether to allow skipping failed node tasks, default value is False.', example='False'), nodes?: [ string ](name='Nodes', description='List of nodes.'), } model StopNodesShrinkRequest { ignoreFailedNodeTasks?: boolean(name='IgnoreFailedNodeTasks', description='Whether to allow skipping failed node tasks, default value is False.', example='False'), nodesShrink?: string(name='Nodes', description='List of nodes.'), } model StopNodesResponseBody = { requestId?: string(name='RequestId', description='Request ID', example='4FD06DF0-9167-5C6F-A145-F30CA4A15D54'), taskId?: string(name='TaskId', description='Task ID', example='i155847351716171893489'), } model StopNodesResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: StopNodesResponseBody(name='body'), } /** * @summary Shut down the nodes * * @param tmpReq StopNodesRequest * @param runtime runtime options for this request RuntimeOptions * @return StopNodesResponse */ async function stopNodesWithOptions(tmpReq: StopNodesRequest, runtime: Util.RuntimeOptions): StopNodesResponse { Util.validateModel(tmpReq); var request = new StopNodesShrinkRequest{}; OpenApiUtil.convert(tmpReq, request); if (!Util.isUnset(tmpReq.nodes)) { request.nodesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.nodes, 'Nodes', 'json'); } var body : map[string]any = {}; if (!Util.isUnset(request.ignoreFailedNodeTasks)) { body['IgnoreFailedNodeTasks'] = request.ignoreFailedNodeTasks; } if (!Util.isUnset(request.nodesShrink)) { body['Nodes'] = request.nodesShrink; } var req = new OpenApi.OpenApiRequest{ body = OpenApiUtil.parseToMap(body), }; var params = new OpenApi.Params{ action = 'StopNodes', version = '2022-12-15', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Shut down the nodes * * @param request StopNodesRequest * @return StopNodesResponse */ async function stopNodes(request: StopNodesRequest): StopNodesResponse { var runtime = new Util.RuntimeOptions{}; return stopNodesWithOptions(request, runtime); } model TagResourcesRequest { regionId?: string(name='RegionId', description='Region ID This parameter is required.', example='cn-hangzhou'), resourceId?: [ string ](name='ResourceId', description='List of resource IDs This parameter is required.'), resourceType?: string(name='ResourceType', description='Resource type This parameter is required.', example='Cluster'), tag?: [ { key?: string(name='Key', description='Tag key', example='app'), value?: string(name='Value', description='Tag value', example='v3'), } ](name='Tag', description='Tags This parameter is required.'), } model TagResourcesResponseBody = { requestId?: string(name='RequestId', description='ID of the request', example='E7BB53E1-0B08-5C4E-BA66-9225548C3151'), } model TagResourcesResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: TagResourcesResponseBody(name='body'), } /** * @summary Tag User Resources * * @param request TagResourcesRequest * @param runtime runtime options for this request RuntimeOptions * @return TagResourcesResponse */ async function tagResourcesWithOptions(request: TagResourcesRequest, runtime: Util.RuntimeOptions): TagResourcesResponse { Util.validateModel(request); var query = {}; if (!Util.isUnset(request.regionId)) { query['RegionId'] = request.regionId; } if (!Util.isUnset(request.resourceId)) { query['ResourceId'] = request.resourceId; } if (!Util.isUnset(request.resourceType)) { query['ResourceType'] = request.resourceType; } if (!Util.isUnset(request.tag)) { query['Tag'] = request.tag; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApi.Params{ action = 'TagResources', version = '2022-12-15', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Tag User Resources * * @param request TagResourcesRequest * @return TagResourcesResponse */ async function tagResources(request: TagResourcesRequest): TagResourcesResponse { var runtime = new Util.RuntimeOptions{}; return tagResourcesWithOptions(request, runtime); } model UntagResourcesRequest { all?: boolean(name='All', description='Whether to remove all, only effective when TagKey.N is empty. Valid values: - True, remove all - False, do not remove all Default is False', example='False'), regionId?: string(name='RegionId', description='Region ID This parameter is required.', example='cn-hangzhou'), resourceId?: [ string ](name='ResourceId', description='List of resource IDs This parameter is required.'), resourceType?: string(name='ResourceType', description='Resource type This parameter is required.', example='Cluster'), tagKey?: [ string ](name='TagKey', description='List of tag keys'), } model UntagResourcesResponseBody = { requestId?: string(name='RequestId', description='request id', example='81F648D0-5570-5351-AE98-6F501C7E957F'), } model UntagResourcesResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: UntagResourcesResponseBody(name='body'), } /** * @summary Remove user tags from resources * * @param request UntagResourcesRequest * @param runtime runtime options for this request RuntimeOptions * @return UntagResourcesResponse */ async function untagResourcesWithOptions(request: UntagResourcesRequest, runtime: Util.RuntimeOptions): UntagResourcesResponse { Util.validateModel(request); var query = {}; if (!Util.isUnset(request.all)) { query['All'] = request.all; } if (!Util.isUnset(request.regionId)) { query['RegionId'] = request.regionId; } if (!Util.isUnset(request.resourceId)) { query['ResourceId'] = request.resourceId; } if (!Util.isUnset(request.resourceType)) { query['ResourceType'] = request.resourceType; } if (!Util.isUnset(request.tagKey)) { query['TagKey'] = request.tagKey; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApi.Params{ action = 'UntagResources', version = '2022-12-15', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Remove user tags from resources * * @param request UntagResourcesRequest * @return UntagResourcesResponse */ async function untagResources(request: UntagResourcesRequest): UntagResourcesResponse { var runtime = new Util.RuntimeOptions{}; return untagResourcesWithOptions(request, runtime); } model UpdateNodeGroupRequest { fileSystemMountEnabled?: boolean(name='FileSystemMountEnabled'), keyPairName?: string(name='KeyPairName', description='The name of the key pair.', example='sc-key'), newNodeGroupName?: string(name='NewNodeGroupName', description='Node group name', example='test-update'), nodeGroupId?: string(name='NodeGroupId', description='Node group ID', example='i120021051733814190732'), userData?: string(name='UserData', description='user data', example='#!/bin/bash uptime echo "aaaaaaa" >> /tmp/ttttt20250110141010.sh'), } model UpdateNodeGroupResponseBody = { requestId?: string(name='RequestId', description='Id of the request', example='8F065DDD-6996-5973-9691-9EC57BD0072E'), taskId?: string(name='TaskId', description='Task ID', example='i15374011238111706'), } model UpdateNodeGroupResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: UpdateNodeGroupResponseBody(name='body'), } /** * @summary Update Node Group * * @description An interface for creating a session, which returns the front-end EndPoint and initiates a periodic task to track the session status. * * @param request UpdateNodeGroupRequest * @param runtime runtime options for this request RuntimeOptions * @return UpdateNodeGroupResponse */ async function updateNodeGroupWithOptions(request: UpdateNodeGroupRequest, runtime: Util.RuntimeOptions): UpdateNodeGroupResponse { Util.validateModel(request); var body : map[string]any = {}; if (!Util.isUnset(request.fileSystemMountEnabled)) { body['FileSystemMountEnabled'] = request.fileSystemMountEnabled; } if (!Util.isUnset(request.keyPairName)) { body['KeyPairName'] = request.keyPairName; } if (!Util.isUnset(request.newNodeGroupName)) { body['NewNodeGroupName'] = request.newNodeGroupName; } if (!Util.isUnset(request.nodeGroupId)) { body['NodeGroupId'] = request.nodeGroupId; } if (!Util.isUnset(request.userData)) { body['UserData'] = request.userData; } var req = new OpenApi.OpenApiRequest{ body = OpenApiUtil.parseToMap(body), }; var params = new OpenApi.Params{ action = 'UpdateNodeGroup', version = '2022-12-15', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Update Node Group * * @description An interface for creating a session, which returns the front-end EndPoint and initiates a periodic task to track the session status. * * @param request UpdateNodeGroupRequest * @return UpdateNodeGroupResponse */ async function updateNodeGroup(request: UpdateNodeGroupRequest): UpdateNodeGroupResponse { var runtime = new Util.RuntimeOptions{}; return updateNodeGroupWithOptions(request, runtime); }