package
1.0.0
Repository: https://github.com/displague/linode-go.git
Documentation: pkg.go.dev

# README

Go API client for v1

Introduction

The Linode API provides the ability to programmatically manage the full range of Linode products and services.

This reference is designed to assist application developers and system administrators. Each endpoint includes descriptions, request syntax, and examples using standard HTTP requests. Response data is returned in JSON format.

This document was generated from our OpenAPI Specification. See the <a target="_top" href="https://www.openapis.org\">OpenAPI website for more information.

<a target="_top" href="/docs/api/openapi.yaml">Download the Linode OpenAPI Specification.

Changelog

<a target="_top" href="https://developers.linode.com/changelog\">View our Changelog to see release notes on all changes made to our API.

Access and Authentication

Some endpoints are publicly accessible without requiring authentication. All endpoints affecting your Account, however, require either a Personal Access Token or OAuth authentication (when using third-party applications).

Personal Access Token

The easiest way to access the API is with a Personal Access Token (PAT) generated from the <a target="_top" href="https://cloud.linode.com/profile/tokens\">Linode Cloud Manager or the Create Personal Access Token endpoint.

All scopes for the OAuth security model (defined below) apply to this security model as well.

Authentication

Security Scheme Type:HTTP
HTTP Authorization Schemebearer

OAuth

If you only need to access the Linode API for personal use, we recommend that you create a personal access token. If you're designing an application that can authenticate with an arbitrary Linode user, then you should use the OAuth 2.0 workflows presented in this section.

For a more detailed example of an OAuth 2.0 implementation, see our guide on How to Create an OAuth App with the Linode Python API Library.

Before you implement OAuth in your application, you first need to create an OAuth client. You can do this with the Linode API or via the Cloud Manager:

  • When creating the client, you'll supply a label and a redirect_uri (referred to as the Callback URL in the Cloud Manager).
  • The response from this endpoint will give you a client_id and a secret.
  • Clients can be public or private, and are private by default. You can choose to make the client public when it is created.
    • A private client is used with applications which can securely store the client secret (that is, the secret returned to you when you first created the client). For example, an application running on a secured server that only the developer has access to would use a private OAuth client. This is also called a confidential client in some OAuth documentation.
    • A public client is used with applications where the client secret is not guaranteed to be secure. For example, a native app running on a user's computer may not be able to keep the client secret safe, as a user could potentially inspect the source of the application. So, native apps or apps that run in a user's browser should use a public client.
    • Public and private clients follow different workflows, as described below.

OAuth Workflow

The OAuth workflow is a series of exchanges between your third-party app and Linode. The workflow is used to authenticate a user before an application can start making API calls on the user's behalf.

Notes:

  • With respect to the diagram in section 1.2 of RFC 6749, login.linode.com (referred to in this section as the login server) is the Resource Owner and the Authorization Server; api.linode.com (referred to here as the api server) is the Resource Server.
  • The OAuth spec refers to the private and public workflows listed below as the authorization code flow and implicit flow.
PRIVATE WORKFLOWPUBLIC WORKFLOW
1. The user visits the application's website and is directed to login with Linode.1. The user visits the application's website and is directed to login with Linode.
2. Your application then redirects the user to Linode's login server with the client application's client_id and requested OAuth scope, which should appear in the URL of the login page.2. Your application then redirects the user to Linode's login server with the client application's client_id and requested OAuth scope, which should appear in the URL of the login page.
3. The user logs into the login server with their username and password.3. The user logs into the login server with their username and password.
4. The login server redirects the user to the specificed redirect URL with a temporary authorization code (exchange code) in the URL.4. The login server redirects the user back to your application with an OAuth access_token embedded in the redirect URL's hash. This is temporary and expires in two hours. No refresh_token is issued. Therefore, once the access_token expires, a new one will need to be issued by having the user log in again.
5. The application issues a POST request (see below) to the login server with the exchange code, client_id, and the client application's client_secret.
6. The login server responds to the client application with a new OAuth access_token and refresh_token. The access_token is set to expire in two hours.
7. The refresh_token can be used by contacting the login server with the client_id, client_secret, grant_type, and refresh_token to get a new OAuth access_token and refresh_token. The new access_token is good for another two hours, and the new refresh_token, can be used to extend the session again by this same method.

OAuth Private Workflow - Additional Details

The following information expands on steps 5 through 7 of the private workflow:

Once the user has logged into Linode and you have received an exchange code, you will need to trade that exchange code for an access_token and refresh_token. You do this by making an HTTP POST request to the following address:

https://login.linode.com/oauth/token

Make this request as application/x-www-form-urlencoded or as multipart/form-data and include the following parameters in the POST body:

PARAMETERDESCRIPTION
grant_typeThe grant type you're using for renewal. Currently only the string "refresh_token" is accepted.
client_idYour app's client ID.
client_secretYour app's client secret.
codeThe code you just received from the redirect.

You'll get a response like this:

{
  \"scope\": \"linodes:read_write\",
  \"access_token\": \"03d084436a6c91fbafd5c4b20c82e5056a2e9ce1635920c30dc8d81dc7a6665c\"
  \"token_type\": \"bearer\",
  \"expires_in\": 7200,
}

Included in the reponse is an access_token. With this token, you can proceed to make authenticated HTTP requests to the API by adding this header to each request:

Authorization: Bearer 03d084436a6c91fbafd5c4b20c82e5056a2e9ce1635920c30dc8d81dc7a6665c

OAuth Reference

