Skip to content

Latest commit

 

History

History
5254 lines (3401 loc) · 132 KB

SDK_EXAMPLES.md

File metadata and controls

5254 lines (3401 loc) · 132 KB

SDK Usage Examples

Module account

Get your account

Returns the contact and billing information related to your Account.

<>

linode-cli account view

<https://www.linode.com/docs/products/tools/cli/get-started/>
account:read_only

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: GET /{apiVersion}/account

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.list(api_version="v4")

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.list(api_version="v4")

Update your account

Updates contact and billing information related to your account. If you exclude any properties from the request, the operation leaves them unchanged.

Note. When updating an account's country to US, you'll get an error if the account's zip is not a valid US zip code.

Parent and child accounts

In a parent and child account environment, the following apply:

  • You can't change the company for a parent account. Akamai uses this value to set the name for a child account parent user (proxy user) on any child account.

  • Child account users can't run this operation. These users don't have access to billing-related operations.

<>

linode-cli account update \
  --address_1 "123 Main St." \
  --address_2 "Suite 101" \
  --city Philadelphia \
  --company My Company \ LLC \
  --country US \
  --email [email protected] \
  --first_name John \
  --last_name Smith \
  --phone 555-555-1212 \
  --state PA \
  --tax_id ATU99999999 \
  --zip 19102

<https://www.linode.com/docs/products/tools/cli/get-started/>
account:read_write

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: PUT /{apiVersion}/account

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.update(
    api_version="v4",
    data={
        "active_promotions": [
            {
                "credit_monthly_cap": "10.00",
                "credit_remaining": "50.00",
                "description": "Receive up to $10 off your services every month for 6 months! Unused credits will expire once this promotion period ends.",
                "expire_dt": "2018-01-31T23:59:59",
                "image_url": "https://linode.com/10_a_month_promotion.svg",
                "service_type": "all",
                "summary": "$10 off your Linode a month!",
                "this_month_credit_remaining": "10.00",
            }
        ],
        "active_since": "2018-01-01T00:01:01",
        "address_1": "123 Main Street",
        "address_2": "Suite A",
        "balance": 200,
        "balance_uninvoiced": 145,
        "billing_source": "akamai",
        "capabilities": [
            "Linodes",
            "NodeBalancers",
            "Block Storage",
            "Object Storage",
            "Placement Groups",
            "Block Storage Encryption",
        ],
        "city": "Philadelphia",
        "company": "Linode LLC",
        "country": "US",
        "credit_card": {"expiry": "11/2022", "last_four": "string"},
        "email_field": "[email protected]",
        "euuid": "E1AF5EEC-526F-487D-B317EBEB34C87D71",
        "first_name": "John",
        "last_name": "Smith",
        "phone": "215-555-1212",
        "state": "PA",
        "tax_id": "ATU99999999",
        "zip": "19102-1234",
    },
)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.update(
    api_version="v4",
    data={
        "active_promotions": [
            {
                "credit_monthly_cap": "10.00",
                "credit_remaining": "50.00",
                "description": "Receive up to $10 off your services every month for 6 months! Unused credits will expire once this promotion period ends.",
                "expire_dt": "2018-01-31T23:59:59",
                "image_url": "https://linode.com/10_a_month_promotion.svg",
                "service_type": "all",
                "summary": "$10 off your Linode a month!",
                "this_month_credit_remaining": "10.00",
            }
        ],
        "active_since": "2018-01-01T00:01:01",
        "address_1": "123 Main Street",
        "address_2": "Suite A",
        "balance": 200,
        "balance_uninvoiced": 145,
        "billing_source": "akamai",
        "capabilities": [
            "Linodes",
            "NodeBalancers",
            "Block Storage",
            "Object Storage",
            "Placement Groups",
            "Block Storage Encryption",
        ],
        "city": "Philadelphia",
        "company": "Linode LLC",
        "country": "US",
        "credit_card": {"expiry": "11/2022", "last_four": "string"},
        "email_field": "[email protected]",
        "euuid": "E1AF5EEC-526F-487D-B317EBEB34C87D71",
        "first_name": "John",
        "last_name": "Smith",
        "phone": "215-555-1212",
        "state": "PA",
        "tax_id": "ATU99999999",
        "zip": "19102-1234",
    },
)

Module account.entity_transfers

Cancel an entity transfer

Deprecated Please run Cancel a service transfer.

<>


OAuth scopes

account:read_write

Learn more...

API Endpoint: DELETE /{apiVersion}/account/entity-transfers/{token}

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.entity_transfers.delete(
    api_version="v4", token_path="3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a"
)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.entity_transfers.delete(
    api_version="v4", token_path="3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a"
)

List entity transfers

Deprecated Please run List service transfers.

<>


OAuth scopes

account:read_only

Learn more...

API Endpoint: GET /{apiVersion}/account/entity-transfers

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.entity_transfers.list(api_version="v4", page=123, page_size=123)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.entity_transfers.list(
    api_version="v4", page=123, page_size=123
)

Get an entity transfer

Deprecated Please run Get a service transfer request.

<>


OAuth scopes

account:read_only

Learn more...

API Endpoint: GET /{apiVersion}/account/entity-transfers/{token}

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.entity_transfers.get(
    api_version="v4", token_path="3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a"
)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.entity_transfers.get(
    api_version="v4", token_path="3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a"
)

Create an entity transfer

Deprecated Please run Request a service transfer.

<>


OAuth scopes

account:read_write

Learn more...

API Endpoint: POST /{apiVersion}/account/entity-transfers

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.entity_transfers.create(
    api_version="v4", data={"entities": {"linodes": [111, 222]}}
)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.entity_transfers.create(
    api_version="v4", data={"entities": {"linodes": [111, 222]}}
)

Module account.oauth_clients

Delete an OAuth client

Deletes an OAuth Client registered with Linode. The Client ID and Client secret will no longer be accepted by login.linode.com, and all tokens issued to this client will be invalidated (meaning that if your application was using a token, it will no longer work).

<>

linode-cli account client-delete \
  edc6790ea9db4d224c5c

<https://www.linode.com/docs/products/tools/cli/get-started/>
account:read_write

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: DELETE /{apiVersion}/account/oauth-clients/{clientId}

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.oauth_clients.delete(api_version="v4", client_id="string")

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.oauth_clients.delete(api_version="v4", client_id="string")

List OAuth clients

Returns a paginated list of OAuth Clients registered to your Account. OAuth Clients allow users to log into applications you write or host using their Linode Account, and may allow them to grant some level of access to their Linodes or other entities to your application.

<>

linode-cli account clients-list

<https://www.linode.com/docs/products/tools/cli/get-started/>
account:read_only

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: GET /{apiVersion}/account/oauth-clients

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.oauth_clients.list(api_version="v4", page=123, page_size=123)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.oauth_clients.list(api_version="v4", page=123, page_size=123)

Get an OAuth client

Returns information about a single OAuth client.

<>

linode-cli account client-view \
  edc6790ea9db4d224c5c

<https://www.linode.com/docs/products/tools/cli/get-started/>
account:read_only

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: GET /{apiVersion}/account/oauth-clients/{clientId}

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.oauth_clients.get(api_version="v4", client_id="string")

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.oauth_clients.get(api_version="v4", client_id="string")

Create an OAuth client

Creates an OAuth Client, which can be used to allow users (using their Linode account) to log in to your own application, and optionally grant your application some amount of access to their Linodes or other entities.

<>

linode-cli account client-create \
  --label Test_Client_1 \
  --redirect_uri https://example.org/callback

<https://www.linode.com/docs/products/tools/cli/get-started/>
account:read_write

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: POST /{apiVersion}/account/oauth-clients

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.oauth_clients.create(
    api_version="v4",
    data={
        "id": "2737bf16b39ab5d7b4a1",
        "label": "Test_Client_1",
        "public": False,
        "redirect_uri": "https://example.org/oauth/callback",
        "secret": "<REDACTED>",
        "status": "active",
        "thumbnail_url": "https://api.linode.com/v4/account/clients/2737bf16b39ab5d7b4a1/thumbnail",
    },
)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.oauth_clients.create(
    api_version="v4",
    data={
        "id": "2737bf16b39ab5d7b4a1",
        "label": "Test_Client_1",
        "public": False,
        "redirect_uri": "https://example.org/oauth/callback",
        "secret": "<REDACTED>",
        "status": "active",
        "thumbnail_url": "https://api.linode.com/v4/account/clients/2737bf16b39ab5d7b4a1/thumbnail",
    },
)

Update an OAuth client

Update information about an OAuth Client on your Account. This can be especially useful to update the redirect_uri of your client in the event that the callback url changed in your application.

<>

linode-cli account client-update \
  edc6790ea9db4d224c5c \
  --label Test_Client_1

