All Products
Search
Document Center

Elastic Compute Service:DescribeSendFileResults

Last Updated:Aug 28, 2024

Queries the files sent by Cloud Assistant and their status.

Operation description

Usage notes:

  • When you send a file, the file may fail to be sent to specific Elastic Compute Service (ECS) instances. You can call this operation to check the file sending results.

  • You can call this operation to query the file sending records within the last six weeks.

  • You can use one of the following methods to check the responses:

    • Method 1: During a paged query, when you call the DescribeSendFileResults operation to retrieve the first page of results, set MaxResults to specify the maximum number of entries to return in the call. The return value of NextToken is a pagination token, which can be used in the next request to retrieve a new page of results. When you call the DescribeSendFileResults operation to retrieve a new page of results, set NextToken to the NextToken value returned in the previous call and set MaxResults to specify the maximum number of entries to return in this call.
    • Method 2: Use PageSize to specify the number of entries to return on each page and then use PageNumber to specify the number of the page to return. You can use only one of the preceding methods. If you specify MaxResults or NextToken, the PageSize and PageNumber request parameters do not take effect and the TotalCount response parameter is invalid.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
ecs:DescribeSendFileResultsget
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID of the ECS instance. You can call the DescribeRegions operation to query the most recent region list.

cn-hangzhou
ResourceGroupIdstringNo

The ID of the resource group. After you set this parameter, file sending results in the specified resource group are queried.

rg-bp67acfmxazb4p****
InvokeIdstringNo

The ID of the file sending task.

f-hz0jdfwd9f****
NamestringNo

The name of the file whose sending records you want to query.

test.txt
InstanceIdstringNo

The ID of the instance for which you want to query file sending records.

i-hz0jdfwd9f****
PageNumberlongNo

The page number.

Pages start from page 1.

Default value: 1.

1
PageSizelongNo

The number of entries per page.

Valid values: 1 to 50.

Default value: 10.

10
MaxResultsintegerNo

The maximum number of entries per page.

Valid values: 1 to 50.

Default value: 10.

10
NextTokenstringNo

The pagination token that is used in the next request to retrieve a new page of results. You must specify the token that is obtained from the previous query as the value of NextToken.

AAAAAdDWBF2
InvocationStatusstringNo

The overall sending status of the file. The overall sending status of the file varies based on the sending status of the file on all destination instances. Valid values:

  • Pending: The file is being verified or sent. If the sending state of the file on at least one instance is Pending, the overall sending state of the file is Pending.
  • Running: The file is being sent to the instances. If the sending state of the file on at least one instance is Running, the overall sending state of the file is Running.
  • Success: The file is sent. If the sending state of the file on all instances is Success, the overall sending state of the file is Success.
  • Failed: The file fails to be sent. If the sending state of the file on all instances is Failed, the overall sending state of the file is Failed.
  • PartialFailed: The file sending task succeeds on some instances and fails on other instances. If the sending state of the file is Success on some instances and is Failed on other instances, the overall sending state of the file is PartialFailed.
Success
Tagarray<object>No

The tags of the file sending task.

objectNo

The tags list.

KeystringNo

The key of tag N of the file sending task. Valid values of N: 1 to 20. The tag key cannot be an empty string.

If a single tag is specified to query resources, up to 1,000 resources that have this tag added can be displayed in the response. If multiple tags are specified to query resources, up to 1,000 resources that have all the tags added can be displayed in the response. To query more than 1,000 resources that have specified tags, call the ListTagResources operation.

The tag key can be up to 64 characters in length and cannot contain http:// or https://. The tag key cannot start with acs: or aliyun.

TestKey
ValuestringNo

The value of tag N of the file sending task. Valid values of N: 1 to 20. The tag value can be an empty string.

The tag value can be up to 128 characters in length and cannot contain http:// or https://.

TestValue

Response parameters

ParameterTypeDescriptionExample
object
PageSizelong

The number of entries per page.

10
RequestIdstring

The request ID.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E
PageNumberlong

The page number.

1
TotalCountlong

The total number of file sending tasks queried.

2
NextTokenstring

A pagination token. It can be used in the next request to retrieve a new page of results.

AAAAAdDWBF2
Invocationsarray<object>