Security Scheme TypeOAuth 2.0
Authorization URLhttps://login.linode.com/oauth/authorize
Token URLhttps://login.linode.com/oauth/token
Scopes
  • account:read_only - Allows access to GET information about your Account.
  • account:read_write - Allows access to all endpoints related to your Account.
  • domains:read_only - Allows access to GET Domains on your Account.
  • domains:read_write - Allows access to all Domain endpoints.
  • events:read_only - Allows access to GET your Events.
  • events:read_write - Allows access to all endpoints related to your Events.
  • firewall:read_only - Allows access to GET information about your Firewalls.
  • firewall:read_write - Allows access to all Firewall endpoints.
  • images:read_only - Allows access to GET your Images.
  • images:read_write - Allows access to all endpoints related to your Images.
  • ips:read_only - Allows access to GET your ips.
  • ips:read_write - Allows access to all endpoints related to your ips.
  • linodes:read_only - Allows access to GET Linodes on your Account.
  • linodes:read_write - Allow access to all endpoints related to your Linodes.
  • lke:read_only - Allows access to GET LKE Clusters on your Account.
  • lke:read_write - Allows access to all endpoints related to LKE Clusters on your Account.
  • longview:read_only - Allows access to GET your Longview Clients.
  • longview:read_write - Allows access to all endpoints related to your Longview Clients.
  • maintenance:read_only - Allows access to GET information about Maintenance on your account.
  • nodebalancers:read_only - Allows access to GET NodeBalancers on your Account.
  • nodebalancers:read_write - Allows access to all NodeBalancer endpoints.
  • object_storage:read_only - Allows access to GET information related to your Object Storage.
  • object_storage:read_write - Allows access to all Object Storage endpoints.
  • stackscripts:read_only - Allows access to GET your StackScripts.
  • stackscripts:read_write - Allows access to all endpoints related to your StackScripts.
  • volumes:read_only - Allows access to GET your Volumes.
  • volumes:read_write - Allows access to all endpoints related to your Volumes.

Requests

Requests must be made over HTTPS to ensure transactions are encrypted. The following Request methods are supported:

METHODUSAGE
GETRetrieves data about collections and individual resources.
POSTFor collections, creates a new resource of that type. Also used to perform actions on action endpoints.
PUTUpdates an existing resource.
DELETEDeletes a resource. This is a destructive action.

Responses

Actions will return one following HTTP response status codes:

STATUSDESCRIPTION
200 OKThe request was successful.
204 No ContentThe server successfully fulfilled the request and there is no additional content to send.
400 Bad RequestYou submitted an invalid request (missing parameters, etc.).
401 UnauthorizedYou failed to authenticate for this resource.
403 ForbiddenYou are authenticated, but don't have permission to do this.
404 Not FoundThe resource you're requesting does not exist.
429 Too Many RequestsYou've hit a rate limit.
500 Internal Server ErrorPlease open a Support Ticket.

Errors

Success is indicated via <a href="https://en.wikipedia.org/wiki/List_of_HTTP_status_codes\" target="_top">Standard HTTP status codes. 2xx codes indicate success, 4xx codes indicate a request error, and 5xx errors indicate a server error. A request error might be an invalid input, a required parameter being omitted, or a malformed request. A server error means something went wrong processing your request. If this occurs, please open a Support Ticket and let us know. Though errors are logged and we work quickly to resolve issues, opening a ticket and providing us with reproducable steps and data is always helpful.

The errors field is an array of the things that went wrong with your request. We will try to include as many of the problems in the response as possible, but it's conceivable that fixing these errors and resubmitting may result in new errors coming back once we are able to get further along in the process of handling your request.

Within each error object, the field parameter will be included if the error pertains to a specific field in the JSON you've submitted. This will be omitted if there is no relevant field. The reason is a human-readable explanation of the error, and will always be included.

Pagination

Resource lists are always paginated. The response will look similar to this:

{
    \"data\": [ ... ],
    \"page\": 1,
    \"pages\": 3,
    \"results\": 300
}
  • Pages start at 1. You may retrieve a specific page of results by adding ?page=x to your URL (for example, ?page=4). If the value of page exceeds 2^64/page_size, the last possible page will be returned.

  • Page sizes default to 100, and can be set to return between 25 and 500. Page size can be set using ?page_size=x.

Filtering and Sorting

Collections are searchable by fields they include, marked in the spec as x-linode-filterable: true. Filters are passed in the X-Filter header and are formatted as JSON objects. Here is a request call for Linode Types in our "standard" class:

curl \"https://api.linode.com/v4/linode/types\" \\
  -H '
    X-Filter: {
      \"class\": \"standard\"
    }'

The filter object's keys are the keys of the object you're filtering, and the values are accepted values. You can add multiple filters by including more than one key. For example, filtering for "standard" Linode Types that offer one vcpu:

 curl \"https://api.linode.com/v4/linode/types\" \\
  -H '
    X-Filter: {
      \"class\": \"standard\",
      \"vcpus\": 1
    }'

In the above example, both filters are combined with an "and" operation. However, if you wanted either Types with one vcpu or Types in our "standard" class, you can add an operator:

curl \"https://api.linode.com/v4/linode/types\" \\
 -H '
   X-Filter: {
     \"+or\": [
       { \"vcpus\": 1 },
       { \"class\": \"standard\" }
     ]
   }'

Each filter in the +or array is its own filter object, and all conditions in it are combined with an "and" operation as they were in the previous example.

Other operators are also available. Operators are keys of a Filter JSON object. Their value must be of the appropriate type, and they are evaluated as described below:

OPERATORTYPEDESCRIPTION
+andarrayAll conditions must be true.
+orarrayOne condition must be true.
+gtnumberValue must be greater than number.
+gtenumberValue must be greater than or equal to number.
+ltnumberValue must be less than number.
+ltenumberValue must be less than or equal to number.
+containsstringGiven string must be in the value.
+neqstringDoes not equal the value.
+order_bystringAttribute to order the results by - must be filterable.
+orderstringEither "asc" or "desc". Defaults to "asc". Requires +order_by.

For example, filtering for Linode Types that offer memory equal to or higher than 61440:

curl \"https://api.linode.com/v4/linode/types\" \\
  -H '
    X-Filter: {
      \"memory\": {
        \"+gte\": 61440
      }
    }'