<https://www.linode.com/docs/products/tools/cli/get-started/>
account:read_write

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: PUT /{apiVersion}/account/oauth-clients/{clientId}

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.oauth_clients.update(
    api_version="v4",
    client_id="string",
    data={
        "id": "2737bf16b39ab5d7b4a1",
        "label": "Test_Client_1",
        "public": False,
        "redirect_uri": "https://example.org/oauth/callback",
        "secret": "<REDACTED>",
        "status": "active",
        "thumbnail_url": "https://api.linode.com/v4/account/clients/2737bf16b39ab5d7b4a1/thumbnail",
    },
)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.oauth_clients.update(
    api_version="v4",
    client_id="string",
    data={
        "id": "2737bf16b39ab5d7b4a1",
        "label": "Test_Client_1",
        "public": False,
        "redirect_uri": "https://example.org/oauth/callback",
        "secret": "<REDACTED>",
        "status": "active",
        "thumbnail_url": "https://api.linode.com/v4/account/clients/2737bf16b39ab5d7b4a1/thumbnail",
    },
)

Module account.payment_methods

Delete a payment method

Deactivate the specified Payment Method.

The default Payment Method can not be deleted. To add a new default Payment Method, run the Add a payment method operation. To designate an existing Payment Method as the default method, run the Set a default payment method operation.

<>

linode-cli payment-methods delete 123

<https://www.linode.com/docs/products/tools/cli/get-started/>
account:read_only

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: DELETE /{apiVersion}/account/payment-methods/{paymentMethodId}

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.payment_methods.delete(api_version="v4", payment_method_id=123)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.payment_methods.delete(
    api_version="v4", payment_method_id=123
)

List payment methods

Returns a paginated list of Payment Methods for this Account.

<>

linode-cli payment-methods list

<https://www.linode.com/docs/products/tools/cli/get-started/>
account:read_only

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: GET /{apiVersion}/account/payment-methods

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.payment_methods.list(api_version="v4", page=123, page_size=123)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.payment_methods.list(
    api_version="v4", page=123, page_size=123
)

Get a payment method

View the details of the specified Payment Method.

<>

linode-cli payment-methods view 123

<https://www.linode.com/docs/products/tools/cli/get-started/>
account:read_only

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: GET /{apiVersion}/account/payment-methods/{paymentMethodId}

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.payment_methods.get(api_version="v4", payment_method_id=123)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.payment_methods.get(api_version="v4", payment_method_id=123)

Add a payment method

Adds a Payment Method to your Account with the option to set it as the default method.

  • Adding a default Payment Method removes the default status from any other Payment Method.

  • An Account can have up to 6 active Payment Methods.

  • Up to 60 Payment Methods can be added each day.

  • Prior to adding a Payment Method, ensure that your billing address information is up-to-date with a valid zip by running the Update your account operation.

  • A payment_method_add event is generated when a payment is successfully submitted.

Parent and child accounts

In a parent and child account environment, the following apply:

  • Child account users can't run this operation. These users don't have access to billing-related operations.

<>

linode-cli payment-methods add \
  --type credit_card \
  --is_default true \
  --data.card_number 4111111111111111 \
  --data.expiry_month 11 \
  --data.expiry_year 2020 \
  --data.cvv 111

<https://www.linode.com/docs/products/tools/cli/get-started/>
account:read_write

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: POST /{apiVersion}/account/payment-methods

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.payment_methods.create(
    api_version="v4",
    data={
        "data": {
            "card_number": "string",
            "cvv": "123",
            "expiry_month": 12,
            "expiry_year": 2020,
        },
        "is_default": True,
        "type_field": "credit_card",
    },
)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.payment_methods.create(
    api_version="v4",
    data={
        "data": {
            "card_number": "string",
            "cvv": "123",
            "expiry_month": 12,
            "expiry_year": 2020,
        },
        "is_default": True,
        "type_field": "credit_card",
    },
)

Module account.service_transfers

Cancel a service transfer

Cancels the Service Transfer for the provided token. Once canceled, a transfer cannot be accepted or otherwise acted on in any way. If canceled in error, the transfer must be created again.

When canceled, an email notification for the cancellation is sent to the account that created this transfer. Transfers can not be canceled if they are expired or have been accepted.

This operation can only be accessed by the unrestricted users of the account that created this transfer.

<>

linode-cli service-transfers \
  cancel 123E4567-E89B-12D3-A456-426614174000

<https://www.linode.com/docs/products/tools/cli/get-started/>
account:read_write

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: DELETE /{apiVersion}/account/service-transfers/{token}

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.service_transfers.delete(
    api_version="v4", token_path="3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a"
)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.service_transfers.delete(
    api_version="v4", token_path="3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a"
)

List service transfers

Returns a collection of all created and accepted Service Transfers for this account, regardless of the user that created or accepted the transfer.

This operation can only be accessed by the unrestricted users of an account.

<>

linode-cli service-transfers \
  list

<https://www.linode.com/docs/products/tools/cli/get-started/>
account:read_only

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: GET /{apiVersion}/account/service-transfers

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.service_transfers.list(api_version="v4", page=123, page_size=123)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.service_transfers.list(
    api_version="v4", page=123, page_size=123
)

Get a service transfer request

Returns the details of the Service Transfer for the provided token.

While a transfer is pending, any unrestricted user of any account can access this operation. After a transfer has been accepted, it can only be viewed by unrestricted users of the accounts that created and accepted the transfer. If canceled or expired, only unrestricted users of the account that created the transfer can view it.

<>

linode-cli service-transfers \
  view 123E4567-E89B-12D3-A456-426614174000

<https://www.linode.com/docs/products/tools/cli/get-started/>
account:read_only

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: GET /{apiVersion}/account/service-transfers/{token}

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.service_transfers.get(
    api_version="v4", token_path="3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a"
)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.service_transfers.get(
    api_version="v4", token_path="3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a"
)

Request a service transfer

Creates a transfer request for the specified services. A request can contain any of the specified service types and any number of each service type. At this time, only Linodes can be transferred.

When created successfully, a confirmation email is sent to the account that created this transfer containing a transfer token and instructions on completing the transfer.

When a transfer is accepted, the requested services are moved to the receiving account. Linode services will not experience interruptions due to the transfer process. Backups for Linodes are transferred as well.

DNS records that are associated with requested services will not be transferred or updated. Please ensure that associated DNS records have been updated or communicated to the recipient prior to the transfer.

A transfer can take up to three hours to complete once accepted. When a transfer is completed, billing for transferred services ends for the sending account and begins for the receiving account.

This operation can only be accessed by the unrestricted users of an account.

There are several conditions that you need to meet to successfully create a transfer request:

  1. The account creating the transfer can't have a past due balance or active Terms of Service violation.

  2. The service needs to be owned by the account that is creating the transfer.

  3. The service can't be assigned to another Service Transfer that is pending or that's been accepted and is incomplete.

  4. Linodes can't:

    • be assigned to a NodeBalancer, Firewall, VLAN, VPC, or Managed Service.

    • have any attached Block Storage Volumes.

    • have any shared IP addresses.

    • have any assigned /56, /64, or /116 IPv6 ranges.

<>

linode-cli service-transfers \
  create \
  --entities.linodes 111 \
  --entities.linodes 222

<https://www.linode.com/docs/products/tools/cli/get-started/>
account:read_write

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: POST /{apiVersion}/account/service-transfers

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.service_transfers.create(
    api_version="v4", data={"entities": {"linodes": [111, 222]}}
)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.service_transfers.create(
    api_version="v4", data={"entities": {"linodes": [111, 222]}}
)

Module account.users

Delete a user

Deletes a user. The API immediately logs the user out and removes all of its grants.

Note. This operation can only be accessed by account users with unrestricted access.

Parent and child accounts

In a parent and child account environment, the following apply:

  • You can't delete a child account parent user (proxy user). The API returns a 403 error if you target a proxy user with this operation.

  • A parent account using an unrestricted proxy user can use this operation to delete a child account user.

<>

linode-cli users delete example_user

<https://www.linode.com/docs/products/tools/cli/get-started/>
account:read_write

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: DELETE /{apiVersion}/account/users/{username}

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.users.delete(api_version="v4", username="string")

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.users.delete(api_version="v4", username="string")

List users

Returns a paginated list of all users on your account.

Note. This operation can only be accessed by account users with unrestricted access.

A user can access all or part of an account based on their access status and grants:

  • Unrestricted access. These users can access everything on an account.

  • Restricted access. These users can only access entities or perform actions they've been given specific grants to.

<>

linode-cli users list

<https://www.linode.com/docs/products/tools/cli/get-started/>
account:read_only

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: GET /{apiVersion}/account/users

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.users.list(api_version="v4", page=123, page_size=123)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.users.list(api_version="v4", page=123, page_size=123)

Get a user

Returns information about a single user on your account.

Note. This operation can only be accessed by account users with unrestricted access.

<>

linode-cli users view example_user

<https://www.linode.com/docs/products/tools/cli/get-started/>
account:read_only

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: GET /{apiVersion}/account/users/{username}

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.users.get(api_version="v4", username="string")

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.users.get(api_version="v4", username="string")

Create a user

Creates a user on your account. You determine the new user's account access by setting it to restricted or unrestricted and by defining its grants. After completion, the API sends a confirmation message containing password creation and login instructions to the user's email address.

Note. This operation can only be accessed by account users with unrestricted access.

Parent and child accounts

