@digitalocean/dots - v1.0.1
    Preparing search index...

    Interface DropletsRequestBuilder

    Builds and executes requests for operations under /v2/droplets

    interface DropletsRequestBuilder {
        get actions(): ActionsRequestBuilder;
        get autoscale(): AutoscaleRequestBuilder;
        get backups(): BackupsRequestBuilder;
        byDroplet_id(droplet_id: number): WithDroplet_ItemRequestBuilder;
        delete(
            requestConfiguration?: RequestConfiguration<
                DropletsRequestBuilderDeleteQueryParameters,
            >,
        ): Promise<void>;
        get(
            requestConfiguration?: RequestConfiguration<
                DropletsRequestBuilderGetQueryParameters,
            >,
        ): Promise<undefined | DropletsGetResponse>;
        post(
            body: Droplet_multi_create | Droplet_single_create,
            requestConfiguration?: RequestConfiguration<object>,
        ): Promise<
            undefined
            | DropletsPostResponseMember1
            | DropletsPostResponseMember2,
        >;
        toDeleteRequestInformation(
            requestConfiguration?: RequestConfiguration<
                DropletsRequestBuilderDeleteQueryParameters,
            >,
        ): RequestInformation;
        toGetRequestInformation(
            requestConfiguration?: RequestConfiguration<
                DropletsRequestBuilderGetQueryParameters,
            >,
        ): RequestInformation;
        toPostRequestInformation(
            body: Droplet_multi_create | Droplet_single_create,
            requestConfiguration?: RequestConfiguration<object>,
        ): RequestInformation;
        withUrl(rawUrl: string): DropletsRequestBuilder;
    }

    Hierarchy

    Index

    Accessors

    Methods

    • To delete all Droplets assigned to a specific tag, include the tag_namequery parameter set to the name of the tag in your DELETE request. Forexample, /v2/droplets?tag_name=$TAG_NAME.This endpoint requires tag:read scope.A successful request will receive a 204 status code with no body in response.This indicates that the request was processed successfully.

      Parameters

      Returns Promise<void>

      error when the service returns a 401 status code

      error when the service returns a 404 status code

      error when the service returns a 429 status code

      error when the service returns a 500 status code

      error when the service returns a 4XX or 5XX status code

    • To list all Droplets in your account, send a GET request to /v2/droplets.The response body will be a JSON object with a key of droplets. This will beset to an array containing objects each representing a Droplet. These willcontain the standard Droplet attributes.### Filtering Results by TagIt's possible to request filtered results by including certain query parameters.To only list Droplets assigned to a specific tag, include the tag_name queryparameter set to the name of the tag in your GET request. For example,/v2/droplets?tag_name=$TAG_NAME.### GPU DropletsBy default, only non-GPU Droplets are returned. To list only GPU Droplets, setthe type query parameter to gpus. For example, /v2/droplets?type=gpus.

      Parameters

      Returns Promise<undefined | DropletsGetResponse>

      error when the service returns a 401 status code

      error when the service returns a 429 status code

      error when the service returns a 500 status code

      error when the service returns a 4XX or 5XX status code

    post

    • post(
          body: Droplet_multi_create | Droplet_single_create,
          requestConfiguration?: RequestConfiguration<object>,
      ): Promise<
          undefined
          | DropletsPostResponseMember1
          | DropletsPostResponseMember2,
      >

      To create a new Droplet, send a POST request to /v2/droplets setting therequired attributes.A Droplet will be created using the provided information. The response bodywill contain a JSON object with a key called droplet. The value will be anobject containing the standard attributes for your new Droplet. The responsecode, 202 Accepted, does not indicate the success or failure of the operation,just that the request has been accepted for processing. The actions returnedas part of the response's links object can be used to check the statusof the Droplet create event.### Create Multiple DropletsCreating multiple Droplets is very similar to creating a single Droplet.Instead of sending name as a string, send names as an array of strings. ADroplet will be created for each name you send using the associatedinformation. Up to ten Droplets may be created this way at a time.Rather than returning a single Droplet, the response body will contain a JSONarray with a key called droplets. This will be set to an array of JSONobjects, each of which will contain the standard Droplet attributes. Theresponse code, 202 Accepted, does not indicate the success or failure of anyoperation, just that the request has been accepted for processing. The arrayof actions returned as part of the response's links object can be used tocheck the status of each individual Droplet create event.

      Parameters

      • body: Droplet_multi_create | Droplet_single_create

        The request body

      • OptionalrequestConfiguration: RequestConfiguration<object>

        Configuration for the request such as headers, query parameters, and middleware options.

      Returns Promise<undefined | DropletsPostResponseMember1 | DropletsPostResponseMember2>

      error when the service returns a 401 status code

      error when the service returns a 429 status code

      error when the service returns a 500 status code

      error when the service returns a 4XX or 5XX status code

    • To delete all Droplets assigned to a specific tag, include the tag_namequery parameter set to the name of the tag in your DELETE request. Forexample, /v2/droplets?tag_name=$TAG_NAME.This endpoint requires tag:read scope.A successful request will receive a 204 status code with no body in response.This indicates that the request was processed successfully.

      Parameters

      Returns RequestInformation

    • To list all Droplets in your account, send a GET request to /v2/droplets.The response body will be a JSON object with a key of droplets. This will beset to an array containing objects each representing a Droplet. These willcontain the standard Droplet attributes.### Filtering Results by TagIt's possible to request filtered results by including certain query parameters.To only list Droplets assigned to a specific tag, include the tag_name queryparameter set to the name of the tag in your GET request. For example,/v2/droplets?tag_name=$TAG_NAME.### GPU DropletsBy default, only non-GPU Droplets are returned. To list only GPU Droplets, setthe type query parameter to gpus. For example, /v2/droplets?type=gpus.

      Parameters

      Returns RequestInformation

    • To create a new Droplet, send a POST request to /v2/droplets setting therequired attributes.A Droplet will be created using the provided information. The response bodywill contain a JSON object with a key called droplet. The value will be anobject containing the standard attributes for your new Droplet. The responsecode, 202 Accepted, does not indicate the success or failure of the operation,just that the request has been accepted for processing. The actions returnedas part of the response's links object can be used to check the statusof the Droplet create event.### Create Multiple DropletsCreating multiple Droplets is very similar to creating a single Droplet.Instead of sending name as a string, send names as an array of strings. ADroplet will be created for each name you send using the associatedinformation. Up to ten Droplets may be created this way at a time.Rather than returning a single Droplet, the response body will contain a JSONarray with a key called droplets. This will be set to an array of JSONobjects, each of which will contain the standard Droplet attributes. Theresponse code, 202 Accepted, does not indicate the success or failure of anyoperation, just that the request has been accepted for processing. The arrayof actions returned as part of the response's links object can be used tocheck the status of each individual Droplet create event.

      Parameters

      • body: Droplet_multi_create | Droplet_single_create

        The request body

      • OptionalrequestConfiguration: RequestConfiguration<object>

        Configuration for the request such as headers, query parameters, and middleware options.

      Returns RequestInformation

    • Parameters

      • rawUrl: string

      Returns DropletsRequestBuilder