DescribeSendFileResults

Updated at:

Queries the list and status of files delivered by Cloud Assistant.

Operation description

Operation description:

  • After you deliver a file, the delivery is not necessarily successful. You must check the actual delivery result based on the return value of the API operation. The actual output result prevails.

  • You can query the execution information from the last 1 day. A maximum of 1,000 execution records can be retained.

  • When paged query the first page, you only need to specify MaxResults to limit the number of returned entries. The NextToken value in the response is used as the token to query the next page. When paged query the next page, set the NextToken parameter to the NextToken value returned from the previous request, and specify MaxResults to limit the number of returned entries.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

ecs:DescribeSendFileResults

get

Instance

acs:ecs:{#regionId}:{#accountId}:instance/{#instanceId}

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

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

cn-hangzhou

ResourceGroupId

string

No

The ID of the resource group to which the file delivery task belongs. If you specify this parameter, you must also specify ResourceGroupId when you deliver the file. This allows you to filter the corresponding file delivery results.

rg-bp67acfmxazb4p****

InvokeId

string

No

The execution ID.

f-hz0jdfwd9f****

Name

string

No

The name of the file. If you specify this parameter, all delivery records of the file with the specified name are queried.

test.txt

InstanceId

string

No

The instance ID. If you specify this parameter, all file delivery records of the instance are queried.

i-hz0jdfwd9f****

PageNumber

integer

No

Note

This parameter will soon be deprecated. We recommend that you use NextToken and MaxResults for paging.

1

PageSize

integer

No

Note

This parameter will soon be deprecated. We recommend that you use NextToken and MaxResults for paging.

10

MaxResults

integer

No

The maximum number of entries per page for a paged query.

Maximum value: 50.

Default value: 10.

10

NextToken

string

No

The query token. Set the value to the NextToken value returned from the previous API call.

AAAAAdDWBF2

InvocationStatus

string

No

The overall delivery status of the file. The overall status depends on the combined execution status of all instances involved in the delivery task. Valid values:

  • Pending: The system is verifying or delivering the file. If the file delivery status of at least one instance is Pending, the overall execution status is Pending.

  • Running: The file is being delivered to the instances. If the file delivery status of at least one instance is Running, the overall execution status is Running.

  • Success: The file is delivered successfully. If the file delivery status of all instances is Success, the overall execution status is Success.

  • Failed: The file fails to be delivered. If the file delivery status of all instances is Failed, the overall execution status is Failed.

  • PartialFailed: The file is delivered to some instances but fails to be delivered to others. If the file delivery status of all instances is either Success or Failed, the overall execution status is PartialFailed.

Success

Tag

array<object>

No

The list of tags.

object

No

The list of tags.

Key

string

No

The tag key of the file delivery task. Valid values of N: 1 to 20. If you specify this parameter, it cannot be an empty string.

If you use a single tag to filter resources, the resource count queried under the tag cannot exceed 1,000. If you use multiple tags to filter resources, the resource count of resources attached with multiple tags at the same time cannot exceed 1,000. If the resource count exceeds 1,000, you must call the ListTagResources operation to query the resources.

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

TestKey

Value

string

No

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

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

TestValue

Response elements

Element

Type

Description

Example

object

Invocations

object

Invocation

array<object>

The file delivery records.

array<object>

Content

string

The content of the file.

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

ContentType

string

The content type of the file. Valid values:

  • PlainText: plain text.

  • Base64: Base64-encoded content.

PlainText

CreationTime

string

The time when the file delivery task was created. The time follows the ISO 8601 standard in the UTC time zone.

2019-12-20T06:15:54Z

Description

string

The description.

This is a test file.

FileGroup

string

The user group of the file.

test

FileMode

string

The permissions of the file.

777

FileOwner

string

The owner of the file.

test

InvocationStatus

string

The overall delivery status of the file. The overall status depends on the combined execution status of all instances involved in the delivery task. Valid values:

  • Pending: The system is verifying or delivering the file. If the file delivery status of at least one instance is Pending, the overall execution status is Pending.

  • Running: The file is being delivered to the instances. If the file delivery status of at least one instance is Running, the overall execution status is Running.

  • Success: The file is delivered successfully. If the file delivery status of all instances is Success, the overall execution status is Success.

  • Failed: The file fails to be delivered. If the file delivery status of all instances is Failed, the overall execution status is Failed. If the file delivery status of one or more instances is one of the following statuses, the returned value is Failed:
    • Invalid: The specified file parameters are incorrect and the verification fails.

    • Aborted: The file fails to be delivered to the instance.

    • Failed: The file fails to be created on the instance.

    • Timeout: The file delivery times out.

    • Error: An exception occurs during the file delivery and the delivery cannot continue.

  • PartialFailed: The file is delivered to some instances but fails to be delivered to others. If the file delivery status of all instances is either Success or Failed, the overall execution status is PartialFailed.

Success

InvokeId

string

The execution ID.

f-hz0jdfwd9f****

InvokeInstances

object

InvokeInstance

array<object>

The type of the target instance set for the file delivery.

object

CreationTime

string

The time when the file delivery task was created. The time follows the ISO 8601 standard in the UTC time zone.

2019-12-20T06:15:54Z

ErrorCode

string

The error code for the file delivery failure. Valid values:

  • Empty: The file is delivered normally.

  • InstanceNotExists: The specified instance does not exist or has been released.

  • InstanceReleased: The instance was released during the file delivery.

  • InstanceNotRunning: The instance was not in the Running state 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 does not respond.

  • ClientIsUpgrading: The Cloud Assistant Agent is being upgraded.

  • ClientNeedUpgrade: The Cloud Assistant Agent needs to be upgraded.

  • DeliveryTimeout: The file delivery timed out.

  • FileCreateFail: The file failed to be created.

  • FileAlreadyExists: A file with the same name already exists in 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 specified user group does not exist when the file is delivered.

InstanceNotExists

ErrorInfo

string

The details about the cause of the file delivery or execution failure. Valid values:

  • Empty: The file is delivered normally.

  • the specified instance does not exists: The specified instance does not exist or has been released.

  • the specified instance has been released.: The instance was released during the file delivery.

  • the instance is not running when create task: The instance was not in the Running state when the file delivery task was created.

  • the specified account does not exists: The specified account does not exist.

  • the aliyun service is not running on the instance: The Cloud Assistant Agent is not running.

  • the aliyun service in the instance does not response: The Cloud Assistant Agent does not respond.

  • the aliyun service in the instance is upgrading now: The Cloud Assistant Agent is being upgraded.

  • the aliyun service in the instance need upgrade: The Cloud Assistant Agent needs to be upgraded.

  • the command delivery has been timeout: The file delivery timed out.

  • the file creation is failed due to unknown error: The file failed to be created.

  • the authority of file is invalid: The file permissions are invalid.

  • File content is empty: The file content is empty.

  • the content of file is invalid: The file content is invalid.

  • File already exists: A file with the same name already exists in the specified path.

  • File name is invalid: The file name is invalid.

  • File path is invalid: The file path is invalid.

  • Owner not exists: The owner does not exist.

  • Group not exists: The user group does not exist.

  • Mode is invalid: The file permission settings are invalid.

the instance is not running when create task

FinishTime

string

The time when the delivery task ended. The time follows the ISO 8601 standard in the UTC time zone.

2019-12-20T06:15:54Z

InstanceId

string

The instance ID.

i-uf614fhehhz****

InvocationStatus

string

The delivery task status on a single instance. Valid values:

  • Pending: The system is verifying or delivering the file.

  • Invalid: The specified file parameters are incorrect and the verification fails.

  • Running: The file is being delivered to the instance.

  • Aborted: The file fails to be delivered to the instance.

  • Success: The file is delivered.

  • Failed: The file fails to be created on the instance.

  • Error: An exception occurs during the file delivery and the delivery cannot continue.

  • Timeout: The file delivery times out.

Success

StartTime

string

The time when the delivery task started to be executed on the instance. The time follows the ISO 8601 standard in the UTC time zone.

2019-12-20T06:15:54Z

UpdateTime

string

The time when the task status was updated. The time follows the ISO 8601 standard in the UTC time zone.

2019-12-20T06:15:54Z

Name

string

The name of the file.

test.txt

Overwrite

string

Specifies whether overwriting is allowed.

false

Tags

object

Tag

array<object>

The tag information of the file delivery task.

object

The tag information of the file delivery task.

TagKey

string

The tag key of the file delivery task.

owner

TagValue

string

The tag value of the file delivery task.

zhangsan

TargetDir

string

The destination path.

/home/user

VmCount

integer

The number of instances to which the file is delivered.

1

NextToken

string

The query token returned by the current call.

AAAAAdDWBF2

PageNumber

integer

The current page number of the query result.

1

PageSize

integer

The number of entries per page.

10

RequestId

string

The request ID.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

TotalCount

integer

The total number of scripts.

Note

When you use the MaxResults and NextToken parameters for paging, the returned TotalCount parameter value is meaningless.

2

Examples

Success response

JSON format

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

Error codes

HTTP status code

Error code

Error message

Description

400 RegionId.ApiNotSupported The 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.
400 NumberExceed.Tags The Tags parameter number is exceed. The number of tags exceeds the maximum limit.
400 MissingParameter.TagKey You must specify Tag.N.Key. The tag key is not specified.
400 Duplicate.TagKey The Tag.N.Key contain duplicate key. The specified tag key already exists. Tag keys must be unique.
400 InvalidTagKey.Malformed The specified Tag.n.Key is not valid. The specified Tag.N.Key parameter is invalid.
400 InvalidTagValue.Malformed The specified Tag.n.Value is not valid. The specified tag value is invalid.
400 InvalidParam.PageNumber The specified parameter is invalid.
400 InvalidParam.PageSize The specified parameter is invalid.
400 InvalidParameter.NextToken The specified parameter NextToken is not valid. The specified parameter NextToken is illegal.
400 InvalidParameter.MaxResults The specified parameter MaxResults is not valid. The specified parameter MaxResults is illegal.
500 InternalError.Dispatch An error occurred when you dispatched the request. An error occurred while the request is being sent. Try again later.
403 InvalidParameterCharacter The specified parameter %s contains illegal characters.
403 Operation.Forbidden The operation is not permitted. The operation is not supported.
404 InvalidRegionId.NotFound The RegionId provided does not exist in our records. Region information error

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.