In a parent and child account environment, the following apply:

  • A parent account user can create new parent account users.

  • A child account can update the child account parent user (proxy user) to unrestricted. This gives the proxy user access to create new child account users.

  • A child account user can create new child account users.

  • You can't create a proxy user. The proxy user in a child account is predefined when you initially provision the parent-child relationship.

<>

linode-cli users create \
  --username example_user \
  --email [email protected] \
  --restricted true

<https://www.linode.com/docs/products/tools/cli/get-started/>
account:read_write

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: POST /{apiVersion}/account/users

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.users.create(
    api_version="v4",
    data={
        "email_field": "[email protected]",
        "last_login": {"login_datetime": "2018-01-01T01:01:01", "status": "successful"},
        "password_created": "2018-01-01T01:01:01",
        "restricted": True,
        "ssh_keys": ["home-pc", "laptop"],
        "tfa_enabled": True,
        "username": "example_user",
        "verified_phone_number": "+5555555555",
    },
)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.users.create(
    api_version="v4",
    data={
        "email_field": "[email protected]",
        "last_login": {"login_datetime": "2018-01-01T01:01:01", "status": "successful"},
        "password_created": "2018-01-01T01:01:01",
        "restricted": True,
        "ssh_keys": ["home-pc", "laptop"],
        "tfa_enabled": True,
        "username": "example_user",
        "verified_phone_number": "+5555555555",
    },
)

Update a user

Update information about a user on your account, including its restricted status. When setting a user to restricted, the API sets no grants for it. You need to set grants so that user can access things on the account.

Note. This operation can only be accessed by account users with unrestricted access.

Parent and child accounts

In a parent and child account environment, the following apply:

  • You can't edit the username or email values for the child account parent user (proxy user). These are predefined for the proxy user when you initially provision the parent-child relationship. Only a proxy user's restricted status can be modified. This can only be done by an unrestricted child account user.

  • A parent account using an unrestricted proxy user in a child account can modify the username, email, and restricted status for an existing child account user.

  • A restricted account user--parent or child--can't change their user to unrestricted.

<>

linode-cli users update example_user \
  --username example_user \
  --email [email protected] \
  --restricted true

<https://www.linode.com/docs/products/tools/cli/get-started/>
account:read_write

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: PUT /{apiVersion}/account/users/{username}

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.users.update(
    api_version="v4",
    username="string",
    data={
        "email_field": "[email protected]",
        "last_login": {"login_datetime": "2018-01-01T01:01:01", "status": "successful"},
        "password_created": "2018-01-01T01:01:01",
        "restricted": True,
        "ssh_keys": ["home-pc", "laptop"],
        "tfa_enabled": True,
        "username": "example_user",
        "verified_phone_number": "+5555555555",
    },
)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.users.update(
    api_version="v4",
    username="string",
    data={
        "email_field": "[email protected]",
        "last_login": {"login_datetime": "2018-01-01T01:01:01", "status": "successful"},
        "password_created": "2018-01-01T01:01:01",
        "restricted": True,
        "ssh_keys": ["home-pc", "laptop"],
        "tfa_enabled": True,
        "username": "example_user",
        "verified_phone_number": "+5555555555",
    },
)

Module object-storage.buckets

Remove an Object Storage bucket

Removes a single bucket.

📘

  • You need to remove all objects from a bucket before you can delete it. While you can delete a bucket using the s3cmd command-line tool, this operation fails if the bucket contains too many objects. The best way to empty large buckets is to use the S3 API to configure lifecycle policies. Set a policy to remove all objects, wait a day or more for the system to remove all objects, then delete the bucket.

  • The S3 API equivalent operation offers more detail.

<>


OAuth scopes

object_storage:read_write

Learn more...

API Endpoint: DELETE /{apiVersion}/object-storage/buckets/{regionId}/{bucket}

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.object_storage.buckets.delete(
    api_version="v4", region_id="string", bucket="string"
)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.object_storage.buckets.delete(
    api_version="v4", region_id="string", bucket="string"
)

List Object Storage buckets

Returns a paginated list of all Object Storage buckets available in your account.

📘

The S3 API equivalent operation offers more detail.

<>


OAuth scopes

object_storage:read_only

Learn more...

API Endpoint: GET /{apiVersion}/object-storage/buckets

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.object_storage.buckets.list(api_version="v4")

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.object_storage.buckets.list(api_version="v4")

List Object Storage buckets per region

Returns a list of buckets on your account, in the specified region.

📘

The S3 API equivalent operation offers more detail.

<>


OAuth scopes

object_storage:read_only

Learn more...

API Endpoint: GET /{apiVersion}/object-storage/buckets/{regionId}

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.object_storage.buckets.get(api_version="v4", region_id="string")

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.object_storage.buckets.get(api_version="v4", region_id="string")

Get an Object Storage bucket

Returns a single Object Storage bucket.

📘

The S3 API equivalent operation offers more detail.

<>


OAuth scopes

object_storage:read_only

Learn more...

API Endpoint: GET /{apiVersion}/object-storage/buckets/{regionId}/{bucket}

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.object_storage.buckets.get_cluster(
    api_version="v4", region_id="string", bucket="string"
)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.object_storage.buckets.get_cluster(
    api_version="v4", region_id="string", bucket="string"
)

Create an Object Storage bucket

Creates an Object Storage bucket in the specified data center (region). If the bucket already exists on your account, this operation returns a 200 response with that bucket as if the API just created it.

📘

  • Accounts with negative balances can't access this operation.

  • The S3 API equivalent operation offers more detail.

  • The API still supports the clusterId equivalent (us-west-1) when setting a region for a new bucket, but you should use the regionId (us-west), instead.

<>


OAuth scopes

object_storage:read_write

Learn more...

API Endpoint: POST /{apiVersion}/object-storage/buckets

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.object_storage.buckets.create(
    api_version="v4",
    data={
        "acl": "private",
        "cors_enabled": False,
        "label": "example-bucket",
        "region": "us-east",
    },
)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.object_storage.buckets.create(
    api_version="v4",
    data={
        "acl": "private",
        "cors_enabled": False,
        "label": "example-bucket",
        "region": "us-east",
    },
)

Module object-storage.buckets.ssl

Delete an Object Storage TLS/SSL certificate

Deletes this Object Storage bucket's user uploaded TLS/SSL certificate and private key.

<>

linode-cli object-storage ssl-delete \
  us-east-1 example-bucket

<https://www.linode.com/docs/products/tools/cli/get-started/>
object_storage:read_write

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: DELETE /{apiVersion}/object-storage/buckets/{regionId}/{bucket}/ssl

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.object_storage.buckets.ssl_resource.delete(
    api_version="v4", region_id="string", bucket="string"
)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.object_storage.buckets.ssl_resource.delete(
    api_version="v4", region_id="string", bucket="string"
)

Get an Object Storage TLS/SSL certificate

Returns a boolean value indicating if this bucket has a corresponding TLS/SSL certificate that was uploaded by an Account user.

<>

linode-cli object-storage ssl-view \
  us-east-1 example-bucket

<https://www.linode.com/docs/products/tools/cli/get-started/>
object_storage:read_only

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: GET /{apiVersion}/object-storage/buckets/{regionId}/{bucket}/ssl

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.object_storage.buckets.ssl_resource.list(
    api_version="v4", region_id="string", bucket="string"
)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.object_storage.buckets.ssl_resource.list(
    api_version="v4", region_id="string", bucket="string"
)

Upload an Object Storage TLS/SSL certificate

Upload a TLS/SSL certificate and private key to be served when you visit your Object Storage bucket via HTTPS. Your TLS/SSL certificate and private key are stored encrypted at rest.

To replace an expired certificate, delete your current certificates and upload a new one.

<>

linode-cli object-storage ssl-upload \
  us-east-1 example-bucket \
  --certificate "-----BEGIN CERTIFICATE-----
                 CERTIFICATE_INFORMATION
                 -----END CERTIFICATE-----" \
  --private_key "-----BEGIN PRIVATE KEY-----
                 PRIVATE_KEY_INFORMATION
                 -----END PRIVATE KEY-----"

<https://www.linode.com/docs/products/tools/cli/get-started/>
object_storage:read_write

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: POST /{apiVersion}/object-storage/buckets/{regionId}/{bucket}/ssl

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.object_storage.buckets.ssl_resource.create(
    api_version="v4",
    region_id="string",
    bucket="string",
    data={
        "certificate": "-----BEGIN CERTIFICATE-----\nCERTIFICATE_INFORMATION\n-----END CERTIFICATE-----",
        "private_key": "-----BEGIN PRIVATE KEY-----\nPRIVATE_KEY_INFORMATION\n-----END PRIVATE KEY-----",
    },
)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.object_storage.buckets.ssl_resource.create(
    api_version="v4",
    region_id="string",
    bucket="string",
    data={
        "certificate": "-----BEGIN CERTIFICATE-----\nCERTIFICATE_INFORMATION\n-----END CERTIFICATE-----",
        "private_key": "-----BEGIN PRIVATE KEY-----\nPRIVATE_KEY_INFORMATION\n-----END PRIVATE KEY-----",
    },
)

Module object-storage.keys

Revoke an Object Storage key

Revokes an Object Storage Key. This keypair will no longer be usable by third-party clients.

  • A successful request triggers an obj_access_key_delete event.