You can combine and nest operators to construct arbitrarily-complex queries. For example, give me all Linode Types which are either standard or highmem class, or have between 12 and 20 vcpus:

curl \"https://api.linode.com/v4/linode/types\" \\
  -H '
    X-Filter: {
      \"+or\": [
        {
          \"+or\": [
            {
              \"class\": \"standard\"
            },
            {
              \"class\": \"highmem\"
            }
          ]
        },
        {
          \"+and\": [
            {
              \"vcpus\": {
                \"+gte\": 12
              }
            },
            {
              \"vcpus\": {
                \"+lte\": 20
              }
            }
          ]
        }
      ]
    }'

Rate Limiting

With the Linode API, you can make up to 1,600 general API requests every two minutes per user as determined by IP adddress or by OAuth token. Additionally, there are endpoint specfic limits defined below.

Note: There may be rate limiting applied at other levels outside of the API, for example, at the load balancer.

/stats endpoints have their own dedicated limits of 100 requests per minute per user. These endpoints are:

Object Storage endpoints have a dedicated limit of 750 requests per second per user. The Object Storage endpoints are:

Opening Support Tickets has a dedicated limit of 2 requests per minute per user. That endpoint is:

Accepting Entity Transfers has a dedicated limit of 2 requests per minute per user. That endpoint is:

CLI (Command Line Interface)

The <a href="https://github.com/linode/linode-cli\" target="_top">Linode CLI allows you to easily work with the API using intuitive and simple syntax. It requires a Personal Access Token for authentication, and gives you access to all of the features and functionality of the Linode API that are documented here with CLI examples.

Endpoints that do not have CLI examples are currently unavailable through the CLI, but can be accessed via other methods such as Shell commands and other third-party applications.

Overview

This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

  • API version: 4.85.0
  • Package version: 1.0.0
  • Build package: org.openapitools.codegen.languages.GoClientCodegen For more information, please visit https://www.linode.com/support/

Installation

Install the following dependencies:

go get github.com/stretchr/testify/assert
go get golang.org/x/oauth2
go get golang.org/x/net/context

Put the package under your project folder and add the following in import:

import sw "./v1"

To use a proxy, set the environment variable HTTP_PROXY:

os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")

Configuration of Server URL

Default configuration comes with Servers field that contains server objects as defined in the OpenAPI specification.

Select Server Configuration

For using other server than the one defined on index 0 set context value sw.ContextServerIndex of type int.

ctx := context.WithValue(context.Background(), sw.ContextServerIndex, 1)

Templated Server URL

Templated server URL is formatted using default variables from configuration or from context value sw.ContextServerVariables of type map[string]string.

ctx := context.WithValue(context.Background(), sw.ContextServerVariables, map[string]string{
	"basePath": "v2",
})

Note, enum values are always validated and all unused variables are silently ignored.

URLs Configuration per Operation

Each operation can use different server URL defined using OperationServers map in the Configuration. An operation is uniquely identifield by "{classname}Service.{nickname}" string. Similar rules for overriding default operation server index and variables applies by using sw.ContextOperationServerIndices and sw.ContextOperationServerVariables context maps.

ctx := context.WithValue(context.Background(), sw.ContextOperationServerIndices, map[string]int{
	"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), sw.ContextOperationServerVariables, map[string]map[string]string{
	"{classname}Service.{nickname}": {
		"port": "8443",
	},
})

Documentation for API Endpoints

All URIs are relative to https://api.linode.com/v4

