API for testing a Terraform manifestBeta
Below are the API methods for testing a Terraform manifest with the deployment system.
The request uploads a Terraform manifest to the deployment system.
Parameters of the request to upload the manifest plans/<PLAN_NAME>/deployment/deploy.tf:
Parameter | Value |
|---|---|
Request method |
|
Request path |
Where:
|
Request body ( | Contents of the manifest If additional provider resources are required for testing, they must be added to the request body |
|
|
Example request:
curl -v -X POST https://cloud.vk.ru/marketplace/api/infra-api/api/v1-public/hoe/config/test_1.0 \-H 'x-auth-token: <ACCESS_TOKEN>' \--data-binary "@deploy.tf"
HTTP response codes:
Code | Description |
|---|---|
201 | The manifest has been uploaded or updated |
400, 500 | Request execution error |
401 | Authorization error |
When a request is sent with a manifest name that already exists in the deployment system, the configuration of that manifest will be updated. All previously uploaded configurations of the manifest will be preserved in the deployment system to ensure correct Terraform operation.
The request returns the current configuration of the Terraform manifest specified in the request.
Request parameters:
Parameter | Value |
|---|---|
Request method |
|
Request path |
Where:
|
|
|
Example request:
curl https://cloud.vk.ru/marketplace/api/infra-api/api/v1-public/hoe/config/test_1.0 \-H 'x-auth-token: <ACCESS_TOKEN>'
HTTP response codes:
Code | Description |
|---|---|
200 | The request has been completed. The response to the request contains the current configuration of the specified Terraform manifest |
401 | Authorization error |
404 | Manifest not found |
500 | Request execution error |
The request creates resources according to the current configuration of the Terraform manifest.
Parameters of the request to create a service instance:
Parameter | Value |
|---|---|
Request method |
|
Request path |
Where |
|
|
Request body ( | The following parameters must be specified:
|
|
|
Example request:
curl -v -X POST https://cloud.vk.ru/marketplace/api/infra-api/api/v1-public/hoe/object \-H "Content-Type: application/json" \-H 'x-auth-token: <ACCESS_TOKEN>' \--data '{"uuid": "675f6f08-XXXX-f02311f795d7","config": "test_1.0","vars": {"sub_network": "a793470c-XXXX-67af6c178c8e","image_uuid": "163ff752-XXXX-b0001e3e65d3","volume_type": "ceph-ssd","flavor_uuid": "6e61564f-XXXX-08df5fd84514"}}'
Where:
sub_network— ID of the subnet.image_uuid— ID of the service image.volume_type— disk type.flavor_uuid— ID of the VM configuration template.
HTTP response codes:
Code | Description |
|---|---|
201 | The service instance has been created |
400, 500 | Request execution error |
401 | Authorization error |
The request deletes the service instance created as a result of executing the Terraform manifest
Request parameters:
Parameter | Value |
|---|---|
Request method |
|
Request path |
Where:
|
|
|
Example request:
curl -v -X DELETE https://cloud.vk.ru/marketplace/api/infra-api/api/v1-public/hoe/object/675f6f08-XXXX-f02311f795d7 \-H 'x-auth-token: <ACCESS_TOKEN>'
HTTP response codes:
Code | Description |
|---|---|
201 | The service instance has been deleted |
400, 500 | Request execution error |
401 | Authorization error |
404 | Manifest not found |
The request returns the status of the service instance.
Parameter | Value |
|---|---|
Request method |
|
Request path |
Where:
|
|
|
Example request:
curl https://cloud.vk.ru/marketplace/api/infra-api/api/v1-public/hoe/object/675f6f08-XXXX-f02311f795d7 \-H 'x-auth-token: <ACCESS_TOKEN>'
HTTP response codes:
Code | Description |
|---|---|
200 | The request has been completed. The response to the request contains the status of the service instance (
|
401 | Authorization error |
404 | Service instance identifier not found |
500 | Request execution error |
Example of a response to a request made after the service instance was deleted:
{"uuid": "675f6f08-XXXX-f02311f795d7","target_status": "deleted","vars": {},"out": "{}","status": "deleted","conf_name": "user@vk.team","conf_hash": "75587baeXXXX","pid": "b66dde3dXXXX","create_at": "2023-04-26T13:57:54.849565Z","update_at": "2023-04-26T14:02:42.667399Z","full_deployed": false,"attempts": 0,"max_attempts": 15}
Where:
uuid— identifier of the service instance deployment.target_status— target status of the service instance (deletedorrunning).vars— input variables of the manifest.out— output parameters of the manifest.status— current status of the service instance.conf_name— name of the user who deployed the service.conf_hash— hash of the service instance configuration.pid— identifier of the project of the user who deployed the service (Project ID).create_at— date and time when the service instance was created.update_at— date and time of the last update of the service instance by the deployment system.full_deployed— whether the service instance was deployed successfully (for thedeletedstatus, the value isfalse).attempts— number of retry attempts made when deploying the service instance.max_attempts— maximum number of retry attempts.
The request returns the logs of the service instance.
Request parameters:
Parameter | Value |
|---|---|
Request method |
|
Request path |
Where:
|
|
|
Example request:
curl https://cloud.vk.ru/marketplace/api/infra-api/api/v1-public/logs/instance/675f6f08-XXXX-f02311f795d7 \-H 'x-auth-token: <ACCESS_TOKEN>'
HTTP response codes:
Code | Description |
|---|---|
200 | The request has been completed. The response to the request contains the service instance logs in the |
401 | Authorization error |
404 | Service instance identifier not found |
500 | Request execution error |
Example response:
[{"message": " Apply complete! Resources: 1 added, 0 changed, 0 destroyed. ","src": "terraform","level": "debug","created_at": "2024-05-30T08:32:24Z","uuid": "675f6f08-XXXX-f02311f795d7","broker_id": ""}]