<>

linode-cli object-storage keys-delete 12345

<https://www.linode.com/docs/products/tools/cli/get-started/>
object_storage:read_write

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: DELETE /{apiVersion}/object-storage/keys/{keyId}

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.object_storage.keys.delete(api_version="v4", key_id=123)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.object_storage.keys.delete(api_version="v4", key_id=123)

List Object Storage keys

Returns a paginated list of Object Storage keys for authenticating to the Object Storage S3 API.

<>

linode-cli object-storage keys-list

<https://www.linode.com/docs/products/tools/cli/get-started/>
object_storage:read_only

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: GET /{apiVersion}/object-storage/keys

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.object_storage.keys.list(api_version="v4")

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.object_storage.keys.list(api_version="v4")

Get an Object Storage key

Returns a single Object Storage key provisioned for your account.

<>

linode-cli object-storage keys-view \
  --keyId 12345

<https://www.linode.com/docs/products/tools/cli/get-started/>
object_storage:read_only

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: GET /{apiVersion}/object-storage/keys/{keyId}

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.object_storage.keys.get(api_version="v4", key_id=123)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.object_storage.keys.get(api_version="v4", key_id=123)

Create an Object Storage key

Provisions a new Object Storage key for authenticating to the Object Storage S3 API. A successful request triggers an obj_access_key_create event.

📘

Accounts with negative balances can't access this operation.

The regions and region parameters

When creating an Object Storage key, specify one or more data centers (regions) where you want to create and manage Object Storage buckets.

  • The regions array. Populate it with regionId values. The resulting Object Storage key grants access to list and create new buckets in these regions. This doesn't give access to manage content in these buckets. To address this, you can:

    • Use the bucket_access array instead to grant management access, per bucket.

    • Use bucket policies to change the access for this key.

  • The bucket_access array. This optional array lets you set up limited keys. Include individual objects naming a regionId, the target bucket_name, and the permissions for the Object Storage key. Use the resulting key to manage content in the bucket_name, based on the permission level set. You can also use the key to create new buckets in the named region. However, the key doesn't have access to manage content in the newly created bucket. You can grant it this access using bucket policies.

  • Combine the two to apply varying levels of access in the key. For example, set regions to us-west to give the key bucket list and create access in that region. Then, set up the bucket_access array to give access to a specific bucket_name in the us-east region. The key has access to manage content in that bucket_name and list and create buckets in the us-east region, too. If you include the same region in both, the settings applied in the bucket_access array take precedence. For example, assume you include us-east in the regions array, expecting to only give bucket list and creation access to that region. If you also set us-east as a region in the bucket_access array, the Object Storage key gives access to manage content in the specified bucket_name, and lets you list and create buckets in that region.

The cluster parameter (legacy)

For backward compatibility, include the cluster parameter to create an Object Storage key. Use the clusterId equivalent (us-west-1) instead of the regionId (us-west). Leave the regions array out. If including the bucket_access array to limit access, omit region from each object. Use the resulting key in clusters in all supported regions.

📘

While the API supports this method, you should use the regions parameters, instead.

  • Unlimited access. Omit the bucket_access array. The Object Storage key has unlimited cluster access to all buckets, with all permissions.

  • Limited access. Include the bucket_access array. Set the target bucket_name and the level of permissions for access to that bucket. Use the resulting key to manage content in the named bucket. A limited Object Storage key can list all buckets and create a new bucket. However, you can't use the key to perform any actions on a bucket, unless the key has access to it. You can use bucket policies to modify a key's access.

<>

linode-cli object-storage keys-create \
  --label "my-object-storage-key" \
  --bucket_access '[{"region": "ap-south", "bucket_name": "bucket-example-1", "permissions": "read_write" }]'

<https://www.linode.com/docs/products/tools/cli/get-started/>
object_storage:read_write

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: POST /{apiVersion}/object-storage/keys

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.object_storage.keys.create(
    api_version="v4",
    data={
        "bucket_access": [
            {
                "bucket_name": "example-bucket",
                "permissions": "read_write",
                "region": "us-iad",
            }
        ],
        "label": "my-key",
        "regions": ["us-iad"],
    },
)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.object_storage.keys.create(
    api_version="v4",
    data={
        "bucket_access": [
            {
                "bucket_name": "example-bucket",
                "permissions": "read_write",
                "region": "us-iad",
            }
        ],
        "label": "my-key",
        "regions": ["us-iad"],
    },
)

Update an Object Storage key

Updates an Object Storage key on your account. A successful request triggers an obj_access_key_update event.

<>

linode-cli object-storage keys-update \
  --keyId 12345
  --label "my-object-storage-key"

<https://www.linode.com/docs/products/tools/cli/get-started/>
object_storage:read_write

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: PUT /{apiVersion}/object-storage/keys/{keyId}

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.object_storage.keys.update(
    api_version="v4",
    key_id=123,
    data={"label": "my-key", "regions": ["us-iad", "fr-par"]},
)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.object_storage.keys.update(
    api_version="v4",
    key_id=123,
    data={"label": "my-key", "regions": ["us-iad", "fr-par"]},
)

Module vpc

Delete a VPC

Delete a single VPC and all of its Subnets.

  • The User accessing this operation must have read_write grants to the VPC.
  • A successful request triggers a vpc_delete event and subnet_delete events for each deleted VPC Subnet.
  • All of the VPC's Subnets must be eligible for deletion. Accordingly, all Configuration Profile Interfaces that each Subnet is assigned to must first be deleted. If those Interfaces are active, the associated Linodes must first be shut down before they can be removed. If any Subnet cannot be deleted, then neither the VPC nor any of its Subnets are deleted.

<>

linode-cli vpcs delete $vpcId

<https://www.linode.com/docs/products/tools/cli/get-started/>
vpc:read_write

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: DELETE /{apiVersion}/vpcs/{vpcId}

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.vpc.delete(api_version="v4", vpc_id=123)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.vpc.delete(api_version="v4", vpc_id=123)

List VPCs

Display all VPCs on your account.

<>


CLI

linode-cli vpcs list

Learn more...

API Endpoint: GET /{apiVersion}/vpcs

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.vpc.list(api_version="v4", page=123, page_size=123)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.vpc.list(api_version="v4", page=123, page_size=123)

Get a VPC

Get information about a single VPC.

<>


CLI

linode-cli vpcs view $vpcId

Learn more...

API Endpoint: GET /{apiVersion}/vpcs/{vpcId}

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.vpc.get(api_version="v4", vpc_id=123)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.vpc.get(api_version="v4", vpc_id=123)

Create a VPC

Create a new VPC and optionally associated VPC Subnets.

  • Users must have the add_vpc grant to access this operation.
  • A successful request triggers a vpc_create event and subnet_create events for any created VPC Subnets.

Once a VPC is created, it can be attached to a Linode by assigning a VPC Subnet to one of the Linode's Configuration Profile Interfaces. This step can be accomplished with the following operations:

  • Create a Linode
  • Create a config profile
  • Update a config profile
  • Add a configuration profile interface

<>

linode-cli vpcs create \
  --description "A description of my VPC." \
  --label cool-vpc \
  --region us-east \
  --subnets.label cool-vpc-subnet \
  --subnets.ipv4 10.0.1.0/24

<https://www.linode.com/docs/products/tools/cli/get-started/>
vpc:read_write

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: POST /{apiVersion}/vpcs

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.vpc.create(api_version="v4", data="could be anything")

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.vpc.create(api_version="v4", data="could be anything")

Update a VPC

Update an existing VPC.

  • The User accessing this operation must have read_write grants to the VPC.
  • A successful request triggers a vpc_update event.

To update a VPC's Subnet, run the Update a VPC subnet operation.

<>

linode-cli vpcs update $vpcId \
  --description "A description of my VPC."
  --label cool-vpc

<https://www.linode.com/docs/products/tools/cli/get-started/>
vpc:read_write

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: PUT /{apiVersion}/vpcs/{vpcId}

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.vpc.update(
    api_version="v4",
    vpc_id=123,
    data={"description": "A description of my VPC.", "label": "cool-vpc"},
)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.vpc.update(
    api_version="v4",
    vpc_id=123,
    data={"description": "A description of my VPC.", "label": "cool-vpc"},
)

Module vpc.subnets

Delete a VPC subnet

Delete a single VPC Subnet.

The user accessing this operation must have read_write grants to the VPC. A successful request triggers a subnet_delete event.

Note. You need to delete all the Configuration Profile Interfaces that this Subnet is assigned to before you can delete it. If those Interfaces are active, the associated Linode needs to be shut down before they can be removed.

<>

linode-cli vpcs subnet-delete $vpcId $vpcSubnetId

<https://www.linode.com/docs/products/tools/cli/get-started/>
vpc:read_write

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: DELETE /{apiVersion}/vpcs/{vpcId}/subnets/{vpcSubnetId}

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.vpc.subnets.delete(api_version="v4", vpc_id=123, vpc_subnet_id=123)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.vpc.subnets.delete(api_version="v4", vpc_id=123, vpc_subnet_id=123)

List VPC subnets

Get information about all VPC Subnets associated with a VPC.

<>


CLI

