@datafire/linode
v3.0.0
Published
DataFire integration for Linode
Downloads
6
Readme
@datafire/linode
Client library for Linode
Installation and Usage
npm install --save @datafire/linode
let linode = require('@datafire/linode').create({
access_token: "",
refresh_token: "",
client_id: "",
client_secret: "",
redirect_uri: "",
personalAccessToken: ""
});
.then(data => {
console.log(data);
});
Description
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 OpenAPI website for more information.
Download the Linode OpenAPI Specification.
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 Linode Cloud Manager.
All scopes for the OAuth security model (defined below) apply to this security model as well.
Authentication
| Security Scheme Type: | HTTP | |-----------------------|------| | HTTP Authorization Scheme | bearer |
OAuth
The OAuth workflow is a three-step process to authenticate a User before an application can start making API calls on the User's behalf. If all you need is a Personal Access Token, feel free to skip ahead to the next section.
First, the User visits the application's website and is directed to log with Linode. The User is then redirected to Linode's authentication server and presented the scope levels the application is requesting. Once the User accepts the request for access, we redirect them back to the application's specified redirect URI with an access code.
Once the User has logged in to Linode and you have received an exchange code, you will need to exchange that access code for an Authorization 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:
| PARAMETER | DESCRIPTION | |-----------|-------------| | client_id | Your app's client ID | | client_secret | Your app's client secret | | code | The code you just received from the redirect |
You'll get a reponse like this:
{
"scope": "linodes:read_write",
"access_token": "03d084436a6c91fbafd5c4b20c82e5056a2e9ce1635920c30dc8d81dc7a6665c"
"token_type": "bearer",
"expires_in": 7200,
}
Included in the reponse is 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
Authentication
| Security Scheme Type: | Oauth2 |
|-----------------------|--------|
| AuthorizationCode Oauth Flow | Authorization URL: https://login.linode.com/oauth/authorizeToken URL: https://login.linode.com/oauth/tokenScopes: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.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.longview:read_only
- Allows access to GET your Longview Clients.longview:read_write
- Allows access to all endpoints related to your Longview Clients.nodebalancers:read_only
- Allows access to GET NodeBalancers on your Account.nodebalancers:read_write
- Allows access to all NodeBalancer 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:
| METHOD | USAGE | |--------|-------| | GET | Retrieves data about collections and individual resources. | | POST | For collections, creates a new resource of that type. Also used to perform actions on action endpoints. | | PUT | Updates an existing resource. | | DELETE | Deletes a resource. This is a destructive action. |
Responses
Actions will return one following HTTP response status codes:
| STATUS | DESCRIPTION | |---------|-------------| | 200 OK | The request was successful. | | 204 No Content | The server successfully fulfilled the request and there is no additional content to send. | | 400 Bad Request | You submitted an invalid request (missing parameters, etc.). | | 401 Unauthorized | You failed to authenticate for this resource. | | 403 Forbidden | You are authenticated, but don't have permission to do this. | | 404 Not Found | The resource you're requesting does not exist. | | 429 Too Many Requests | You've hit a rate limit. | | 500 Internal Server Error | Please open a Support Ticket. |
Errors
Success is indicated via 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 ofpage
exceeds2^64/page_size
, the last possible page will be returned.Page sizes default to 100, and can be set to return between 25 and 100. 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:
| OPERATOR | TYPE | DESCRIPTION |
|----------|--------|-----------------------------------|
| +and | array | All conditions must be true. |
| +or | array | One condition must be true. |
| +gt | number | Value must be greater than number. |
| +gte | number | Value must be greater than or equal to number. |
| +lt | number | Value must be less than number. |
| +lte | number | Value must be less than or equal to number. |
| +contains | string | Given string must be in the value. |
| +neq | string | Does not equal the value. |
| +order_by | string | Attribute to order the results by - must be filterable. |
| +order | string | Either "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
}
}
]
}
]
}'
CLI (Command Line Interface)
The 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.
APIv3
View the Linode APIv3 Documentation.
Actions
oauthCallback
Exchange the code passed to your redirect URI for an access_token
linode.oauthCallback({
"code": ""
}, context)
Input
- input
object
- code required
string
- code required
Output
- output
object
- access_token
string
- refresh_token
string
- token_type
string
- scope
string
- expiration
string
- access_token
oauthRefresh
Exchange a refresh_token for an access_token
linode.oauthRefresh(null, context)
Input
This action has no parameters
Output
- output
object
- access_token
string
- refresh_token
string
- token_type
string
- scope
string
- expiration
string
- access_token
getAccount
Returns the contact and billing information related to your Account.
linode.getAccount(null, context)
Input
This action has no parameters
Output
- output Account
updateAccount
Updates contact and billing information related to your Account.
linode.updateAccount({
"body": {}
}, context)
Input
- input
object
- body required Account
Output
- output Account
cancelAccount
Cancels an active Linode account. This action will cause Linode to attempt to charge the credit card on file for the remaining balance. An error will occur if Linode fails to charge the credit card on file. Restricted users will not be able to cancel an account.
linode.cancelAccount({
"body": null
}, context)
Input
- input
object
- body required
object
- comments
string
: Any reason for cancelling the account, and any other comments you might have about your Linode service.
- comments
- body required
Output
- output
object
- survey_link
string
: A link to Linode's exit survey.
- survey_link
createCreditCard
Adds/edit credit card information to your Account. Only one credit card can be associated with your Account, so using this endpoint will overwrite your currently active card information with the new credit card.
linode.createCreditCard({
"body": null
}, context)
Input
- input
object
- body required
- card_number required
string
: Your credit card number. No spaces or dashes allowed. - expiry_month required
integer
: A value from 1-12 representing the expiration month of your credit card. - expiry_year required
integer
: A four-digit integer representing the expiration year of your credit card. - cvv
string
: The Card Verification Value on the back of the card.
- card_number required
- body required
Output
- output
object
getEvents
Returns a collection of Event objects representing actions taken on your Account. The Events returned depends on your grants.
linode.getEvents({}, context)
Input
- input
object
- page
integer
: The page of a collection to return. - page_size
integer
: The number of items to return per page.
- page
Output
- output
object
- data
array
- items Event
- page PaginationEnvelope/properties/page
- pages PaginationEnvelope/properties/pages
- results PaginationEnvelope/properties/results
- data
getEvent
Returns a single Event object.
linode.getEvent({
"eventId": 0
}, context)
Input
- input
object
- eventId required
integer
: The ID of the Event.
- eventId required
Output
- output Event
eventRead
Marks a single Event as read.
linode.eventRead({
"eventId": 0
}, context)
Input
- input
object
- eventId required
integer
: The ID of the Event to designate as read.
- eventId required
Output
- output
object
eventSeen
Marks all Events up to and including this Event by ID as seen.
linode.eventSeen({
"eventId": 0
}, context)
Input
- input
object
- eventId required
integer
: The ID of the Event to designate as seen.
- eventId required
Output
- output
object
getInvoices
Returns a paginated list of Invoices against your Account.
linode.getInvoices({}, context)
Input
- input
object
- page
integer
: The page of a collection to return. - page_size
integer
: The number of items to return per page.
- page
Output
- output
object
- data
array
- items Invoice
- page PaginationEnvelope/properties/page
- pages PaginationEnvelope/properties/pages
- results PaginationEnvelope/properties/results
- data
getInvoice
Returns a single Invoice object.
linode.getInvoice({
"invoiceId": 0
}, context)
Input
- input
object
- invoiceId required
integer
: The ID of the Invoice.
- invoiceId required
Output
- output Invoice
getInvoiceItems
Returns a paginated list of Invoice items.
linode.getInvoiceItems({
"invoiceId": 0
}, context)
Input
- input
object
- page
integer
: The page of a collection to return. - page_size
integer
: The number of items to return per page. - invoiceId required
integer
: The ID of the Invoice.
- page
Output
- output
object
- data
array
- items InvoiceItem
- page PaginationEnvelope/properties/page
- pages PaginationEnvelope/properties/pages
- results PaginationEnvelope/properties/results
- data
getNotifications
Returns a collection of Notification objects representing important, often time-sensitive items related to your Account. You cannot interact directly with Notifications, and a Notification will disappear when the circumstances causing it have been resolved. For example, if you have an important Ticket open, you must respond to the Ticket to dismiss the Notification.
linode.getNotifications(null, context)
Input
This action has no parameters
Output
- output
object
- data
array
- items Notification
- page PaginationEnvelope/properties/page
- pages PaginationEnvelope/properties/pages
- results PaginationEnvelope/properties/results
- data
getClients
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.getClients({}, context)
Input
- input
object
- page
integer
: The page of a collection to return. - page_size
integer
: The number of items to return per page.
- page
Output
- output
object
- data
array
- items OAuthClient
- page PaginationEnvelope/properties/page
- pages PaginationEnvelope/properties/pages
- results PaginationEnvelope/properties/results
- data
createClient
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.createClient({}, context)
Input
- input
object
- body
- public
boolean
: Whether to create a public or private client. - id
string
: The OAuth Client ID. This is used to identify the client, and is a publicly-known value (it is not a secret). - label
string
: The name of this application. This will be presented to users when they are asked to grant it access to their Account. - public
boolean
: If this is a public or private OAuth Client. Public clients have a slightly different authentication workflow than private clients. See the OAuth spec for more details. - redirect_uri
string
: The location a successful log in from https://login.linode.com should be redirected to for this client. The receiver of this redirect should be ready to accept an OAuth exchange code and finish the OAuth exchange. - secret
string
: The OAuth Client secret, used in the OAuth exchange. This is returned as<REDACTED>
except when an OAuth Client is created or its secret is reset. This is a secret, and should not be shared or disclosed publicly. - status
string
(values: active, disabled, suspended): The status of this application.active
by default. - thumbnail_url
string
: The URL where this client's thumbnail may be viewed, ornull
if this client does not have a thumbnail set. - public
boolean
: Whether to create a public or private client.
- public
- body
Output
- output OAuthClient
deleteClient
Deletes an OAuth Client registered with Linode. The Client ID and Client secret will no longer be accepted by https://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.deleteClient({
"clientId": ""
}, context)
Input
- input
object
- clientId required
string
: The OAuth Client ID to look up.
- clientId required
Output
- output
object
getClient
Returns information about a single OAuth client.
linode.getClient({
"clientId": ""
}, context)
Input
- input
object
- clientId required
string
: The OAuth Client ID to look up.
- clientId required
Output
- output OAuthClient
updateClient
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.updateClient({
"clientId": ""
}, context)
Input
- input
object
- body OAuthClient
- clientId required
string
: The OAuth Client ID to look up.
Output
- output OAuthClient
resetClientSecret
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.resetClientSecret({
"clientId": ""
}, context)
Input
- input
object
- clientId required
string
: The OAuth Client ID to look up.
- clientId required
Output
- output OAuthClient
getClientThumbnail
Returns the thumbnail for this OAuth Client. This is a publicly-viewable endpoint, and can be accessed without authentication.
linode.getClientThumbnail({
"clientId": ""
}, context)
Input
- input
object
- clientId required
string
: The OAuth Client ID to look up.
- clientId required
Output
- output
string
setClientThumbnail
Upload a thumbnail for a client you own. You must upload an image file that will be returned when the thumbnail is retrieved. This image will be publicly-viewable.
linode.setClientThumbnail({
"body": "",
"clientId": ""
}, context)
Input
- input
object
- body required
string
- clientId required
string
: The OAuth Client ID to look up.
- body required
Output
- output
object
getPayments
Returns a paginated list of Payments made on this Account.
linode.getPayments({}, context)
Input
- input
object
- page
integer
: The page of a collection to return. - page_size
integer
: The number of items to return per page.
- page
Output
- output
object
- data
array
- items Payment
- page PaginationEnvelope/properties/page
- pages PaginationEnvelope/properties/pages
- results PaginationEnvelope/properties/results
- data
createPayment
Makes a Payment to your Account via credit card. This will charge your credit card the requested amount.
linode.createPayment({
"body": {
"usd": ""
}
}, context)
Input
- input
object
- body required PaymentRequest
Output
- output Payment
createPayPalPayment
This begins the process of submitting a Payment via PayPal. After calling this endpoint, you must take the resulting payment_id
along with the payer_id
from your PayPal account and POST /account/payments/paypal-execute to complete the Payment.
linode.createPayPalPayment({
"body": {
"cancel_url": "",
"redirect_url": "",
"usd": ""
}
}, context)
Input
- input
object
- body required PayPal
Output
- output
object
- checkout_token
string
: The checkout token generated for this Payment. - payment_id
string
: The paypal-generated ID for this Payment. Used when authorizing the Payment in PayPal's interface.
- checkout_token
executePayPalPayment
Given a PaymentID and PayerID - as generated by PayPal during the transaction authorization process - this endpoint executes the Payment to capture the funds and credit your Linode Account.
linode.executePayPalPayment({
"body": {
"payer_id": "",
"payment_id": ""
}
}, context)
Input
- input
object
- body required PayPalExecute
Output
- output
object
getPayment
Returns information about a specific Payment.
linode.getPayment({
"paymentId": 0
}, context)
Input
- input
object
- paymentId required
integer
: The ID of the Payment to look up.
- paymentId required
Output
- output Payment
getAccountSettings
Returns information related to your Account settings: Managed service subscription, Longview subscription, and network helper.
linode.getAccountSettings(null, context)
Input
This action has no parameters
Output
- output AccountSettings
updateAccountSettings
Updates your Account settings.
linode.updateAccountSettings({
"body": {}
}, context)
Input
- input
object
- body required AccountSettings
Output
- output AccountSettings
enableAccountManged
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.enableAccountManged(null, context)
Input
This action has no parameters
Output
- output
object
getTransfer
Returns a Transfer object showing your network utilization, in GB, for the current month.
linode.getTransfer(null, context)
Input
This action has no parameters
Output
- output Transfer
getUsers
Returns a paginated list of Users on your Account. Users may access all or part of your Account based on their restricted status and grants. An unrestricted User may access everything on the account, whereas restricted User may only access entities or perform actions they've been given specific grants to.
linode.getUsers({}, context)
Input
- input
object
- page
integer
: The page of a collection to return. - page_size
integer
: The number of items to return per page.
- page
Output
- output
object
- data
array
- items User
- page PaginationEnvelope/properties/page
- pages PaginationEnvelope/properties/pages
- results PaginationEnvelope/properties/results
- data
createUser
Creates a User on your Account. Once created, the User will be able to log in and access portions of your Account. Access is determined by whether or not they are restricted, and what grants they have been given.
linode.createUser({}, context)
Input
- input
object
- body
object
- email required
string
: The new User's email address. - restricted
boolean
: If true, the new User must be granted access to perform actions or access entities on this Account. See /account/users/{username}/grants for details on how to configure grants for a restricted User. - username required
string
: The new User's username. This is used for logging in, and may also be displayed alongside actions the User performs (for example, in Events or public StackScripts).
- email required
- body
Output
- output User
deleteUser
Deletes a User. The deleted User will be immediately logged out and may no longer log in or perform any actions. All of the User's Grants will be removed.
linode.deleteUser({
"username": ""
}, context)
Input
- input
object
- username required
string
: The username to look up.
- username required
Output
- output
object
getUser
Returns information about a single User on your Account.
linode.getUser({
"username": ""
}, context)
Input
- input
object
- username required
string
: The username to look up.
- username required
Output
- output User
updateUser
Update information about a User on your Account. This can be used to change the restricted status of a User. When making a User restricted, no grants will be configured by default and you must then set up grants in order for the User to access anything on the Account.
linode.updateUser({
"username": ""
}, context)
Input
- input
object
- body User
- username required
string
: The username to look up.
Output
- output User
getUserGrants
Returns the full grants structure for this User. This includes all entities on the Account alongside what level of access this User has to each of them. Individual users may view their own grants at the /profile/grants endpoint, but will not see entities that they have no access to.
linode.getUserGrants({
"username": ""
}, context)
Input
- input
object
- username required
string
: The username to look up.
- username required
Output
- output GrantsResponse
updateUserGrants
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 do not need to include the grant for every entity on the Account in this request; any that are not included will remain unchanged.
linode.updateUserGrants({
"body": {},
"username": ""
}, context)
Input
- input
object
- body required GrantsResponse
- username required
string
: The username to look up.
Output
- output GrantsResponse
getDomains
This is a collection of Domains that you have registered in Linode's DNS Manager. Linode is not a registrar, and in order for these to work you must own the domains and point your registrar at Linode's nameservers.
linode.getDomains({}, context)
Input
- input
object
- page
integer
: The page of a collection to return. - page_size
integer
: The number of items to return per page.
- page
Output
- output
object
- data
array
- items Domain
- page PaginationEnvelope/properties/page
- pages PaginationEnvelope/properties/pages
- results PaginationEnvelope/properties/results
- data
createDomain
Adds a new Domain to Linode's DNS Manager. Linode is not a registrar, and you must own the domain before adding it here. Be sure to point your registrar to Linode's nameservers so that the records hosted here are used.
linode.createDomain({
"body": {
"id": 0,
"domain": "",
"type": ""
}
}, context)
Input
- input
object
- body required Domain
Output
- output Domain
importDomain
Imports a domain zone from a remote nameserver. Your nameserver must allow zone transfers (AXFR) from the following IPs:
- 96.126.114.97
- 96.126.114.98
- 2600:3c00::5e
- 2600:3c00::5f
linode.importDomain({}, context)
Input
- input
object
- body
- domain
string
: The domain to import. - remote_nameserver
string
: The remote nameserver that allows zone transfers (AXFR).
- domain
- body
Output
- output Domain
deleteDomain
Deletes a Domain from Linode's DNS Manager. The Domain will be removed from Linode's nameservers shortly after this operation completes. This also deletes all associated Domain Records.
linode.deleteDomain({
"domainId": 0
}, context)
Input
- input
object
- domainId required
integer
: The ID of the Domain to access.
- domainId required
Output
- output
object
getDomain
This is a single Domain that you have registered in Linode's DNS Manager. Linode is not a registrar, and in order for this Domain record to work you must own the domain and point your registrar at Linode's nameservers.
linode.getDomain({
"domainId": 0
}, context)
Input
- input
object
- domainId required
integer
: The ID of the Domain to access.
- domainId required
Output
- output Domain
updateDomain
Update information about a Domain in Linode's DNS Manager.
linode.updateDomain({
"body": {
"id": 0,
"domain": "",
"type": ""
},
"domainId": 0
}, context)
Input
- input
object
- body required Domain
- domainId required
integer
: The ID of the Domain to access.
Output
- output Domain
cloneDomain
Clones a Domain and all associated DNS records from a Domain that is registered in Linode's DNS manager.
linode.cloneDomain({
"body": {
"domain": ""
},
"domainId": ""
}, context)
Input
- input
object
- body required
object
- domain required
string
: The new domain being created.
- domain required
- domainId required
string
: ID of the Domain to clone.
- body required
Output
- output Domain
getDomainRecords
Returns a paginated list of Records configured on a Domain in Linode's DNS Manager.
linode.getDomainRecords({
"domainId": 0
}, context)
Input
- input
object
- page
integer
: The page of a collection to return. - page_size
integer
: The number of items to return per page. - domainId required
integer
: The ID of the Domain we are accessing Records for.
- page
Output
- output
object
- data
array
- items DomainRecord
- page PaginationEnvelope/properties/page
- pages PaginationEnvelope/properties/pages
- results PaginationEnvelope/properties/results
- data
createDomainRecord
Adds a new Domain Record to the zonefile this Domain represents.
linode.createDomainRecord({
"body": null,
"domainId": 0
}, context)
Input
- input
object
- body required
- id
integer
: This Record's unique ID. - name
string
: The name of this Record. This field's actual usage depends on the type of record this represents. For A and AAAA records, this is the subdomain being associated with an IP address. - port
integer
: The port this Record points to. - priority
integer
: The priority of the target host. Lower values are preferred. - protocol
string
: The protocol this Record's service communicates with. Only valid for SRV records. - service
string
: The service this Record identified. Only valid for SRV records. - tag
string
: The tag portion of a CAA record. It is invalid to set this on other record types. - target
string
: The target for this Record. This field's actual usage depends on the type of record this represents. For A and AAAA records, this is the address the named Domain should resolve to. - ttl_sec
integer
: "Time to Live" - the amount of time in seconds that this Domain's records may be cached by resolvers or other domain servers. Valid values are 300, 3600, 7200, 14400, 28800, 57600, 86400, 172800, 345600, 604800, 1209600, and 2419200 - any other value will be rounded to the nearest valid value. - type
string
(values: A, AAAA, NS, MX, CNAME, TXT, SRV, PTR, CAA): The type of Record this is in the DNS system. For example, A records associate a domain name with an IPv4 address, and AAAA records associate a domain name with an IPv6 address. - weight
integer
: The relative weight of this Record. Higher values are preferred.
- id
- domainId required
integer
: The ID of the Domain we are accessing Records for.
- body required
Output
- output DomainRecord
deleteDomainRecord
Deletes a Record on this Domain.
linode.deleteDomainRecord({
"domainId": 0,
"recordId": 0
}, context)
Input
- input
object
- domainId required
integer
: The ID of the Domain whose Record you are accessing. - recordId required
integer
: The ID of the Record you are accessing.
- domainId required
Output
- output
object
getDomainRecord
View a single Record on this Domain.
linode.getDomainRecord({
"domainId": 0,
"recordId": 0
}, context)
Input
- input
object
- domainId required
integer
: The ID of the Domain whose Record you are accessing. - recordId required
integer
: The ID of the Record you are accessing.
- domainId required
Output
- output DomainRecord
updateDomainRecord
Updates a single Record on this Domain.
linode.updateDomainRecord({
"body": {},
"domainId": 0,
"recordId": 0
}, context)
Input
- input
object
- body required DomainRecord
- domainId required
integer
: The ID of the Domain whose Record you are accessing. - recordId required
integer
: The ID of the Record you are accessing.
Output
- output DomainRecord
getImages
Returns a paginated list of Images.
- Calling this endpoint without authentication returns all public Images.
- Authentication is required to return a combined paginated list of all public and your private Images.
linode.getImages({}, context)
Input
- input
object
- page
integer
: The page of a collection to return. - page_size
integer
: The number of items to return per page.
- page
Output
- output
object
- data
array
- items ImagePublic
- page PaginationEnvelope/properties/page
- pages PaginationEnvelope/properties/pages
- results PaginationEnvelope/properties/results
- data
createImage
Creates a private gold-master Image from a Linode Disk. There is no additional charge to store Images for Linode users. Images are limited to three per Account.
linode.createImage({}, context)
Input
- input
object
- body
- created
string
: When this Image was created. - created_by
string
: The name of the User who created this Image. - deprecated
boolean
: Whether or not this Image is deprecated. Will only be True for deprecated public Images. - description
string
: A detailed description of this Image. - expiry
string
: Only Images created automatically (from a deleted Linode; type=automatic) will expire. - id
string
: The unique ID of this Image. - is_public
boolean
: True if the Image is public. - label
string
: A short description of the Image. Labels cannot contain special characters. - size
integer
: The minimum size this Image needs to deploy. Size is in MB. - type
string
(values: manual, automatic): How the Image was created. "Manual" Images can be created at any time. "Automatic" images are created automatically from a deleted Linode. - vendor
string
: The upstream distribution vendor.None
for private Images. - description
string
: A detailed description of this Image. - disk_id
integer
: The ID of the Linode Disk that this Image will be created from. - label
string
: A short title of this Image. Defaults to the label of the Disk it is being created from if not provided.
- created
- body
Output
- output ImagePrivate
deleteImage
Deletes a private Image you have permission to read_write
.
Deleting an Image is a destructive action and cannot be undone.
linode.deleteImage({
"imageId": ""
}, context)
Input
- input
object
- imageId required
string
: ID of the Image to look up.
- imageId required
Output
- output
object
getImage
Get information about a single Image.
linode.getImage({
"imageId": ""
}, context)
Input
- input
object
- imageId required
string
: ID of the Image to look up.
- imageId required
Output
- output ImagePrivate
updateImage
Updates a private Image that you have permission to read_write
.
linode.updateImage({
"body": {},
"imageId": ""
}, context)
Input
- input
object
- body required ImagePrivate
- imageId required
string
: ID of the Image to look up.
Output
- output ImagePrivate
getLinodeInstances
Returns a paginated list of Linodes you have permission to view.
linode.getLinodeInstances({}, context)
Input
- input
object
- page
integer
: The page of a collection to return. - page_size
integer
: The number of items to return per page.
- page
Output
- output
object
- data
array
- items Linode
- page PaginationEnvelope/properties/page
- pages PaginationEnvelope/properties/pages
- results PaginationEnvelope/properties/results
- data
createLinodeInstance
Creates a Linode Instance on your Account. In order for this
request to complete successfully, your User must have the add_linodes
grant. Creating a
new Linode will incur a charge on your Account.
Linodes can be created using one of the available Types. See GET /linode/types to get more information about each Type's specs and cost.
Linodes can be created in any one of our available Regions for a list of available Regions you can deploy your Linode in.
Linodes can be created in a number of ways:
Using a Linode Linux Distribution image or an Image you created based on another Linode.
- The Linode will be
running
after it completesprovisioning
. - A default config with two Disks, one being a 512 swap disk, is created.
swap_size
can be used to customize the swap disk size.
- Requires a
root_pass
be supplied to use for the root User's Account. - It is recommended to supply SSH keys for the root User using the
authorized_keys
field. - You may also supply a list of usernames via the
authorized_users
field.- These users must have an SSH Key associated with your Profile first. See /profile/sshkeys for more information.
- The Linode will be
Using a StackScript.
- See /linode/stackscripts for a list of available StackScripts.
- The Linode will be
running
after it completesprovisioning
. - Requires a compatible Image to be supplied.
- See /linode/stackscript/{stackscriptId} for compatible Images.
- Requires a
root_pass
be supplied to use for the root User's Account. - It is recommended to supply SSH keys for the root User using the
authorized_keys
field. - You may also supply a list of usernames via the
authorized_users
field.- These users must have an SSH Key associated with your Profile first. See /profile/sshkeys for more information.
Using one of your other Linode's backups.
- You must create a Linode large enough to accommodate the Backup's size.
- The Disks and Config will match that of the Linode that was backed up.
- The
root_pass
will match that of the Linode that was backed up.
Create an empty Linode.
- The Linode will remain
offline
and must be manually started. - Disks and Configs must be created manually.
- This is only recommended for advanced use cases.
- The Linode will remain
Important: You must be an unrestricted User in order to add or modify tags on Linodes.
linode.createLinodeInstance({
"body": {
"type": "",
"region": ""
}
}, context)
Input
- input
object
- body required
object
- tags Linode/properties/tags
- authorized_keys
array
: A list of SSH public keys to deploy for the root user on the newly-created Linode. Only accepted ifimage
is provided.- items
string
- items
- authorized_users
array
: A list of usernames. If the usernames have associated SSH keys, the keys will be appended to the root users~/.ssh/authorized_keys
file automatically.- items
string
- items
- backup_id
integer
: A Backup ID from another Linode's available backups. Your User must have - backups_enabled
boolean
: If this field is set totrue
, the created Linode will automatically be - booted
boolean
: Whether to boot this Linode after the deploy is complete. Defaults to true ifimage
is provided. Not accepted if not deploying from an Image. - group Linode/properties/group
- image
string
: An Image ID to deploy the Disk from. Official Linode Images start withlinode/
, while your Images start withprivate/
. - label Linode/properties/label
- private_ip
boolean
: If true, the created Linode will have private networking enabled. - region required
string
: The Region where the Linode will be located. - root_pass DiskRequest/properties/root_pass
- stackscript_data
object
: An object containing responses to any User Defined Fields present in the StackScript being deployed to this Linode. Only accepted ifstackscript_id
is given. The required values depend on the StackScript being deployed. - stackscript_id
integer
: The StackScript to deploy to the newly-created Linode. If provided, "image" must also be provided, and must be an Image that is compatible with this StackScript. - swap_size
integer
: When deploying from an Image, this field is optional, otherwise it is ignored. This is used to set the swap disk size for the newly-created Linode. - type required
string
: The Linode Type of the Linode you are creating.
- body required
Output
- output Linode
deleteLinodeInstance
Deletes a Linode you have permission to read_write
.
Deleting a Linode is a destructive action and cannot be undone.
Additionally, deleting a Linode:
- Gives up any IP addresses the Linode was assigned.
- Deletes all Disks, Backups, Configs, etc.
- Stops billing for the Linode and its associated services. You will be billed for time used within the billing period the Linode was active.
linode.deleteLinodeInstance({
"linodeId": 0
}, context)
Input
- input
object
- linodeId required
integer
: ID of the Linode to look up
- linodeId required
Output
- output
object
getLinodeInstance
Get a specific Linode by ID.
linode.getLinodeInstance({
"linodeId": 0
}, context)
Input
- input
object
- linodeId required
integer
: ID of the Linode to look up
- linodeId required
Output
- output Linode
updateLinodeInstance
Updates a Linode that you have permission to read_write
.
Important: You must be an unrestricted User in order to add or modify tags on Linodes.
linode.updateLinodeInstance({
"body": {},
"linodeId": 0
}, context)
Input
- input
object
- body required Linode
- linodeId required
integer
: ID of the Linode to look up
Output
- output Linode
getBackups
Returns information about this Linode's available backups.
linode.getBackups({
"linodeId": 0
}, context)
Input
- input
object
- linodeId required
integer
: The ID of the Linode the backups belong to.
- linodeId required
Output
- output
object
- automatic
array
- items
- configs
array
: A list of the labels of the Configuration profiles that are part of the Backup.- items
string
- items
- created
string
: The date the Backup was taken. - disks
array
: A list of the disks that are part of the Backup.- items
object
- filesystem Disk/properties/filesystem
- label
string
- size
integer
- items
- finished
string
: The date the Backup completed. - id
integer
: The unique ID of this Backup. - label
string
: A label for Backups that are of typesnapshot
. - status
string
(values: paused, pending, running, needsPostProcessing, successful, failed, userAborted): The current state of a specific Backup. - type
string
(values: auto, snapshot): This indicates whether the Backup is an automatic Backup or manual snapshot taken by the User at a specific point in time. - updated
string
: The date the Backup was most recently updated. - type
string
- configs
- items
- snapshot
object
- automatic
createSnapshot
Creates a snapshot Backup of a Linode. ** If you already have a snapshot of this Linode, this is a destructive action. The previous snapshot will be deleted.**
linode.createSnapshot({
"body": {
"label": ""
},
"linodeId": 0
}, context)
Input
- input
object
- body required
object
- label required
string
- label required
- linodeId required
integer
: The ID of the Linode the backups belong to.
- body required
Output
- output Backup
cancelBackups
Cancels the Backup service on the given Linode. Deletes all of this Linode's existing backups forever.
linode.cancelBackups({
"linodeId": 0
}, context)
Input
- input
object
- linodeId required
integer
: The ID of the Linode to cancel backup service for.
- linodeId required
Output
- output
object
enableBackups
Enables backups for the specified Linode.
linode.enableBackups({
"linodeId": 0
}, context)
Input
- input
object
- linodeId required
integer
: The ID of the Linode to enable backup service for.
- linodeId required
Output
- output
object
getBackup
Returns information about a Backup.
linode.getBackup({
"linodeId": 0,
"backupId": 0
}, context)
Input
- input
object
- linodeId required
integer
: The ID of the Linode the Backup belongs to. - backupId required
integer
: The ID of the Backup to look up.
- linodeId required
Output
- output Backup
restoreBackup
Restores a Linode's Backup to the specified Linode.
linode.restoreBackup({
"body": {
"linode_id": 0
},
"linodeId": 0,
"backupId": 0
}, context)
Input
- input
object
- body required
object
- linode_id required
integer
: The ID of the Linode to restore a Backup to. - overwrite
boolean
: If True, deletes all Disks and Configs on the target Linode
- linode_id required
- linodeId required
integer
: The ID of the Linode that the Backup belongs to. - backupId required
integer
: The ID of the Backup to restore.
- body required
Output
- output
object
bootLinodeInstance
Boots a Linode you have permission to modify. If no parameters are given, a Config profile will be chosen for this boot based on the following criteria:
- If there is only one Config profile for this Linode, it will be used.
- If there is more than one Config profile, the last booted config will be used.
- If there is more than one Config profile and none were the last to be booted (because the Linode was never booted or the last booted config was deleted) an error will be returned.
linode.bootLinodeInstance({
"linodeId": 0
}, context)
Input
- input
object
- body
object
- config_id
integer
: The Linode Config ID to boot into. If omitted, we will attempt to select a config to use. (This will do the right thing in most cases.)
- config_id
- linodeId required
integer
: The ID of the Linode to boot.
- body
Output
- output
object
cloneLinodeInstance
You can clone your Linode's existing Disks or Configuration profiles to
another Linode on your Account. In order for this request to complete
successfully, your User must have the add_linodes
grant. Cloning to a
new Linode will incur a charge on your Account.
If cloning to an existing Linode, any actions currently running or queued must be completed first before you can clone to it.
Up to five clone operations from any given source Linode can be run concurrently. If more concurrent clones are attempted, an HTTP 400 error will be returned by this endpoint.
linode.cloneLinodeInstance({
"body": {},
"linodeId": 0
}, context)
Input
- input
object
- body required
object
- backups_enabled
boolean
: If this field is set totrue
, the created Linode will - configs
array
: An array of configuration profile IDs.- items
integer
- items
- disks
array
: An array of disk IDs.- items
integer
- items
- group
string
: A label used to group Linodes for display. Linodes are not required to have a group. - label
string
: The label to assign this Linode when cloning to a new Linode. - linode_id
integer
: If an existing Linode is to be the target for the clone, the ID of that Linode. The existing Linode must have enough resources to accept the clone. - region
string
: This is the Region where the Linode will be deployed. - type
string
: A Linode's Type determines what resources are available to
- backups_enabled
- linodeId required
integer
: ID of the Linode to clone.
- body required
Output
- output
object
getLinodeConfigs
Lists Configuration profiles associated with a Linode.
linode.getLinodeConfigs({
"linodeId": 0
}, context)
Input
- input
object
- page
integer
: The page of a collection to return. - page_size
integer
: The number of items to return per page. - linodeId required
integer
: ID of the Linode to look up Configuration profiles for.
- page
Output
- output
object
- data
array
- items LinodeConfig
- page PaginationEnvelope/properties/page
- pages PaginationEnvelope/properties/pages
- results PaginationEnvelope/properties/results
- data
addLinodeConfig
Adds a new Configuration profile to a Linode.
linode.addLinodeConfig({
"body": {
"label": "",
"devices": {}
},
"linodeId": 0
}, context)
Input
- input
object
- body required LinodeConfig
- linodeId required
integer
: ID of the Linode to look up Configuration profiles for.
Output
- output LinodeConfig
deleteLinodeConfig
Deletes the specified Configuration profile from the specified Linode.
linode.deleteLinodeConfig({
"linodeId": 0,
"configId": 0
}, context)
Input
- input
object
- linodeId required
integer
: The ID of the Linode whose Configuration profile to look up. - configId required
integer
: The ID of the Configuration profile to look up.
- linodeId required
Output
- output
object
getLinodeConfig
Returns information about a specific Configuration profile.
linode.getLinodeConfig({
"linodeId": 0,
"configId": 0
}, context)
Input
- input
object
- linodeId required
integer
: The ID of the Linode whose Configuration profile to look up. - configId required
integer
: The ID of the Configuration profile to look up.
- linodeId required
Output
- output LinodeConfig
updateLinodeConfig
Updates a Configuration profile.
linode.updateLinodeConfig({
"body": null,
"linodeId": 0,
"configId": 0
}, context)
Input
- input
object
- body required
object
- comments LinodeConfig/properties/comments
- devices required
object
: A dictionary of device disks to use as a device map in a Linode's configuration profile. - helpers LinodeConfig/properties/helpers
- id LinodeConfig/properties/id
- kernel LinodeConfig/properties/kernel
- label required LinodeConfig/properties/label
- memory_limit LinodeConfig/properties/memory_limit
- root_device
string
: The root device to boot. - run_level LinodeConfig/properties/run_level
- virt_mode LinodeConfig/properties/virt_mode
- linodeId required
integer
: The ID of the Linode whose Configuration profile to look up. - configId required
integer
: The ID of the Configuration profile to look up.
- body required
Output
- output LinodeConfig
getLinodeDisks
View Disk information for Disks associated with this Linode.
linode.getLinodeDisks({
"linodeId": 0
}, context)
Input
- input
object
- page
integer
: The page of a collection to return. - page_size
integer
: The number of items to return per page. - linodeId required
integer
: ID of the Linode to look up.
- page
Output
- output
object
- data
array
- items Disk
- page PaginationEnvelope/properties/page
- pages PaginationEnvelope/properties/pages
- results PaginationEnvelope/properties/results
- data
addLinodeDisk
Adds a new Disk to a Linode. You can optionally create a Disk from an Image (see /images for a list of available public images, or use one of your own), and optionally provide a StackScript to deploy with this Disk.
linode.addLinodeDisk({
"body": {
"size": 0,
"label": ""
},
"linodeId": 0
}, context)
Input
- input
object
- body required DiskRequest
- linodeId required
integer
: ID of the Linode to look up.
Output
- output Disk
deleteDisk
Deletes a Disk you have permission to read_write
.
Deleting a Disk is a destructive action and cannot be undone.
linode.deleteDisk({
"linodeId": 0,
"diskId": 0
}, context)
Input
- input
object
- linodeId required
integer
: ID of the Linode to look up. - diskId required
integer
: ID of the Disk to look up.
- linodeId required
Output
- output
object
getLinodeDisk
View Disk information for a Disk associated with this Linode.
linode.getLinodeDisk({
"linodeId": 0,
"diskId": 0
}, context)
Input
- input
object
- linodeId required
integer
: ID of the Linode to look up. - diskId required
integer
: ID of the Disk to look up.
- linodeId required
Output
- output Disk
updateDisk
Updates a Disk that you have permission to read_write
.
linode.updateDisk({
"body": {},
"linodeId": 0,
"diskId": 0
}, context)
Input
- input
object
- body required Disk
- linodeId required
integer
: ID of the Linode to look up. - diskId required
integer
: ID of the Disk to look up.
Output
- output Disk
cloneLinodeDisk
Copies a disk, byte-for-byte, into a new Disk belonging to the same Linode. The Linode must have enough storage space available to accept a new Disk of the same size as this one or this operation will fail.
linode.cloneLinodeDisk({
"linodeId": 0,
"diskId": 0
}, context)
Input
- input
object
- linodeId required
integer
: ID of the Linode to look up. - diskId required
integer
: ID of the Disk to clone.
- linodeId required
Output
- output Disk
resetDiskPassword
Resets the password of a Disk you have permission to read_write
.
linode.resetDiskPassword({
"body": null,
"linodeId": 0,
"diskId": 0
}, context)
Input
- input
object
- body required
object
- password required
string
: The new root password for the OS installed on this Disk.
- password required
- linodeId required
integer
: ID of the Linode to look up. - diskId required
integer
: ID of the Disk to look up.
- body required
Output
- output
object
resizeDisk
Resizes a Disk you have permission to read_write
.
The Linode this Disk is attached to must be shut down for resizing to take effect.
If you are resizing the Disk to a smaller size, it cannot be made smaller than what is required by the total size of the files current on the Disk. The Disk must not be in use. If the Disk is in use, the request will succeed but the resize will ultimately fail.
linode.resizeDisk({
"body": null,
"linodeId": 0,
"diskId": 0
}, context)
Input
- input
object
- body required
object
- size
integer
: The desired size, in MB, of the disk.
- size
- linodeId required
integer
: ID of the Linode to look up. - diskId required
integer
: ID of the Disk to look up.
- body required
Output
- output
object
getLinodeIPs
Returns networking information for a single Linode.
linode.getLinodeIPs({
"linodeId": 0
}, context)
Input
- input
object
- linodeId required
integer
: ID of the Linode to look up.
- linodeId required
Output
- output
object
- ipv4
object
: Information about this Linode's IPv4 addresses.- private
array
: A list of private IP Address objects belonging to this Linode.- items IPAddressPrivate
- public
array
: A list of public IP Address objects belonging to this Linode.- items IPAddress
- reserved
array
: A list of reserved IP Address objects belonging to this Linode.- items IPAddress
- shared
array
: A list of shared IP Address objects assigned to this Linode.- items IPAddress
- private
- ipv6
object
: Information about this Linode's IPv6 addresses.- global IPv6Pool
- link_local IPAddressV6LinkLocal
- slaac IPAddressV6Slaac
- ipv4
addLinodeIP
Allocates a public or private IPv4 address to a Linode. Public IP Addresses, after the one included with each Linode, incur an additional monthly charge. If you need an additional public IP Address you must request one - please open a support ticket. You may not add more than one private IPv4 address to a single Linode.
linode.addLinodeIP({
"body": null,
"linodeId": 0
}, context)
Input
- input
object
- body required
object
- public required
boolean
: Whether to create a public or private IPv4 address. - type required
string
(values: ipv4): The type of address you are allocating. Only IPv4 addresses may be allocated through this endpoint.
- public required
- linodeId required
integer
: ID of the Linode to look up.
- body required
Output
- output IPAddress
removeLinodeIP
Deletes a public IPv4 address associated with this Linode. This will fail if it is the Linode's last remaining public IPv4 address. Private IPv4 addresses cannot be removed via this endpoint.
linode.removeLinodeIP({
"linodeId": 0,
"address": ""
}, context)
Input
- input
object
- linodeId required
integer
: The ID of the Linode to look up. - address required
string
: The IP address to look up.
- linodeId required
Output
- output
object
getLinodeIP
View information about the specified IP address associated with the specified Linode.
linode.getLinodeIP({
"linodeId": 0,
"address": ""
}, context)
Input
- input
object
- linodeId required
integer
: The ID of the Linode to look up. - address required
string
: The IP address to look up.
- linodeId required
Output
- output IPAddress
updateLinodeIP
Updates a particular IP Address associated with this Linode. Only allows setting/resetting revers