The file sending records.

object
CreationTimestring

The time when the file sending task was created.

2019-12-20T06:15:54Z
InvocationStatusstring

The overall sending status of the file. The overall sending status of the file varies based on the sending status of the file on all destination instances. Valid values:

  • Pending: The file is being verified or sent. If the sending state of the file on at least one instance is Pending, the overall sending state of the file is Pending.

  • Running: The file is being sent to the instances. If the sending state of the file on at least one instance is Running, the overall sending state of the file is Running.

  • Success: If the sending state of the file on all instances is Success, the overall sending state of the file is Success.

  • If the sending state of the file on all instances is Failed, the overall sending state of the file is Failed. If the sending state of the file on one or more instances is one of the following values, the overall sending state of the file is Failed:

    • Invalid: The file is invalid.
    • Aborted: The file failed to be sent to the instances.
    • Failed: The file failed to be created on the instances.
    • Timeout: The file sending task timed out.
    • Error: An error occurred and interrupted the file sending task.
  • PartialFailed: The file sending task was completed on some instances but failed on other instances. If the sending state of the file is Success on some instances and is Failed on other instances, the overall sending state of the file is PartialFailed.

Success
ContentTypestring

The type of the file content. Valid values:

  • PlainText: The file content is not encoded.
  • Base64: The file content is encoded in Base64.
PlainText
TargetDirstring

The destination directory.

/home/user
FileOwnerstring

The owner of the file.

test
Descriptionstring

The description of the file.

This is a test file.
VmCountinteger

The number of the destination instances.

1
FileModestring

The permissions on the file.

777
FileGroupstring

The group of the file.

test
InvokeIdstring

The ID of the file sending task.

f-hz0jdfwd9f****
Namestring

The name of the file.

test.txt
Contentstring

The content of the file.

#!/bin/bash echo "Current User is :" echo $(ps | grep "$$" | awk '{print $2}')
Overwritestring

Indicates whether a file in the destination directory is overwritten if the file has the same name as the sent file.

false
InvokeInstancesarray<object>

The destination instances.

object
CreationTimestring

The creation time of the file sending task.

2019-12-20T06:15:54Z
StartTimestring

The time when the file sending task started to be executed on the instance.

2019-12-20T06:15:54Z
InvocationStatusstring

The status of the file sending task. Valid values:

  • Pending: The file is being verified or sent.
  • Invalid: The file is invalid.
  • Running: The file is being sent to the instance.
  • Aborted: The file failed to be sent to the instance.
  • Success: The file is sent.
  • Failed: The file failed to be created on the instance.
  • Error: An error occurred and interrupted the file sending task.
  • Timeout: The file sending task timed out.
Success
FinishTimestring

The time when the file sending task was completed.

2019-12-20T06:15:54Z
UpdateTimestring

The time when the task status was last updated.

2019-12-20T06:15:54Z
ErrorInfostring

The error message returned when the file failed to be sent or the file sending task failed to be executed. Valid values:

  • Null: The file is sent to the instance.
  • the specified instance does not exists
  • the specified instance has been released
  • the instance is not running when create task
  • the specified account does not exists
  • the aliyun service is not running on the instance
  • the aliyun service in the instance does not response
  • the aliyun service in the instance is upgrading now
  • the aliyun service in the instance need upgrade
  • the command delivery has been timeout
  • the file creation is failed due to unknown error
  • the authority of file is invalid
  • File content is empty
  • the content of file is invalid
  • File already exists
  • File name is invalid
  • File path is invalid
  • Owner not exists
  • Group not exists
  • Mode is invalid
the instance is not running when create task
ErrorCodestring

The error code returned when the file failed to be sent to the instance. Valid values:

  • Null: The file is sent to the instance.
  • InstanceNotExists: The instance does not exist or has been released.
  • InstanceReleased: The instance is released while the file is being sent.
  • InstanceNotRunning: The instance is not running when the file sending task is being created.
  • AccountNotExists: The specified account does not exist.
  • ClientNotRunning: Cloud Assistant Agent is not running.
  • ClientNotResponse: Cloud Assistant Agent does not respond.
  • ClientIsUpgrading: Cloud Assistant Agent is being upgraded.
  • ClientNeedUpgrade: Cloud Assistant Agent needs to be upgraded.
  • DeliveryTimeout: The file sending task timed out.
  • FileCreateFail: The file failed to be created.
  • FileAlreadyExists: A file with the same name exists in the specified directory.
  • FileContentInvalid: The file content is invalid.
  • FileNameInvalid: The file name is invalid.
  • FilePathInvalid: The specified directory is invalid.
  • FileAuthorityInvalid: The specified permissions on the file are invalid.
  • UserGroupNotExists: The specified user group does not exist.