linode-cli vpcs subnets-list $vpcId

Learn more...

API Endpoint: GET /{apiVersion}/vpcs/{vpcId}/subnets

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.vpc.subnets.list(api_version="v4", vpc_id=123, page=123, page_size=123)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.vpc.subnets.list(
    api_version="v4", vpc_id=123, page=123, page_size=123
)

Get a VPC subnet

Get information about a single VPC Subnet.

<>


CLI

linode-cli vpcs subnet-view $vpcId $vpcSubnetId

Learn more...

API Endpoint: GET /{apiVersion}/vpcs/{vpcId}/subnets/{vpcSubnetId}

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.vpc.subnets.get(api_version="v4", vpc_id=123, vpc_subnet_id=123)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.vpc.subnets.get(api_version="v4", vpc_id=123, vpc_subnet_id=123)

Create a VPC subnet

Create a VPC Subnet.

  • The User accessing this operation must have read_write grants to the VPC.
  • A successful request triggers a subnet_create event.

Once a VPC Subnet is created, it can be attached to a Linode by assigning the Subnet to one of the Linode's Configuration Profile Interfaces. This step can be accomplished with the following operations:

  • Create a Linode
  • Create a config profile
  • Update a config profile
  • Add a configuration profile interface

<>

linode-cli vpcs subnet-create $vpcId \
  --label cool-vpc-subnet \
  --ipv4 10.0.1.0/24

<https://www.linode.com/docs/products/tools/cli/get-started/>
vpc:read_write

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: POST /{apiVersion}/vpcs/{vpcId}/subnets

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.vpc.subnets.create(
    api_version="v4",
    vpc_id=123,
    data={"ipv4": "10.0.1.0/24", "label": "cool-vpc-subnet"},
)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.vpc.subnets.create(
    api_version="v4",
    vpc_id=123,
    data={"ipv4": "10.0.1.0/24", "label": "cool-vpc-subnet"},
)

Update a VPC subnet

Update a VPC Subnet.

  • The User accessing this operation must have read_write grants to the VPC.
  • A successful request triggers a subnet_update event.

<>

linode-cli vpcs subnet-update $vpcId \
  --label cool-vpc-subnet

<https://www.linode.com/docs/products/tools/cli/get-started/>
vpc:read_write

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: PUT /{apiVersion}/vpcs/{vpcId}/subnets/{vpcSubnetId}

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.vpc.subnets.update(
    api_version="v4", vpc_id=123, vpc_subnet_id=123, data={"label": "cool-vpc-subnet"}
)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.vpc.subnets.update(
    api_version="v4", vpc_id=123, vpc_subnet_id=123, data={"label": "cool-vpc-subnet"}
)

Module account.agreements

List agreements

Returns all agreements and their acceptance status for your account.

<>


OAuth scopes

account:read_only

Learn more...

API Endpoint: GET /{apiVersion}/account/agreements

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.agreements.list(api_version="v4")

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.agreements.list(api_version="v4")

Acknowledge agreements

Accept required agreements by setting them to true. This remains until the content of the agreement changes. If it does, you need to run this operation again to accept it. If you set this to false, the API rejects the request and you need to open a support ticket to reset the agreement. Omitted agreements are left unchanged.

<>


OAuth scopes

account:read_write

Learn more...

API Endpoint: POST /{apiVersion}/account/agreements

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.agreements.create(
    api_version="v4",
    data={"eu_model": True, "master_service_agreement": True, "privacy_policy": True},
)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.agreements.create(
    api_version="v4",
    data={"eu_model": True, "master_service_agreement": True, "privacy_policy": True},
)

Module account.availability

List available services

Returns a paginated list of the services available to you, for all Linode regions.

Note. Only authorized Users can run this operation.

<>

linode-cli account get-availability

<https://www.linode.com/docs/products/tools/cli/get-started/>
account:read_only

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: GET /{apiVersion}/account/availability

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.availability.list(api_version="v4", page=123, page_size=123)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.availability.list(api_version="v4", page=123, page_size=123)

Get a region's service availability

View the available services for your account in a specific region.

Note. Only authorized users can access this.

<>

linode-cli account get-account-availability us-east

<https://www.linode.com/docs/products/tools/cli/get-started/>
account:read_only

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: GET /{apiVersion}/account/availability/{id}

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.availability.get(api_version="v4", id="string")

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.availability.get(api_version="v4", id="string")

Module account.betas

List enrolled Beta programs

Display all enrolled Beta Programs for your Account. Includes inactive as well as active Beta Programs.

Only unrestricted Users can access this operation.

<>

linode-cli betas enrolled

<https://www.linode.com/docs/products/tools/cli/get-started/>
account:read_only

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: GET /{apiVersion}/account/betas

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.betas.list(api_version="v4", page=123, page_size=123)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.betas.list(api_version="v4", page=123, page_size=123)

Get an enrolled Beta program

Display an enrolled Beta Program for your Account. The Beta Program may be inactive.

Only unrestricted Users can access this operation.

<>

linode-cli betas enrolled-view $betaId

<https://www.linode.com/docs/products/tools/cli/get-started/>
account:read_only

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: GET /{apiVersion}/account/betas/{betaId}

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.betas.get(api_version="v4", beta_id="string")

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.betas.get(api_version="v4", beta_id="string")

Enroll in a Beta program

Enroll your Account in an active Beta Program.

Only unrestricted Users can access this operation.

To view active Beta Programs, run the List beta programs operation.

Active Beta Programs may have a limited number of enrollments. If a Beta Program has reached is maximum number of enrollments, an error is returned even though the request is successful.

Beta Programs with "greenlight_only": true can only be enrolled by Accounts that participate in the Greenlight program.

<>

linode-cli betas enroll --id example_open

<https://www.linode.com/docs/products/tools/cli/get-started/>
account:read_write

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: POST /{apiVersion}/account/betas

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.betas.create(api_version="v4", data={"id": "example_open"})

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.betas.create(api_version="v4", data={"id": "example_open"})

Module account.child_accounts

List child accounts

Returns a paginated list of basic information for the child accounts that exist for your parent account. See Parent and Child Accounts for Akamai Partners for details on these accounts.

Note. This operation can only be accessed by an unrestricted parent user, or restricted parent user with the child_account_access grant.

<>

linode-cli child-account list

<https://www.linode.com/docs/products/tools/cli/get-started/>
child_account:read_only

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: GET /{apiVersion}/account/child-accounts

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.child_accounts.list(api_version="v4", page=123, page_size=123)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.child_accounts.list(
    api_version="v4", page=123, page_size=123
)

Get a child account

View a specific child account based on its euuid. See Parent and Child Accounts for Akamai Partners for details on these accounts.

Note. This operation can only be accessed by an unrestricted user, or restricted user with the child_account_access grant.

<>

linode-cli child-account view A1BC2DEF-34GH-567I-J890KLMN12O34P56

<https://www.linode.com/docs/products/tools/cli/get-started/>
child_account:read_only

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: GET /{apiVersion}/account/child-accounts/{euuid}

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.child_accounts.get(api_version="v4", euuid="string")

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.child_accounts.get(api_version="v4", euuid="string")

Module account.events

List events

Returns a collection of Event objects representing actions taken on your Account from the last 90 days. The Events returned depend on your grants.

<>

linode-cli events list

<https://www.linode.com/docs/products/tools/cli/get-started/>
events:read_only

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: GET /{apiVersion}/account/events

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.events.list(api_version="v4", page=123, page_size=123)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.events.list(api_version="v4", page=123, page_size=123)

Get an event

Returns a single Event object.

<>

linode-cli events view 123

<https://www.linode.com/docs/products/tools/cli/get-started/>
events:read_only

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: GET /{apiVersion}/account/events/{eventId}

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.events.get(api_version="v4", event_id=123)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.events.get(api_version="v4", event_id=123)

Module account.invoices

List invoices

Returns a paginated list of Invoices against your Account.

<>

linode-cli account invoices-list

<https://www.linode.com/docs/products/tools/cli/get-started/>
account:read_only

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: GET /{apiVersion}/account/invoices

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.invoices.list(api_version="v4", page=123, page_size=123)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.invoices.list(api_version="v4", page=123, page_size=123)

Get an invoice

Returns a single Invoice object.

<>

linode-cli account invoice-view 123

<https://www.linode.com/docs/products/tools/cli/get-started/>
account:read_only

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: GET /{apiVersion}/account/invoices/{invoiceId}

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.invoices.get(api_version="v4", invoice_id=123)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.invoices.get(api_version="v4", invoice_id=123)

Module account.invoices.items

List invoice items

Returns a paginated list of Invoice items.

<>

linode-cli account invoice-items 123

<https://www.linode.com/docs/products/tools/cli/get-started/>
account:read_only

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: GET /{apiVersion}/account/invoices/{invoiceId}/items

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.invoices.items.list(
    api_version="v4", invoice_id=123, page=123, page_size=123
)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.invoices.items.list(
    api_version="v4", invoice_id=123, page=123, page_size=123
)

Module account.logins

List user logins

Returns a collection of successful logins for all users on the account during the last 90 days. This operation can only be accessed by the unrestricted users of an account.

<>

