# Destroy With Associated Resources ## List `gpu_droplets.destroy_with_associated_resources.list(intdroplet_id) -> DestroyWithAssociatedResourceListResponse` **get** `/v2/droplets/{droplet_id}/destroy_with_associated_resources` To list the associated billable resources that can be destroyed along with a Droplet, send a GET request to the `/v2/droplets/$DROPLET_ID/destroy_with_associated_resources` endpoint. This endpoint will only return resources that you are authorized to see. For example, to see associated Reserved IPs, include the `reserved_ip:read` scope. The response will be a JSON object containing `snapshots`, `volumes`, and `volume_snapshots` keys. Each will be set to an array of objects containing information about the associated resources. ### Parameters - **droplet\_id:** `int` ### Returns - `class DestroyWithAssociatedResourceListResponse` - **floating\_ips:** `Optional[List[AssociatedResource]]` Floating IPs that are associated with this Droplet.
Requires `reserved_ip:read` scope. - **id:** `Optional[str]` The unique identifier for the resource associated with the Droplet. - **cost:** `Optional[str]` The cost of the resource in USD per month if the resource is retained after the Droplet is destroyed. - **name:** `Optional[str]` The name of the resource associated with the Droplet. - **reserved\_ips:** `Optional[List[AssociatedResource]]` Reserved IPs that are associated with this Droplet.
Requires `reserved_ip:read` scope. - **id:** `Optional[str]` The unique identifier for the resource associated with the Droplet. - **cost:** `Optional[str]` The cost of the resource in USD per month if the resource is retained after the Droplet is destroyed. - **name:** `Optional[str]` The name of the resource associated with the Droplet. - **snapshots:** `Optional[List[AssociatedResource]]` Snapshots that are associated with this Droplet.
Requires `image:read` scope. - **id:** `Optional[str]` The unique identifier for the resource associated with the Droplet. - **cost:** `Optional[str]` The cost of the resource in USD per month if the resource is retained after the Droplet is destroyed. - **name:** `Optional[str]` The name of the resource associated with the Droplet. - **volume\_snapshots:** `Optional[List[AssociatedResource]]` Volume Snapshots that are associated with this Droplet.
Requires `block_storage_snapshot:read` scope. - **id:** `Optional[str]` The unique identifier for the resource associated with the Droplet. - **cost:** `Optional[str]` The cost of the resource in USD per month if the resource is retained after the Droplet is destroyed. - **name:** `Optional[str]` The name of the resource associated with the Droplet. - **volumes:** `Optional[List[AssociatedResource]]` Volumes that are associated with this Droplet.
Requires `block_storage:read` scope. - **id:** `Optional[str]` The unique identifier for the resource associated with the Droplet. - **cost:** `Optional[str]` The cost of the resource in USD per month if the resource is retained after the Droplet is destroyed. - **name:** `Optional[str]` The name of the resource associated with the Droplet. ### Example ```python from gradient import Gradient client = Gradient() destroy_with_associated_resources = client.gpu_droplets.destroy_with_associated_resources.list( 1, ) print(destroy_with_associated_resources.floating_ips) ``` ## Check Status `gpu_droplets.destroy_with_associated_resources.check_status(intdroplet_id) -> DestroyWithAssociatedResourceCheckStatusResponse` **get** `/v2/droplets/{droplet_id}/destroy_with_associated_resources/status` To check on the status of a request to destroy a Droplet with its associated resources, send a GET request to the `/v2/droplets/$DROPLET_ID/destroy_with_associated_resources/status` endpoint. ### Parameters - **droplet\_id:** `int` ### Returns - `class DestroyWithAssociatedResourceCheckStatusResponse` An objects containing information about a resources scheduled for deletion. - **completed\_at:** `Optional[datetime]` A time value given in ISO8601 combined date and time format indicating when the requested action was completed. - **droplet:** `Optional[DestroyedAssociatedResource]` An object containing information about a resource scheduled for deletion. - **failures:** `Optional[int]` A count of the associated resources that failed to be destroyed, if any. - **resources:** `Optional[Resources]` An object containing additional information about resource related to a Droplet requested to be destroyed. - **floating\_ips:** `Optional[List[DestroyedAssociatedResource]]` - **id:** `Optional[str]` The unique identifier for the resource scheduled for deletion. - **destroyed\_at:** `Optional[datetime]` A time value given in ISO8601 combined date and time format indicating when the resource was destroyed if the request was successful. - **error\_message:** `Optional[str]` A string indicating that the resource was not successfully destroyed and providing additional information. - **name:** `Optional[str]` The name of the resource scheduled for deletion. - **reserved\_ips:** `Optional[List[DestroyedAssociatedResource]]` - **id:** `Optional[str]` The unique identifier for the resource scheduled for deletion. - **destroyed\_at:** `Optional[datetime]` A time value given in ISO8601 combined date and time format indicating when the resource was destroyed if the request was successful. - **error\_message:** `Optional[str]` A string indicating that the resource was not successfully destroyed and providing additional information. - **name:** `Optional[str]` The name of the resource scheduled for deletion. - **snapshots:** `Optional[List[DestroyedAssociatedResource]]` - **id:** `Optional[str]` The unique identifier for the resource scheduled for deletion. - **destroyed\_at:** `Optional[datetime]` A time value given in ISO8601 combined date and time format indicating when the resource was destroyed if the request was successful. - **error\_message:** `Optional[str]` A string indicating that the resource was not successfully destroyed and providing additional information. - **name:** `Optional[str]` The name of the resource scheduled for deletion. - **volume\_snapshots:** `Optional[List[DestroyedAssociatedResource]]` - **id:** `Optional[str]` The unique identifier for the resource scheduled for deletion. - **destroyed\_at:** `Optional[datetime]` A time value given in ISO8601 combined date and time format indicating when the resource was destroyed if the request was successful. - **error\_message:** `Optional[str]` A string indicating that the resource was not successfully destroyed and providing additional information. - **name:** `Optional[str]` The name of the resource scheduled for deletion. - **volumes:** `Optional[List[DestroyedAssociatedResource]]` - **id:** `Optional[str]` The unique identifier for the resource scheduled for deletion. - **destroyed\_at:** `Optional[datetime]` A time value given in ISO8601 combined date and time format indicating when the resource was destroyed if the request was successful. - **error\_message:** `Optional[str]` A string indicating that the resource was not successfully destroyed and providing additional information. - **name:** `Optional[str]` The name of the resource scheduled for deletion. ### Example ```python from gradient import Gradient client = Gradient() response = client.gpu_droplets.destroy_with_associated_resources.check_status( 1, ) print(response.completed_at) ``` ## Delete Dangerous `gpu_droplets.destroy_with_associated_resources.delete_dangerous(intdroplet_id, DestroyWithAssociatedResourceDeleteDangerousParams**kwargs)` **delete** `/v2/droplets/{droplet_id}/destroy_with_associated_resources/dangerous` To destroy a Droplet along with all of its associated resources, send a DELETE request to the `/v2/droplets/$DROPLET_ID/destroy_with_associated_resources/dangerous` endpoint. The headers of this request must include an `X-Dangerous` key set to `true`. To preview which resources will be destroyed, first query the Droplet's associated resources. This operation _can not_ be reverse and should be used with caution. A successful response will include a 202 response code and no content. Use the status endpoint to check on the success or failure of the destruction of the individual resources. ### Parameters - **droplet\_id:** `int` - **x\_dangerous:** `bool` ### Example ```python from gradient import Gradient client = Gradient() client.gpu_droplets.destroy_with_associated_resources.delete_dangerous( droplet_id=3164444, x_dangerous=True, ) ``` ## Delete Selective `gpu_droplets.destroy_with_associated_resources.delete_selective(intdroplet_id, DestroyWithAssociatedResourceDeleteSelectiveParams**kwargs)` **delete** `/v2/droplets/{droplet_id}/destroy_with_associated_resources/selective` To destroy a Droplet along with a sub-set of its associated resources, send a DELETE request to the `/v2/droplets/$DROPLET_ID/destroy_with_associated_resources/selective` endpoint. The JSON body of the request should include `reserved_ips`, `snapshots`, `volumes`, or `volume_snapshots` keys each set to an array of IDs for the associated resources to be destroyed. The IDs can be found by querying the Droplet's associated resources. Any associated resource not included in the request will remain and continue to accrue changes on your account. A successful response will include a 202 response code and no content. Use the status endpoint to check on the success or failure of the destruction of the individual resources. ### Parameters - **droplet\_id:** `int` - **floating\_ips:** `List[str]` An array of unique identifiers for the floating IPs to be scheduled for deletion. - **reserved\_ips:** `List[str]` An array of unique identifiers for the reserved IPs to be scheduled for deletion. - **snapshots:** `List[str]` An array of unique identifiers for the snapshots to be scheduled for deletion. - **volume\_snapshots:** `List[str]` An array of unique identifiers for the volume snapshots to be scheduled for deletion. - **volumes:** `List[str]` An array of unique identifiers for the volumes to be scheduled for deletion. ### Example ```python from gradient import Gradient client = Gradient() client.gpu_droplets.destroy_with_associated_resources.delete_selective( droplet_id=3164444, ) ``` ## Retry `gpu_droplets.destroy_with_associated_resources.retry(intdroplet_id)` **post** `/v2/droplets/{droplet_id}/destroy_with_associated_resources/retry` If the status of a request to destroy a Droplet with its associated resources reported any errors, it can be retried by sending a POST request to the `/v2/droplets/$DROPLET_ID/destroy_with_associated_resources/retry` endpoint. Only one destroy can be active at a time per Droplet. If a retry is issued while another destroy is in progress for the Droplet a 409 status code will be returned. A successful response will include a 202 response code and no content. ### Parameters - **droplet\_id:** `int` ### Example ```python from gradient import Gradient client = Gradient() client.gpu_droplets.destroy_with_associated_resources.retry( 1, ) ``` ## Domain Types ### Associated Resource - `class AssociatedResource` An objects containing information about a resource associated with a Droplet. - **id:** `Optional[str]` The unique identifier for the resource associated with the Droplet. - **cost:** `Optional[str]` The cost of the resource in USD per month if the resource is retained after the Droplet is destroyed. - **name:** `Optional[str]` The name of the resource associated with the Droplet. ### Destroyed Associated Resource - `class DestroyedAssociatedResource` An object containing information about a resource scheduled for deletion. - **id:** `Optional[str]` The unique identifier for the resource scheduled for deletion. - **destroyed\_at:** `Optional[datetime]` A time value given in ISO8601 combined date and time format indicating when the resource was destroyed if the request was successful. - **error\_message:** `Optional[str]` A string indicating that the resource was not successfully destroyed and providing additional information. - **name:** `Optional[str]` The name of the resource scheduled for deletion.