ClassMethodHTTP requestDescription
AccountApiAcceptEntityTransferPost /account/entity-transfers/{token}/acceptEntity Transfer Accept
AccountApiCancelAccountPost /account/cancelAccount Cancel
AccountApiCreateClientPost /account/oauth-clientsOAuth Client Create
AccountApiCreateCreditCardPost /account/credit-cardCredit Card Add/Edit
AccountApiCreateEntityTransferPost /account/entity-transfersEntity Transfer Create
AccountApiCreatePayPalPaymentPost /account/payments/paypalPayPal Payment Stage
AccountApiCreatePaymentPost /account/paymentsPayment Make
AccountApiCreateUserPost /account/usersUser Create
AccountApiDeleteClientDelete /account/oauth-clients/{clientId}OAuth Client Delete
AccountApiDeleteEntityTransferDelete /account/entity-transfers/{token}Entity Transfer Cancel
AccountApiDeleteUserDelete /account/users/{username}User Delete
AccountApiEnableAccountMangedPost /account/settings/managed-enableLinode Managed Enable
AccountApiEventReadPost /account/events/{eventId}/readEvent Mark as Read
AccountApiEventSeenPost /account/events/{eventId}/seenEvent Mark as Seen
AccountApiExecutePayPalPaymentPost /account/payments/paypal/executeStaged/Approved PayPal Payment Execute
AccountApiGetAccountGet /accountAccount View
AccountApiGetAccountLoginGet /account/logins/{loginId}Login View
AccountApiGetAccountLoginsGet /account/loginsUser Logins List All
AccountApiGetAccountSettingsGet /account/settingsAccount Settings View
AccountApiGetClientGet /account/oauth-clients/{clientId}OAuth Client View
AccountApiGetClientThumbnailGet /account/oauth-clients/{clientId}/thumbnailOAuth Client Thumbnail View
AccountApiGetClientsGet /account/oauth-clientsOAuth Clients List
AccountApiGetEntityTransferGet /account/entity-transfers/{token}Entity Transfer View
AccountApiGetEntityTransfersGet /account/entity-transfersEntity Transfers List
AccountApiGetEventGet /account/events/{eventId}Event View
AccountApiGetEventsGet /account/eventsEvents List
AccountApiGetInvoiceGet /account/invoices/{invoiceId}Invoice View
AccountApiGetInvoiceItemsGet /account/invoices/{invoiceId}/itemsInvoice Items List
AccountApiGetInvoicesGet /account/invoicesInvoices List
AccountApiGetMaintenanceGet /account/maintenanceMaintenance List
AccountApiGetNotificationsGet /account/notificationsNotifications List
AccountApiGetPaymentGet /account/payments/{paymentId}Payment View
AccountApiGetPaymentsGet /account/paymentsPayments List
AccountApiGetTransferGet /account/transferNetwork Utilization View
AccountApiGetUserGet /account/users/{username}User View
AccountApiGetUserGrantsGet /account/users/{username}/grantsUser's Grants View
AccountApiGetUsersGet /account/usersUsers List
AccountApiResetClientSecretPost /account/oauth-clients/{clientId}/reset-secretOAuth Client Secret Reset
AccountApiSetClientThumbnailPut /account/oauth-clients/{clientId}/thumbnailOAuth Client Thumbnail Update
AccountApiUpdateAccountPut /accountAccount Update
AccountApiUpdateAccountSettingsPut /account/settingsAccount Settings Update
AccountApiUpdateClientPut /account/oauth-clients/{clientId}OAuth Client Update
AccountApiUpdateUserPut /account/users/{username}User Update
AccountApiUpdateUserGrantsPut /account/users/{username}/grantsUser's Grants Update
DomainsApiCloneDomainPost /domains/{domainId}/cloneDomain Clone
DomainsApiCreateDomainPost /domainsDomain Create
DomainsApiCreateDomainRecordPost /domains/{domainId}/recordsDomain Record Create
DomainsApiDeleteDomainDelete /domains/{domainId}Domain Delete
DomainsApiDeleteDomainRecordDelete /domains/{domainId}/records/{recordId}Domain Record Delete
DomainsApiGetDomainGet /domains/{domainId}Domain View
DomainsApiGetDomainRecordGet /domains/{domainId}/records/{recordId}Domain Record View
DomainsApiGetDomainRecordsGet /domains/{domainId}/recordsDomain Records List
DomainsApiGetDomainsGet /domainsDomains List
DomainsApiImportDomainPost /domains/importDomain Import
DomainsApiUpdateDomainPut /domains/{domainId}Domain Update
DomainsApiUpdateDomainRecordPut /domains/{domainId}/records/{recordId}Domain Record Update
ImagesApiCreateImagePost /imagesImage Create
ImagesApiDeleteImageDelete /images/{imageId}Image Delete
ImagesApiGetImageGet /images/{imageId}Image View
ImagesApiGetImagesGet /imagesImages List
ImagesApiUpdateImagePut /images/{imageId}Image Update
LinodeInstancesApiAddLinodeConfigPost /linode/instances/{linodeId}/configsConfiguration Profile Create
LinodeInstancesApiAddLinodeDiskPost /linode/instances/{linodeId}/disksDisk Create
LinodeInstancesApiAddLinodeIPPost /linode/instances/{linodeId}/ipsIPv4 Address Allocate
LinodeInstancesApiBootLinodeInstancePost /linode/instances/{linodeId}/bootLinode Boot
LinodeInstancesApiCancelBackupsPost /linode/instances/{linodeId}/backups/cancelBackups Cancel
LinodeInstancesApiCloneLinodeDiskPost /linode/instances/{linodeId}/disks/{diskId}/cloneDisk Clone
LinodeInstancesApiCloneLinodeInstancePost /linode/instances/{linodeId}/cloneLinode Clone
LinodeInstancesApiCreateLinodeInstancePost /linode/instancesLinode Create
LinodeInstancesApiCreateSnapshotPost /linode/instances/{linodeId}/backupsSnapshot Create
LinodeInstancesApiDeleteDiskDelete /linode/instances/{linodeId}/disks/{diskId}Disk Delete
LinodeInstancesApiDeleteLinodeConfigDelete /linode/instances/{linodeId}/configs/{configId}Configuration Profile Delete
LinodeInstancesApiDeleteLinodeInstanceDelete /linode/instances/{linodeId}Linode Delete
LinodeInstancesApiEnableBackupsPost /linode/instances/{linodeId}/backups/enableBackups Enable
LinodeInstancesApiGetBackupGet /linode/instances/{linodeId}/backups/{backupId}Backup View
LinodeInstancesApiGetBackupsGet /linode/instances/{linodeId}/backupsBackups List
LinodeInstancesApiGetKernelGet /linode/kernels/{kernelId}Kernel View
LinodeInstancesApiGetKernelsGet /linode/kernelsKernels List
LinodeInstancesApiGetLinodeConfigGet /linode/instances/{linodeId}/configs/{configId}Configuration Profile View
LinodeInstancesApiGetLinodeConfigsGet /linode/instances/{linodeId}/configsConfiguration Profiles List
LinodeInstancesApiGetLinodeDiskGet /linode/instances/{linodeId}/disks/{diskId}Disk View
LinodeInstancesApiGetLinodeDisksGet /linode/instances/{linodeId}/disksDisks List
LinodeInstancesApiGetLinodeFirewallsGet /linode/instances/{linodeId}/firewallsFirewalls List
LinodeInstancesApiGetLinodeIPGet /linode/instances/{linodeId}/ips/{address}IP Address View
LinodeInstancesApiGetLinodeIPsGet /linode/instances/{linodeId}/ipsNetworking Information List
LinodeInstancesApiGetLinodeInstanceGet /linode/instances/{linodeId}Linode View
LinodeInstancesApiGetLinodeInstancesGet /linode/instancesLinodes List
LinodeInstancesApiGetLinodeStatsGet /linode/instances/{linodeId}/statsLinode Statistics View
LinodeInstancesApiGetLinodeStatsByYearMonthGet /linode/instances/{linodeId}/stats/{year}/{month}Statistics View (year/month)
LinodeInstancesApiGetLinodeTransferGet /linode/instances/{linodeId}/transferNetwork Transfer View
LinodeInstancesApiGetLinodeTransferByYearMonthGet /linode/instances/{linodeId}/transfer/{year}/{month}Network Transfer View (year/month)
LinodeInstancesApiGetLinodeVolumesGet /linode/instances/{linodeId}/volumesLinode's Volumes List
LinodeInstancesApiMigrateLinodeInstancePost /linode/instances/{linodeId}/migrateDC Migration/Pending Host Migration Initiate
LinodeInstancesApiMutateLinodeInstancePost /linode/instances/{linodeId}/mutateLinode Upgrade
LinodeInstancesApiRebootLinodeInstancePost /linode/instances/{linodeId}/rebootLinode Reboot
LinodeInstancesApiRebuildLinodeInstancePost /linode/instances/{linodeId}/rebuildLinode Rebuild
LinodeInstancesApiRemoveLinodeIPDelete /linode/instances/{linodeId}/ips/{address}IPv4 Address Delete
LinodeInstancesApiRescueLinodeInstancePost /linode/instances/{linodeId}/rescueLinode Boot into Rescue Mode
LinodeInstancesApiResetDiskPasswordPost /linode/instances/{linodeId}/disks/{diskId}/passwordDisk Root Password Reset
LinodeInstancesApiResetLinodePasswordPost /linode/instances/{linodeId}/passwordLinode Root Password Reset
LinodeInstancesApiResizeDiskPost /linode/instances/{linodeId}/disks/{diskId}/resizeDisk Resize
LinodeInstancesApiResizeLinodeInstancePost /linode/instances/{linodeId}/resizeLinode Resize
LinodeInstancesApiRestoreBackupPost /linode/instances/{linodeId}/backups/{backupId}/restoreBackup Restore
LinodeInstancesApiShutdownLinodeInstancePost /linode/instances/{linodeId}/shutdownLinode Shut Down
LinodeInstancesApiUpdateDiskPut /linode/instances/{linodeId}/disks/{diskId}Disk Update
LinodeInstancesApiUpdateLinodeConfigPut /linode/instances/{linodeId}/configs/{configId}Configuration Profile Update
LinodeInstancesApiUpdateLinodeIPPut /linode/instances/{linodeId}/ips/{address}IP Address Update
LinodeInstancesApiUpdateLinodeInstancePut /linode/instances/{linodeId}Linode Update
LinodeKubernetesEngineLKEApiCreateLKEClusterPost /lke/clustersKubernetes Cluster Create
LinodeKubernetesEngineLKEApiDeleteLKEClusterDelete /lke/clusters/{clusterId}Kubernetes Cluster Delete
LinodeKubernetesEngineLKEApiDeleteLKENodePoolDelete /lke/clusters/{clusterId}/pools/{poolId}Node Pool Delete
LinodeKubernetesEngineLKEApiGetLKEClusterGet /lke/clusters/{clusterId}Kubernetes Cluster View
LinodeKubernetesEngineLKEApiGetLKEClusterAPIEndpointsGet /lke/clusters/{clusterId}/api-endpointsKubernetes API Endpoints List
LinodeKubernetesEngineLKEApiGetLKEClusterKubeconfigGet /lke/clusters/{clusterId}/kubeconfigKubeconfig View
LinodeKubernetesEngineLKEApiGetLKEClusterNodeGet /lke/clusters/{clusterId}/nodes/{nodeId}Node View
LinodeKubernetesEngineLKEApiGetLKEClusterPoolsGet /lke/clusters/{clusterId}/poolsNode Pools List
LinodeKubernetesEngineLKEApiGetLKEClustersGet /lke/clustersKubernetes Clusters List
LinodeKubernetesEngineLKEApiGetLKENodePoolGet /lke/clusters/{clusterId}/pools/{poolId}Node Pool View
LinodeKubernetesEngineLKEApiGetLKEVersionGet /lke/versions/{version}Kubernetes Version View
LinodeKubernetesEngineLKEApiGetLKEVersionsGet /lke/versionsKubernetes Versions List
LinodeKubernetesEngineLKEApiPostLKEClusterNodeRecyclePost /lke/clusters/{clusterId}/nodes/{nodeId}/recycleNode Recycle
LinodeKubernetesEngineLKEApiPostLKEClusterPoolRecyclePost /lke/clusters/{clusterId}/pools/{poolId}/recycleNode Pool Recycle
LinodeKubernetesEngineLKEApiPostLKEClusterPoolsPost /lke/clusters/{clusterId}/poolsNode Pool Create
LinodeKubernetesEngineLKEApiPostLKEClusterRecyclePost /lke/clusters/{clusterId}/recycleCluster Nodes Recycle
LinodeKubernetesEngineLKEApiPutLKEClusterPut /lke/clusters/{clusterId}Kubernetes Cluster Update
LinodeKubernetesEngineLKEApiPutLKENodePoolPut /lke/clusters/{clusterId}/pools/{poolId}Node Pool Update
LinodeTypesApiGetLinodeTypeGet /linode/types/{typeId}Type View
LinodeTypesApiGetLinodeTypesGet /linode/typesTypes List
LongviewApiCreateLongviewClientPost /longview/clientsLongview Client Create
LongviewApiDeleteLongviewClientDelete /longview/clients/{clientId}Longview Client Delete
LongviewApiGetLongviewClientGet /longview/clients/{clientId}Longview Client View
LongviewApiGetLongviewClientsGet /longview/clientsLongview Clients List
LongviewApiGetLongviewPlanGet /longview/planLongview Plan View
LongviewApiGetLongviewSubscriptionGet /longview/subscriptions/{subscriptionId}Longview Subscription View
LongviewApiGetLongviewSubscriptionsGet /longview/subscriptionsLongview Subscriptions List
LongviewApiUpdateLongviewClientPut /longview/clients/{clientId}Longview Client Update
LongviewApiUpdateLongviewPlanPut /longview/planLongview Plan Update
ManagedApiCreateManagedContactPost /managed/contactsManaged Contact Create
ManagedApiCreateManagedCredentialPost /managed/credentialsManaged Credential Create
ManagedApiCreateManagedServicePost /managed/servicesManaged Service Create
ManagedApiDeleteManagedContactDelete /managed/contacts/{contactId}Managed Contact Delete
ManagedApiDeleteManagedCredentialPost /managed/credentials/{credentialId}/revokeManaged Credential Delete
ManagedApiDeleteManagedServiceDelete /managed/services/{serviceId}Managed Service Delete
ManagedApiDisableManagedServicePost /managed/services/{serviceId}/disableManaged Service Disable
ManagedApiEnableManagedServicePost /managed/services/{serviceId}/enableManaged Service Enable
ManagedApiGetManagedContactGet /managed/contacts/{contactId}Managed Contact View
ManagedApiGetManagedContactsGet /managed/contactsManaged Contacts List
ManagedApiGetManagedCredentialGet /managed/credentials/{credentialId}Managed Credential View
ManagedApiGetManagedCredentialsGet /managed/credentialsManaged Credentials List
ManagedApiGetManagedIssueGet /managed/issues/{issueId}Managed Issue View
ManagedApiGetManagedIssuesGet /managed/issuesManaged Issues List
ManagedApiGetManagedLinodeSettingGet /managed/linode-settings/{linodeId}Linode's Managed Settings View
ManagedApiGetManagedLinodeSettingsGet /managed/linode-settingsManaged Linode Settings List
ManagedApiGetManagedServiceGet /managed/services/{serviceId}Managed Service View
ManagedApiGetManagedServicesGet /managed/servicesManaged Services List
ManagedApiGetManagedStatsGet /managed/statsManaged Stats List
ManagedApiUpdateManagedContactPut /managed/contacts/{contactId}Managed Contact Update
ManagedApiUpdateManagedCredentialPut /managed/credentials/{credentialId}Managed Credential Update
ManagedApiUpdateManagedCredentialUsernamePasswordPost /managed/credentials/{credentialId}/updateManaged Credential Username and Password Update
ManagedApiUpdateManagedLinodeSettingPut /managed/linode-settings/{linodeId}Linode's Managed Settings Update
ManagedApiUpdateManagedServicePut /managed/services/{serviceId}Managed Service Update
ManagedApiViewManagedSSHKeyGet /managed/credentials/sshkeyManaged SSH Key View
NetworkingApiAllocateIPPost /networking/ipsIP Address Allocate
NetworkingApiAssignIPsPost /networking/ipv4/assignLinodes Assign IPs
NetworkingApiCreateFirewallDevicePost /networking/firewalls/{firewallId}/devicesFirewall Device Create
NetworkingApiCreateFirewallsPost /networking/firewallsFirewall Create
NetworkingApiDeleteFirewallDelete /networking/firewalls/{firewallId}Firewall Delete
NetworkingApiDeleteFirewallDeviceDelete /networking/firewalls/{firewallId}/devices/{deviceId}Firewall Device Delete
NetworkingApiGetFirewallGet /networking/firewalls/{firewallId}Firewall View
NetworkingApiGetFirewallDeviceGet /networking/firewalls/{firewallId}/devices/{deviceId}Firewall Device View
NetworkingApiGetFirewallDevicesGet /networking/firewalls/{firewallId}/devicesFirewall Devices List
NetworkingApiGetFirewallRulesGet /networking/firewalls/{firewallId}/rulesFirewall Rules List
NetworkingApiGetFirewallsGet /networking/firewallsFirewalls List
NetworkingApiGetIPGet /networking/ips/{address}IP Address View
NetworkingApiGetIPsGet /networking/ipsIP Addresses List
NetworkingApiGetIPv6PoolsGet /networking/ipv6/poolsIPv6 Pools List
NetworkingApiGetIPv6RangesGet /networking/ipv6/rangesIPv6 Ranges List
NetworkingApiShareIPsPost /networking/ipv4/shareIP Sharing Configure
NetworkingApiUpdateFirewallPut /networking/firewalls/{firewallId}Firewall Update
NetworkingApiUpdateFirewallRulesPut /networking/firewalls/{firewallId}/rulesFirewall Rules Update
NetworkingApiUpdateIPPut /networking/ips/{address}IP Address RDNS Update
NodeBalancersApiCreateNodeBalancerPost /nodebalancersNodeBalancer Create
NodeBalancersApiCreateNodeBalancerConfigPost /nodebalancers/{nodeBalancerId}/configsConfig Create
NodeBalancersApiCreateNodeBalancerNodePost /nodebalancers/{nodeBalancerId}/configs/{configId}/nodesNode Create
NodeBalancersApiDeleteNodeBalancerDelete /nodebalancers/{nodeBalancerId}NodeBalancer Delete
NodeBalancersApiDeleteNodeBalancerConfigDelete /nodebalancers/{nodeBalancerId}/configs/{configId}Config Delete
NodeBalancersApiDeleteNodeBalancerConfigNodeDelete /nodebalancers/{nodeBalancerId}/configs/{configId}/nodes/{nodeId}Node Delete
NodeBalancersApiGetNodeBalancerGet /nodebalancers/{nodeBalancerId}NodeBalancer View
NodeBalancersApiGetNodeBalancerConfigGet /nodebalancers/{nodeBalancerId}/configs/{configId}Config View
NodeBalancersApiGetNodeBalancerConfigNodesGet /nodebalancers/{nodeBalancerId}/configs/{configId}/nodesNodes List
NodeBalancersApiGetNodeBalancerConfigsGet /nodebalancers/{nodeBalancerId}/configsConfigs List
NodeBalancersApiGetNodeBalancerNodeGet /nodebalancers/{nodeBalancerId}/configs/{configId}/nodes/{nodeId}Node View
NodeBalancersApiGetNodeBalancersGet /nodebalancersNodeBalancers List
NodeBalancersApiNodebalancersNodeBalancerIdStatsGetGet /nodebalancers/{nodeBalancerId}/statsNodeBalancer Statistics View
NodeBalancersApiRebuildNodeBalancerConfigPost /nodebalancers/{nodeBalancerId}/configs/{configId}/rebuildConfig Rebuild
NodeBalancersApiUpdateNodeBalancerPut /nodebalancers/{nodeBalancerId}NodeBalancer Update
NodeBalancersApiUpdateNodeBalancerConfigPut /nodebalancers/{nodeBalancerId}/configs/{configId}Config Update
NodeBalancersApiUpdateNodeBalancerNodePut /nodebalancers/{nodeBalancerId}/configs/{configId}/nodes/{nodeId}Node Update
ObjectStorageApiCancelObjectStoragePost /object-storage/cancelObject Storage Cancel
ObjectStorageApiCreateObjectStorageBucketPost /object-storage/bucketsObject Storage Bucket Create
ObjectStorageApiCreateObjectStorageKeysPost /object-storage/keysObject Storage Key Create
ObjectStorageApiCreateObjectStorageObjectURLPost /object-storage/buckets/{clusterId}/{bucket}/object-urlObject Storage Object URL Create
ObjectStorageApiCreateObjectStorageSSLPost /object-storage/buckets/{clusterId}/{bucket}/sslObject Storage TLS/SSL Cert Upload
ObjectStorageApiDeleteObjectStorageBucketDelete /object-storage/buckets/{clusterId}/{bucket}Object Storage Bucket Remove
ObjectStorageApiDeleteObjectStorageKeyDelete /object-storage/keys/{keyId}Object Storage Key Revoke
ObjectStorageApiDeleteObjectStorageSSLDelete /object-storage/buckets/{clusterId}/{bucket}/sslObject Storage TLS/SSL Cert Delete
ObjectStorageApiGetObjectStorageBucketGet /object-storage/buckets/{clusterId}/{bucket}Object Storage Bucket View
ObjectStorageApiGetObjectStorageBucketContentGet /object-storage/buckets/{clusterId}/{bucket}/object-listObject Storage Bucket Contents List
ObjectStorageApiGetObjectStorageBucketinClusterGet /object-storage/buckets/{clusterId}Object Storage Buckets in Cluster List
ObjectStorageApiGetObjectStorageBucketsGet /object-storage/bucketsObject Storage Buckets List
ObjectStorageApiGetObjectStorageClusterGet /object-storage/clusters/{clusterId}Cluster View
ObjectStorageApiGetObjectStorageClustersGet /object-storage/clustersClusters List
ObjectStorageApiGetObjectStorageKeyGet /object-storage/keys/{keyId}Object Storage Key View
ObjectStorageApiGetObjectStorageKeysGet /object-storage/keysObject Storage Keys List
ObjectStorageApiGetObjectStorageSSLGet /object-storage/buckets/{clusterId}/{bucket}/sslObject Storage TLS/SSL Cert View
ObjectStorageApiGetObjectStorageTransferGet /object-storage/transferObject Storage Transfer View
ObjectStorageApiModifyObjectStorageBucketAccessPost /object-storage/buckets/{clusterId}/{bucket}/accessObject Storage Bucket Access Modify
ObjectStorageApiUpdateObjectStorageBucketACLPut /object-storage/buckets/{clusterId}/{bucket}/object-aclObject Storage Object ACL Config Update
ObjectStorageApiUpdateObjectStorageBucketAccessPut /object-storage/buckets/{clusterId}/{bucket}/accessObject Storage Bucket Access Update
ObjectStorageApiUpdateObjectStorageKeyPut /object-storage/keys/{keyId}Object Storage Key Update
ObjectStorageApiViewObjectStorageBucketACLGet /object-storage/buckets/{clusterId}/{bucket}/object-aclObject Storage Object ACL Config View
ProfileApiAddSSHKeyPost /profile/sshkeysSSH Key Add
ProfileApiCreatePersonalAccessTokenPost /profile/tokensPersonal Access Token Create
ProfileApiDeletePersonalAccessTokenDelete /profile/tokens/{tokenId}Personal Access Token Revoke
ProfileApiDeleteProfileAppDelete /profile/apps/{appId}App Access Revoke
ProfileApiDeleteSSHKeyDelete /profile/sshkeys/{sshKeyId}SSH Key Delete
ProfileApiGetDevicesGet /profile/devicesTrusted Devices List
ProfileApiGetPersonalAccessTokenGet /profile/tokens/{tokenId}Personal Access Token View
ProfileApiGetPersonalAccessTokensGet /profile/tokensPersonal Access Tokens List
ProfileApiGetProfileGet /profileProfile View
ProfileApiGetProfileAppGet /profile/apps/{appId}Authorized App View
ProfileApiGetProfileAppsGet /profile/appsAuthorized Apps List
ProfileApiGetProfileGrantsGet /profile/grantsGrants List
ProfileApiGetProfileLoginGet /profile/logins/{loginId}Login View
ProfileApiGetProfileLoginsGet /profile/loginsLogins List
ProfileApiGetSSHKeyGet /profile/sshkeys/{sshKeyId}SSH Key View
ProfileApiGetSSHKeysGet /profile/sshkeysSSH Keys List
ProfileApiGetTrustedDeviceGet /profile/devices/{deviceId}Trusted Device View
ProfileApiGetUserPreferencesGet /profile/preferencesUser Preferences View
ProfileApiRevokeTrustedDeviceDelete /profile/devices/{deviceId}Trusted Device Revoke
ProfileApiTfaConfirmPost /profile/tfa-enable-confirmTwo Factor Authentication Confirm/Enable
ProfileApiTfaDisablePost /profile/tfa-disableTwo Factor Authentication Disable
ProfileApiTfaEnablePost /profile/tfa-enableTwo Factor Secret Create
ProfileApiUpdatePersonalAccessTokenPut /profile/tokens/{tokenId}Personal Access Token Update
ProfileApiUpdateProfilePut /profileProfile Update
ProfileApiUpdateSSHKeyPut /profile/sshkeys/{sshKeyId}SSH Key Update
ProfileApiUpdateUserPreferencesPut /profile/preferencesUser Preferences Update
RegionsApiGetRegionGet /regions/{regionId}Region View
RegionsApiGetRegionsGet /regionsRegions List
StackScriptsApiAddStackScriptPost /linode/stackscriptsStackScript Create
StackScriptsApiDeleteStackScriptDelete /linode/stackscripts/{stackscriptId}StackScript Delete
StackScriptsApiGetStackScriptGet /linode/stackscripts/{stackscriptId}StackScript View
StackScriptsApiGetStackScriptsGet /linode/stackscriptsStackScripts List
StackScriptsApiUpdateStackScriptPut /linode/stackscripts/{stackscriptId}StackScript Update
SupportApiCloseTicketPost /support/tickets/{ticketId}/closeSupport Ticket Close
SupportApiCreateTicketPost /support/ticketsSupport Ticket Open
SupportApiCreateTicketAttachmentPost /support/tickets/{ticketId}/attachmentsTicket Attachment Create
SupportApiCreateTicketReplyPost /support/tickets/{ticketId}/repliesReply Create
SupportApiGetTicketGet /support/tickets/{ticketId}Support Ticket View
SupportApiGetTicketRepliesGet /support/tickets/{ticketId}/repliesReplies List
SupportApiGetTicketsGet /support/ticketsSupport Tickets List
TagsApiCreateTagPost /tagsNew Tag Create
TagsApiDeleteTagDelete /tags/{label}Tag Delete
TagsApiGetTaggedObjectsGet /tags/{label}Tagged Objects List
TagsApiGetTagsGet /tagsTags List
VolumesApiAttachVolumePost /volumes/{volumeId}/attachVolume Attach
VolumesApiCloneVolumePost /volumes/{volumeId}/cloneVolume Clone
VolumesApiCreateVolumePost /volumesVolume Create
VolumesApiDeleteVolumeDelete /volumes/{volumeId}Volume Delete
VolumesApiDetachVolumePost /volumes/{volumeId}/detachVolume Detach
VolumesApiGetVolumeGet /volumes/{volumeId}Volume View
VolumesApiGetVolumesGet /volumesVolumes List
VolumesApiResizeVolumePost /volumes/{volumeId}/resizeVolume Resize
VolumesApiUpdateVolumePut /volumes/{volumeId}Volume Update