linode-cli account logins-list

<https://www.linode.com/docs/products/tools/cli/get-started/>
account:read_only

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: GET /{apiVersion}/account/logins

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.logins.list(api_version="v4")

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.logins.list(api_version="v4")

Get an account login

Returns a Login object that displays information about a successful login. The logins that can be viewed can be for any user on the account, and are not limited to only the logins of the user that is accessing this API endpoint. This operation can only be accessed by the unrestricted users of the account.

<>

linode-cli account login-view 1234

<https://www.linode.com/docs/products/tools/cli/get-started/>
account:read_only

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: GET /{apiVersion}/account/logins/{loginId}

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.logins.get(api_version="v4", login_id=123)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.logins.get(api_version="v4", login_id=123)

Module account.maintenance

List maintenances

Returns a collection of Maintenance objects for any entity a user has permissions to view. Canceled Maintenance objects are not returned.

Currently, Linodes are the only entities available for viewing.

<>


CLI

linode-cli account maintenance-list

Learn more...

API Endpoint: GET /{apiVersion}/account/maintenance

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.maintenance.list(api_version="v4")

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.maintenance.list(api_version="v4")

Module account.notifications

List notifications

Returns a collection of notification objects that represent important, often time-sensitive details about your account. You can't interact directly with notifications, and a notification disappears when the circumstances that caused it have been resolved. For example, if you have an important ticket open, you can respond to that ticket to dismiss its notification.

<>

linode-cli account notifications-list

<https://www.linode.com/docs/products/tools/cli/get-started/>
account:read_only

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: GET /{apiVersion}/account/notifications

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.notifications.list(api_version="v4")

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.notifications.list(api_version="v4")

Module account.oauth_clients.thumbnail

Get the OAuth client's thumbnail

Returns the PNG thumbnail for this OAuth Client. This is a publicly viewable endpoint, and can be accessed without authentication.

API Endpoint: GET /{apiVersion}/account/oauth-clients/{clientId}/thumbnail

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.oauth_clients.thumbnail.list(api_version="v4", client_id="string")

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.oauth_clients.thumbnail.list(
    api_version="v4", client_id="string"
)

Update the OAuth client's thumbnail

Upload a thumbnail for a client you own. You must upload a PNG image file that will be returned when the thumbnail is retrieved. This image will be publicly viewable.

<>


OAuth scopes

account:read_write

Learn more...

API Endpoint: PUT /{apiVersion}/account/oauth-clients/{clientId}/thumbnail

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.oauth_clients.thumbnail.update(
    api_version="v4", client_id="string", data=open("uploads/file.pdf", "rb")
)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.oauth_clients.thumbnail.update(
    api_version="v4", client_id="string", data=open("uploads/file.pdf", "rb")
)

Module account.payments

List payments

Returns a paginated list of Payments made on this Account.

<>

linode-cli account payments-list

<https://www.linode.com/docs/products/tools/cli/get-started/>
account:read_only

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: GET /{apiVersion}/account/payments

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.payments.list(api_version="v4", page=123, page_size=123)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.payments.list(api_version="v4", page=123, page_size=123)

Get a payment

Returns information about a specific Payment.

<>

linode-cli account payment-view 123

<https://www.linode.com/docs/products/tools/cli/get-started/>
account:read_only

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: GET /{apiVersion}/account/payments/{paymentId}

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.payments.get(api_version="v4", payment_id=123)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.payments.get(api_version="v4", payment_id=123)

Make a payment

Makes a Payment to your Account.

  • The requested amount is charged to the default Payment Method if no payment_method_id is specified.

  • A payment_submitted event is generated when a payment is successfully submitted.

Parent and child accounts

In a parent and child account environment, the following apply:

  • Child account users can't run this operation. These users don't have access to billing-related operations.

<>

linode-cli account payment-create \
  --usd 120.50 \
  --payment_method_id 123

<https://www.linode.com/docs/products/tools/cli/get-started/>
account:read_write

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: POST /{apiVersion}/account/payments

Module account.settings

Get account settings

Returns information related to your Account settings: Managed service subscription, Longview subscription, and network helper.

<>

linode-cli account settings

<https://www.linode.com/docs/products/tools/cli/get-started/>
account:read_only

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: GET /{apiVersion}/account/settings

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.settings.list(api_version="v4")

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.settings.list(api_version="v4")

Update account settings

Updates your account settings. For a Longview subscription plan, see Update a Longview plan.

<>

linode-cli account settings-update \
  --network_helper false

<https://www.linode.com/docs/products/tools/cli/get-started/>
account:read_write

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: PUT /{apiVersion}/account/settings

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.settings.update(
    api_version="v4",
    data={
        "backups_enabled": True,
        "longview_subscription": "longview-3",
        "managed": True,
        "network_helper": False,
        "object_storage": "active",
    },
)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.settings.update(
    api_version="v4",
    data={
        "backups_enabled": True,
        "longview_subscription": "longview-3",
        "managed": True,
        "network_helper": False,
        "object_storage": "active",
    },
)

Module account.transfer

Get network usage

Returns a Transfer object showing your network utilization, in GB, for the current month.

<>

linode-cli account transfer

<https://www.linode.com/docs/products/tools/cli/get-started/>
account:read_only

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: GET /{apiVersion}/account/transfer

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.transfer.list(api_version="v4")

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.transfer.list(api_version="v4")

Module account.users.grants

List a user's grants

Returns the full grants structure for an account username you specify. This includes all entities on the account, and the level of access this user has to each of them.

This doesn't apply to the account owner or the current authenticated user. You can run the List grants operation to view those grants. However, this doesn't show the entities that they don't have access to.

Note. This operation can only be accessed by account users with unrestricted access.

<>


OAuth scopes

account:read_only

Learn more...

API Endpoint: GET /{apiVersion}/account/users/{username}/grants

Update a user's grants

Update the grants a user has. This can be used to give a user access to new entities or actions, or take access away. You don't need to include the grant for every entity on the account in this request. Any that are not included remain unchanged.

Note. This operation can only be accessed by account users with unrestricted access.

Parent and child accounts

In a parent and child account environment, the following apply:

  • No child account user can modify the account_access grant for the child account parent user (proxy user).

  • An unrestricted child account user can configure all other grants for the proxy user, via global object.

  • An unrestricted child account user can enable the account_access grant for other child account users. However, enabled child users are still subject to child user restrictions--they can't perform write operations for any billing or account information.

<>


OAuth scopes

account:read_write

Learn more...

API Endpoint: PUT /{apiVersion}/account/users/{username}/grants

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.users.grants.update(
    api_version="v4",
    username="string",
    data={
        "database": [
            {"id": 123, "label": "example-entity", "permissions": "read_only"}
        ],
        "domain": [{"id": 123, "label": "example-entity", "permissions": "read_only"}],
        "firewall": [
            {"id": 123, "label": "example-entity", "permissions": "read_only"}
        ],
        "global_field": {
            "account_access": "read_only",
            "add_databases": True,
            "add_domains": True,
            "add_firewalls": True,
            "add_images": True,
            "add_linodes": True,
            "add_longview": True,
            "add_nodebalancers": True,
            "add_placement_groups": True,
            "add_stackscripts": True,
            "add_volumes": True,
            "add_vpcs": True,
            "cancel_account": False,
            "child_account_access": True,
            "longview_subscription": True,
        },
        "image": [{"id": 123, "label": "example-entity", "permissions": "read_only"}],
        "linode": [{"id": 123, "label": "example-entity", "permissions": "read_only"}],
        "longview": [
            {"id": 123, "label": "example-entity", "permissions": "read_only"}
        ],
        "nodebalancer": [
            {"id": 123, "label": "example-entity", "permissions": "read_only"}
        ],
        "placement_group": [
            {"id": 123, "label": "example-entity", "permissions": "read_only"}
        ],
        "stackscript": [
            {"id": 123, "label": "example-entity", "permissions": "read_only"}
        ],
        "volume": [{"id": 123, "label": "example-entity", "permissions": "read_only"}],
        "vpc": [{"id": 123, "label": "example-entity", "permissions": "read_only"}],
    },
)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.users.grants.update(
    api_version="v4",
    username="string",
    data={
        "database": [
            {"id": 123, "label": "example-entity", "permissions": "read_only"}
        ],
        "domain": [{"id": 123, "label": "example-entity", "permissions": "read_only"}],
        "firewall": [
            {"id": 123, "label": "example-entity", "permissions": "read_only"}
        ],
        "global_field": {
            "account_access": "read_only",
            "add_databases": True,
            "add_domains": True,
            "add_firewalls": True,
            "add_images": True,
            "add_linodes": True,
            "add_longview": True,
            "add_nodebalancers": True,
            "add_placement_groups": True,
            "add_stackscripts": True,
            "add_volumes": True,
            "add_vpcs": True,
            "cancel_account": False,
            "child_account_access": True,
            "longview_subscription": True,
        },
        "image": [{"id": 123, "label": "example-entity", "permissions": "read_only"}],
        "linode": [{"id": 123, "label": "example-entity", "permissions": "read_only"}],
        "longview": [
            {"id": 123, "label": "example-entity", "permissions": "read_only"}
        ],
        "nodebalancer": [
            {"id": 123, "label": "example-entity", "permissions": "read_only"}
        ],
        "placement_group": [
            {"id": 123, "label": "example-entity", "permissions": "read_only"}
        ],
        "stackscript": [
            {"id": 123, "label": "example-entity", "permissions": "read_only"}
        ],
        "volume": [{"id": 123, "label": "example-entity", "permissions": "read_only"}],
        "vpc": [{"id": 123, "label": "example-entity", "permissions": "read_only"}],
    },
)

