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

    Interface KeysRequestBuilder

    Builds and executes requests for operations under /v2/account/keys

    interface KeysRequestBuilder {
        bySsh_key_identifier(
            ssh_key_identifier: number,
        ): WithSsh_key_identifierItemRequestBuilder;
        get(
            requestConfiguration?: RequestConfiguration<
                KeysRequestBuilderGetQueryParameters,
            >,
        ): Promise<undefined | KeysGetResponse>;
        post(
            body: SshKeys,
            requestConfiguration?: RequestConfiguration<object>,
        ): Promise<undefined | KeysPostResponse>;
        toGetRequestInformation(
            requestConfiguration?: RequestConfiguration<
                KeysRequestBuilderGetQueryParameters,
            >,
        ): RequestInformation;
        toPostRequestInformation(
            body: SshKeys,
            requestConfiguration?: RequestConfiguration<object>,
        ): RequestInformation;
        withUrl(rawUrl: string): KeysRequestBuilder;
    }

    Hierarchy

    Index

    Methods

    • To list all of the keys in your account, send a GET request to /v2/account/keys. The response will be a JSON object with a key set to ssh_keys. The value of this will be an array of ssh_key objects, each of which contains the standard ssh_key attributes.

      Parameters

      Returns Promise<undefined | KeysGetResponse>

      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: SshKeys,
          requestConfiguration?: RequestConfiguration<object>,
      ): Promise<undefined | KeysPostResponse>

      To add a new SSH public key to your DigitalOcean account, send a POST request to /v2/account/keys. Set the name attribute to the name you wish to use and the public_key attribute to the full public key you are adding.

      Parameters

      • body: SshKeys

        The request body

      • OptionalrequestConfiguration: RequestConfiguration<object>

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

      Returns Promise<undefined | KeysPostResponse>

      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 list all of the keys in your account, send a GET request to /v2/account/keys. The response will be a JSON object with a key set to ssh_keys. The value of this will be an array of ssh_key objects, each of which contains the standard ssh_key attributes.

      Parameters

      Returns RequestInformation

    • To add a new SSH public key to your DigitalOcean account, send a POST request to /v2/account/keys. Set the name attribute to the name you wish to use and the public_key attribute to the full public key you are adding.

      Parameters

      • body: SshKeys

        The request body

      • OptionalrequestConfiguration: RequestConfiguration<object>

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

      Returns RequestInformation

    • Parameters

      • rawUrl: string

      Returns KeysRequestBuilder