Documentation For Models

Documentation For Authorization

oauth

  • Type: OAuth
  • Flow: accessCode
  • Authorization URL: https://login.linode.com/oauth/authorize
  • Scopes:
  • account:read_only: Allows access to GET information about your Account.
  • account:read_write: Allows access to all endpoints related to your Account.
  • domains:read_only: Allows access to GET Domains on your Account.
  • domains:read_write: Allows access to all Domain endpoints.
  • events:read_only: Allows access to GET your Events.
  • events:read_write: Allows access to all endpoints related to your Events.
  • firewall:read_only: Allows access to GET information about your Firewalls.
  • firewall:read_write: Allows acces to all Firewall endpoints.
  • images:read_only: Allows access to GET your Images.
  • images:read_write: Allows access to all endpoints related to your Images.
  • ips:read_only: Allows access to GET your ips.
  • ips:read_write: Allows access to all endpoints related to your ips.
  • linodes:read_only: Allows access to GET Linodes on your Account.
  • linodes:read_write: Allow access to all endpoints related to your Linodes.
  • lke:read_only: Allows access to GET LKE Clusters on your Account.
  • lke:read_write: Allows access to all endpoints related to LKE Clusters on your Account.
  • longview:read_only: Allows access to GET your Longview Clients.
  • longview:read_write: Allows access to all endpoints related to your Longview Clients.
  • maintenance:read_only: Allows access to GET information about Maintenance on your account.
  • nodebalancers:read_only: Allows access to GET NodeBalancers on your Account.
  • nodebalancers:read_write: Allows access to all NodeBalancer endpoints.
  • object_storage:read_only: Allows access to GET information related to your Object Storage.
  • object_storage:read_write: Allows access to all Object Storage endpoints.
  • stackscripts:read_only: Allows access to GET your StackScripts.
  • stackscripts:read_write: Allows access to all endpoints related to your StackScripts.
  • volumes:read_only: Allows access to GET your Volumes.
  • volumes:read_write: Allows access to all endpoints related to your Volumes.

Example

auth := context.WithValue(context.Background(), sw.ContextAccessToken, "ACCESSTOKENSTRING")
r, err := client.Service.Operation(auth, args)

Or via OAuth2 module to automatically refresh tokens and perform user authentication.

import "golang.org/x/oauth2"

/* Perform OAuth2 round trip request and obtain a token */

tokenSource := oauth2cfg.TokenSource(createContext(httpClient), &token)
auth := context.WithValue(oauth2.NoContext, sw.ContextOAuth2, tokenSource)
r, err := client.Service.Operation(auth, args)

personalAccessToken

  • Type: HTTP Bearer token authentication

Example

auth := context.WithValue(context.Background(), sw.ContextAccessToken, "BEARERTOKENSTRING")
r, err := client.Service.Operation(auth, args)

Documentation for Utility Methods

Due to the fact that model structure members are all pointers, this package contains a number of utility functions to easily obtain pointers to values of basic types. Each of these functions takes a value of the given basic type and returns a pointer to it:

  • PtrBool
  • PtrInt
  • PtrInt32
  • PtrInt64
  • PtrFloat
  • PtrFloat32
  • PtrFloat64
  • PtrString
  • PtrTime

Author

[email protected]