Module object-storage.buckets.object_acl

Get an Object Storage object ACL config

View an Object's configured Access Control List (ACL) in this Object Storage bucket. ACLs define who can access your buckets and objects and specify the level of access granted to those users.

📘

The S3 API equivalent operation offers more detail.

<>


OAuth scopes

object_storage:read_only

Learn more...

API Endpoint: GET /{apiVersion}/object-storage/buckets/{regionId}/{bucket}/object-acl

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.object_storage.buckets.object_acl.list(
    api_version="v4", region_id="string", bucket="string", name="string"
)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.object_storage.buckets.object_acl.list(
    api_version="v4", region_id="string", bucket="string", name="string"
)

Update an object's ACL config

Update an object's configured access control level (ACL) in this Object Storage bucket. ACLs define who can access your buckets and objects and specify the level of access granted to those users.

📘

The S3 API equivalent operation offers more detail.

<>


OAuth scopes

object_storage:read_write

Learn more...

API Endpoint: PUT /{apiVersion}/object-storage/buckets/{regionId}/{bucket}/object-acl

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.object_storage.buckets.object_acl.update(
    api_version="v4",
    region_id="string",
    bucket="string",
    data={"acl": "public-read", "name": "string"},
)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.object_storage.buckets.object_acl.update(
    api_version="v4",
    region_id="string",
    bucket="string",
    data={"acl": "public-read", "name": "string"},
)

Module object-storage.buckets.object_list

List Object Storage bucket contents

Returns the contents of a bucket. The contents are paginated using a marker, that's the name of the last object on the previous page. Objects can also be filtered by prefix and delimiter. See Filtering and sorting for more information.

📘

The S3 API equivalent operation offers more detail.

<>


OAuth scopes

object_storage:read_only

Learn more...

API Endpoint: GET /{apiVersion}/object-storage/buckets/{regionId}/{bucket}/object-list

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.object_storage.buckets.object_list.list(
    api_version="v4",
    region_id="string",
    bucket="string",
    delimiter="string",
    marker="string",
    page_size=123,
    prefix="string",
)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.object_storage.buckets.object_list.list(
    api_version="v4",
    region_id="string",
    bucket="string",
    delimiter="string",
    marker="string",
    page_size=123,
    prefix="string",
)

Module object-storage.clusters

List clusters

Returns a paginated list of available Object Storage legacy clusters.

📘

This displays deprecated clusterId values that represent regions used with older versions of the API. It's maintained for backward compatibility. Run Get a region, instead.

<>


CLI

linode-cli object-storage clusters-list

Learn more...

API Endpoint: GET /{apiVersion}/object-storage/clusters

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.object_storage.clusters.list(api_version="v4")

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.object_storage.clusters.list(api_version="v4")

Get a cluster

Deprecated Returns a single Object Storage cluster.

📘

This displays deprecated clusterId values that represent regions used with older versions of the API. It's maintained for backward compatibility. Run Get a region, instead.

<>


CLI

linode-cli object-storage clusters-view us-east-1

Learn more...

API Endpoint: GET /{apiVersion}/object-storage/clusters/{clusterId}

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.object_storage.clusters.get(api_version="v4", cluster_id="us-east-1")

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.object_storage.clusters.get(api_version="v4", cluster_id="us-east-1")

Module object-storage.transfer

Get Object Storage transfer data

The amount of outbound data transfer used by your account's Object Storage buckets. Object Storage adds 1 terabyte of outbound data transfer to your data transfer pool. See the Object Storage Overview guide for details on Object Storage transfer quotas.

<>


OAuth scopes

object_storage:read_only

Learn more...

API Endpoint: GET /{apiVersion}/object-storage/transfer

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.object_storage.transfer.list(api_version="v4")

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.object_storage.transfer.list(api_version="v4")

Module object-storage.types

List Object Storage types

Returns Object Storage types and prices, including any region-specific rates.

<>


CLI

linode-cli object-storage types

Learn more...

API Endpoint: GET /{apiVersion}/object-storage/types

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.object_storage.types_resource.list(api_version="v4")

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.object_storage.types_resource.list(api_version="v4")

Module vpc.ips

List VPC IP addresses

Returns a paginated list of all VPC IP addresses and address ranges on your account.

Note. If a Linode has several configuration profiles that include a VPC interface, address information for all of them is listed in the response. Since VPCs can use the same address space, you may see duplicate IP addresses.

<>

linode-cli vpcs ips-all-list

<https://www.linode.com/docs/products/tools/cli/get-started/>
ips:read_only

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: GET /{apiVersion}/vpcs/ips

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.vpc.ips.list(api_version="v4", page=123, page_size=123)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.vpc.ips.list(api_version="v4", page=123, page_size=123)

List a VPC's IP addresses

Returns a paginated list of IP addresses for a single VPC.

<>

linode-cli vpcs ip-list 123

<https://www.linode.com/docs/products/tools/cli/get-started/>
ips:read_only

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: GET /{apiVersion}/vpcs/{vpcId}/ips

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.vpc.ips.list_ips(api_version="v4", vpc_id=123, page=123, page_size=123)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.vpc.ips.list_ips(
    api_version="v4", vpc_id=123, page=123, page_size=123
)

Module account.cancel

Cancel your account

Cancels an active Linode account. Akamai attempts to charge the credit card on file for any remaining balance. An error occurs if this charge fails.

Note. This operation can only be accessed by account users with unrestricted access.

Parent and child accounts In a parent and child account environment, the following apply:

  • A child account user can't cancel a child account.
  • You can't cancel a parent account if it has an active child account.
  • You need to work with your Akamai account team to dissolve any parent-child account relationships before you can fully cancel a child or parent account.

<>

linode-cli account cancel \
  --comments "I'm consolidating my accounts"

<https://www.linode.com/docs/products/tools/cli/get-started/>
account:read_write

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: POST /{apiVersion}/account/cancel

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.cancel.create(
    api_version="v4", data={"comments": "I'm consolidating multiple accounts into one."}
)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.cancel.create(
    api_version="v4", data={"comments": "I'm consolidating multiple accounts into one."}
)

Module account.child_accounts.token

Create a proxy user token

Create a short-lived bearer token for a parent user on a child account, using the euuid of that child account. In the context of the API, a parent user on a child account is referred to as a "proxy user." When Akamai provisions your parent-child account environment, a proxy user is automatically set in the child account. It follows a specific naming convention:

<Parent account `company` name>_<SHA256 hash of parent `company` name and child account `euuid`>

Note. The variables above use only the first 15 and 16 characters of these values, respectively.

The token lets a parent account run API operations through the proxy user, as if they are a child user in the child account.

These points apply to the use of this operation:

  • To create a token, a parent account user needs the child_account_access grant. This lets them use the proxy user on the child account. You can run List a user's grants on a parent account user to check its child_account_access setting. To add this access, you can update the parent account user.

  • The created token inherits the permissions of the proxy user. It will never have less.

  • The API returns the raw token in the response. You can't get it again, so be sure to store it.

Example workflow:

  1. List child accounts and store the euuid for the applicable one.
  2. Run this operation and store the token that's created for the proxy user.
  3. As a parent account user with access to the proxy user in the child account, use this token to authenticate API operations, as if you were a child user.

<>

linode-cli child-account create A1BC2DEF-34GH-567I-J890KLMN12O34P56

<https://www.linode.com/docs/products/tools/cli/get-started/>
child_account:read_write

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: POST /{apiVersion}/account/child-accounts/{euuid}/token

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.child_accounts.token_resource.create(
    api_version="v4", euuid="string"
)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.child_accounts.token_resource.create(
    api_version="v4", euuid="string"
)

Module account.credit_card

Add or edit a credit card

Deprecated Please run Add a payment method.

Adds a credit card Payment Method to your account and sets it as the default method.

<>


OAuth scopes

account:read_write

Learn more...

API Endpoint: POST /{apiVersion}/account/credit-card

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.credit_card.create(
    api_version="v4",
    data={
        "card_number": "string",
        "cvv": "123",
        "expiry_month": 12,
        "expiry_year": 2020,
    },
)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.credit_card.create(
    api_version="v4",
    data={
        "card_number": "string",
        "cvv": "123",
        "expiry_month": 12,
        "expiry_year": 2020,
    },
)

Module account.entity_transfers.accept

Accept an entity transfer

Deprecated Please run Accept a service transfer.

<>


OAuth scopes

account:read_write

Learn more...

API Endpoint: POST /{apiVersion}/account/entity-transfers/{token}/accept

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.entity_transfers.accept.create(
    api_version="v4", token_path="3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a"
)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.entity_transfers.accept.create(
    api_version="v4", token_path="3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a"
)

