• Resource Template Service

rts
  1. Help Center
  2. Resource Template Service
  3. API Reference
  4. APIs
  5. Stack Management
  6. Querying Stack Files

Querying Stack Files

Function

This API is used to query stack files.

URI

GET /v1/{project_id}/stacks/{stack_name}/{stack_id}/files

NOTE:

This API supports redirection. During the calling, you can specify only stack_name or stack_id.

For details about the parameters, see Table 1.

Table 1 Parameter description

Parameter

Type

Mandatory

Description

project_id

String

Yes

Specifies the project ID.

stack_name

String

Yes

Specifies the stack name.

stack_id

String

Yes

Specifies the stack UUID.

Request Parameter

N/A

Response Parameter

The response is a dictionary containing file names and file content as key-value pairs.

Request Example

GET /v1/95d02433133a4c0a87ba6967474a2ad3/stacks/HeatStack/c89c4bb3-96cb-4a55-aafa-076a7939a306/files

Response Example

{
    "file:///home/username/hello.sh": "#!/bin/sh\necho hello\n"
}

Return Code

Table 2 Normal return code

Return Code

Type

Description

200

OK

Request was successful.

302

Found

The response is about redirection. The response header usually contains a location value that allows you to track the real location of the resource.

Table 3 Error return code

Return Code

Type

Description

400

Bad Request

The server failed to process the request.

401

Unauthorized

Authorization failed.

404

Not found

The requested resources are not found.

500

Internal Server Error

Failed to complete the request because of an internal service error.