InstanceNotExists
InstanceIdstring

The ID of the instance.

i-uf614fhehhz****
Tagsarray<object>

The tags of the file sending task.

object

The tags of the file sending task.

TagKeystring

The tag key of the file sending task.

owner
TagValuestring

The tag value of the file sending task.

zhangsan

Examples

Sample success responses

JSONformat

{
  "PageSize": 10,
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
  "PageNumber": 1,
  "TotalCount": 2,
  "NextToken": "AAAAAdDWBF2",
  "Invocations": {
    "Invocation": [
      {
        "CreationTime": "2019-12-20T06:15:54Z",
        "InvocationStatus": "Success",
        "ContentType": "PlainText",
        "TargetDir": "/home/user",
        "FileOwner": "test",
        "Description": "This is a test file.",
        "VmCount": 1,
        "FileMode": "777",
        "FileGroup": "test",
        "InvokeId": "f-hz0jdfwd9f****",
        "Name": "test.txt",
        "Content": "#!/bin/bash  echo \"Current User is :\"  echo $(ps | grep \"$$\" | awk '{print $2}')",
        "Overwrite": "false",
        "InvokeInstances": {
          "InvokeInstance": [
            {
              "CreationTime": "2019-12-20T06:15:54Z",
              "StartTime": "2019-12-20T06:15:54Z",
              "InvocationStatus": "Success",
              "FinishTime": "2019-12-20T06:15:54Z",
              "UpdateTime": "2019-12-20T06:15:54Z",
              "ErrorInfo": "the instance is not running when create task",
              "ErrorCode": "InstanceNotExists",
              "InstanceId": "i-uf614fhehhz****"
            }
          ]
        },
        "Tags": {
          "Tag": [
            {
              "TagKey": "owner",
              "TagValue": "zhangsan"
            }
          ]
        }
      }
    ]
  }
}

Error codes

HTTP status codeError codeError messageDescription
400RegionId.ApiNotSupportedThe api is not supported in this region.The API operation cannot be called in the specified region. Check whether the specified RegionId parameter is valid.
400NumberExceed.TagsThe Tags parameter number is exceed.The number of tags exceeds the maximum limit.
400MissingParameter.TagKeyYou must specify Tag.N.Key.The tag key is not specified.
400Duplicate.TagKeyThe Tag.N.Key contain duplicate key.The specified tag key already exists. Tag keys must be unique.
400InvalidTagKey.MalformedThe specified Tag.n.Key is not valid.The specified Tag.N.Key parameter is invalid.
400InvalidTagValue.MalformedThe specified Tag.n.Value is not valid.The specified tag value is invalid.
400InvalidParam.PageNumberThe specified parameter is invalid.The specified PageNumber parameter is invalid.
400InvalidParam.PageSizeThe specified parameter is invalid.The specified PageSize parameter is invalid.
400InvalidParameter.NextTokenThe specified parameter NextToken is not valid.The specified parameter NextToken is illegal.
400InvalidParameter.MaxResultsThe specified parameter MaxResults is not valid.The specified parameter MaxResults is illegal.
403Operation.ForbiddenThe operation is not permitted.The operation is not supported.
404InvalidRegionId.NotFoundThe RegionId provided does not exist in our records.The RegionId provided does not exist
500InternalError.DispatchAn error occurred when you dispatched the request.An error occurred while the request is being sent. Try again later.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-12-21The Error code has changed. The request parameters of the API has changed. The response structure of the API has changedView Change Details
2023-09-19The Error code has changed. The request parameters of the API has changedView Change Details
2023-05-12The Error code has changedView Change Details
2022-02-25The Error code has changedView Change Details