Module account.events.read

Mark an event as read

Marks a single Event as read.

<>

linode-cli events mark-read 123

<https://www.linode.com/docs/products/tools/cli/get-started/>
events:read_only

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: POST /{apiVersion}/account/events/{eventId}/read

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.events.read.create(api_version="v4", event_id=123)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.events.read.create(api_version="v4", event_id=123)

Module account.events.seen

Mark an event as seen

Marks all Events up to and including this Event by ID as seen.

<>

linode-cli events mark-seen 123

<https://www.linode.com/docs/products/tools/cli/get-started/>
events:read_only

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: POST /{apiVersion}/account/events/{eventId}/seen

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.events.seen.create(api_version="v4", event_id=123)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.events.seen.create(api_version="v4", event_id=123)

Module account.oauth_clients.reset_secret

Reset an OAuth client secret

Resets the OAuth Client secret for a client you own, and returns the OAuth Client with the plaintext secret. This secret is not supposed to be publicly known or disclosed anywhere. This can be used to generate a new secret in case the one you have has been leaked, or to get a new secret if you lost the original. The old secret is expired immediately, and logins to your client with the old secret will fail.

<>

linode-cli account client-reset-secret \
  edc6790ea9db4d224c5c

<https://www.linode.com/docs/products/tools/cli/get-started/>
account:read_write

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: POST /{apiVersion}/account/oauth-clients/{clientId}/reset-secret

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.oauth_clients.reset_secret.create(
    api_version="v4", client_id="string"
)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.oauth_clients.reset_secret.create(
    api_version="v4", client_id="string"
)

Module account.payment_methods.make_default

Set a default payment method

Make the specified Payment Method the default method for automatically processing payments. Removes the default status from any other Payment Method.

Parent and child accounts

In a parent and child account environment, the following apply:

  • Child account users can't run this operation. These users don't have access to billing-related operations.

<>

linode-cli payment-methods default 123

<https://www.linode.com/docs/products/tools/cli/get-started/>
account:read_write

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: POST /{apiVersion}/account/payment-methods/{paymentMethodId}/make-default

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.payment_methods.make_default.create(
    api_version="v4", payment_method_id=123
)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.payment_methods.make_default.create(
    api_version="v4", payment_method_id=123
)

Module account.payments.paypal

Stage a PayPal payment

Deprecated This operation is disabled and no longer accessible. PayPal can be designated as a Payment Method for automated payments using the Cloud Manager. See Manage Payment Methods.

<>


OAuth scopes

account:read_write

Learn more...

API Endpoint: POST /{apiVersion}/account/payments/paypal

Module account.payments.paypal.execute

Execute a PayPal payment

Deprecated This operation is disabled and no longer accessible. PayPal can be designated as a Payment Method for automated payments using the Cloud Manager. See Manage Payment Methods.

<>


OAuth scopes

account:read_write

Learn more...

API Endpoint: POST /{apiVersion}/account/payments/paypal/execute

Module account.promo_codes

Add a promo credit

Adds an expiring Promo Credit to your account. The following restrictions apply:

  • Your account needs to be less than 90 days old.

  • You can't already have a Promo Credit on your account.

  • The user making the request needs to be unrestricted. You can run the Update a user operation to change a user's restricted status.

  • The promo_code needs to be valid and unexpired.

Parent and child accounts

In a parent and child account environment, the following apply:

  • Child account users can't run this operation. These users don't have access to billing-related operations.

<>

linode-cli account \
  promo-add \
  --promo-code abcdefABCDEF1234567890

<https://www.linode.com/docs/products/tools/cli/get-started/>
account:read_only

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: POST /{apiVersion}/account/promo-codes

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.promo_codes.create(api_version="v4", data={"promo_code": "string"})

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.promo_codes.create(
    api_version="v4", data={"promo_code": "string"}
)

Module account.service_transfers.accept

Accept a service transfer

Accept a Service Transfer for the provided token to receive the services included in the transfer to your account. At this time, only Linodes can be transferred.

When accepted, email confirmations are sent to the accounts that created and accepted the transfer. A transfer can take up to three hours to complete once accepted. Once a transfer is completed, billing for transferred services ends for the sending account and begins for the receiving account.

This operation can only be accessed by the unrestricted users of the account that receives the transfer. Users of the same account that created a transfer cannot accept the transfer.

There are several conditions that must be met in order to accept a transfer request:

  1. Only transfers with a pending status can be accepted.

  2. The account accepting the transfer must have a registered payment method and must not have a past due balance or other account limitations for the services to be transferred.

  3. Both the account that created the transfer and the account that is accepting the transfer must not have any active Terms of Service violations.

  4. The service must still be owned by the account that created the transfer.

  5. Linodes must not:

    • be assigned to a NodeBalancer, Firewall, VLAN, or Managed Service.

    • have any attached Block Storage Volumes.

    • have any shared IP addresses.

    • have any assigned /56, /64, or /116 IPv6 ranges.

Any and all of the above conditions must be cured and maintained by the relevant account prior to the transfer's expiration to allow the transfer to be accepted by the receiving account.

<>

linode-cli service-transfers \
  accept 123E4567-E89B-12D3-A456-426614174000

<https://www.linode.com/docs/products/tools/cli/get-started/>
account:read_write

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: POST /{apiVersion}/account/service-transfers/{token}/accept

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.service_transfers.accept.create(
    api_version="v4", token_path="3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a"
)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.service_transfers.accept.create(
    api_version="v4", token_path="3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a"
)

Module account.settings.managed_enable

Enable Linode Managed

Enables Linode Managed for the entire account and sends a welcome email to the account's associated email address. Linode Managed can monitor any service or software stack reachable over TCP or HTTP. See our Linode Managed guide to learn more.

<>

linode-cli account enable-managed

<https://www.linode.com/docs/products/tools/cli/get-started/>
account:read_write

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: POST /{apiVersion}/account/settings/managed-enable

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.account.settings.managed_enable.create(api_version="v4")

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.account.settings.managed_enable.create(api_version="v4")

Module object-storage.buckets.access

Modify access to an Object Storage bucket

Apply basic Cross-origin Resource Sharing (CORS) and Access Control Level (ACL) settings. You can configure CORS for all origins and set canned ACL settings.

📘

For more fine-grained control of both systems, use the S3 API.

<>


OAuth scopes

object_storage:read_write

Learn more...

API Endpoint: POST /{apiVersion}/object-storage/buckets/{regionId}/{bucket}/access

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.object_storage.buckets.access.create(
    api_version="v4",
    region_id="string",
    bucket="string",
    data={"acl": "private", "cors_enabled": True},
)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.object_storage.buckets.access.create(
    api_version="v4",
    region_id="string",
    bucket="string",
    data={"acl": "private", "cors_enabled": True},
)

Update access to an Object Storage bucket

Update basic Cross-origin Resource Sharing (CORS) and Access Control Level (ACL) settings. You can configure CORS for all origins and set canned ACL settings.

📘

For more fine-grained control of both systems, use the S3 API.

<>


OAuth scopes

object_storage:read_write

Learn more...

API Endpoint: PUT /{apiVersion}/object-storage/buckets/{regionId}/{bucket}/access

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.object_storage.buckets.access.update(
    api_version="v4",
    region_id="string",
    bucket="string",
    data={"acl": "private", "cors_enabled": True},
)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.object_storage.buckets.access.update(
    api_version="v4",
    region_id="string",
    bucket="string",
    data={"acl": "private", "cors_enabled": True},
)

Module object-storage.buckets.object_url

Create a URL for an object

Creates a pre-signed URL to access a single object in a bucket. Use it to share, create, or delete objects by using the appropriate HTTP method in your request body's method parameter.

📘

The S3 API equivalent operation offers more detail.

<>


OAuth scopes

object_storage:read_write

Learn more...

API Endpoint: POST /{apiVersion}/object-storage/buckets/{regionId}/{bucket}/object-url

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.object_storage.buckets.object_url.create(
    api_version="v4",
    region_id="string",
    bucket="string",
    data={
        "content_type": "string",
        "expires_in": 123,
        "method": "GET",
        "name": "example",
    },
)

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.object_storage.buckets.object_url.create(
    api_version="v4",
    region_id="string",
    bucket="string",
    data={
        "content_type": "string",
        "expires_in": 123,
        "method": "GET",
        "name": "example",
    },
)

Module object-storage.cancel

Cancel Object Storage

Cancel Object Storage on an Account.

Warning. This removes all buckets and their contents from your Account. This data is irretrievable once removed.

<>

linode-cli object-storage cancel

<https://www.linode.com/docs/products/tools/cli/get-started/>
object_storage:read_write

<https://techdocs.akamai.com/linode-api/reference/get-started#oauth>

API Endpoint: POST /{apiVersion}/object-storage/cancel

Synchronous Client

from linode_py import Client
from os import getenv

client = Client(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = client.object_storage.cancel.create(api_version="v4")

Asynchronous Client

from linode_py import AsyncClient
from os import getenv

client = AsyncClient(oauth_token_1=getenv("API_TOKEN"), token=getenv("API_TOKEN"))
res = await client.object_storage.cancel.create(api_version="v4")