Skip to content

Latest commit

 

History

History
83 lines (65 loc) · 3.17 KB

api_request.md

File metadata and controls

83 lines (65 loc) · 3.17 KB

api_request

Make an arbitrary Linode API request.

The Linode API documentation can be found here: https://techdocs.akamai.com/linode-api/reference

Minimum Required Fields

Field Type Required Description
api_token str Required The Linode account personal access token. It is necessary to run the module.
It can be exposed by the environment variable LINODE_API_TOKEN instead.
See details in Usage.

Examples

- name: Get all available LKE versions
  linode.cloud.api_request:
    path: lke/versions
    method: GET
- name: Manually create a domain
  linode.cloud.api_request:
    path: domains
    method: POST
    body:
      domain: my-domain.com
      type: master
      soa_email: [email protected]

Parameters

Field Type Required Description
path str Required The relative path to the endpoint to make a request to. e.g. "linode/instances"
method str Required The HTTP method of the request or response. (Choices: POST, PUT, GET, DELETE)
body dict Optional The body of the request. This is a YAML structure that will be marshalled to JSON. (Conflicts With: body_json)
body_json str Optional The body of the request in JSON format. (Conflicts With: body)
filters dict Optional A YAML structure corresponding to the X-Filter request header. See: https://techdocs.akamai.com/linode-api/reference

Return Values

  • body - The deserialized response body.

    • Sample Response:
      {
        "axfr_ips": [],
        "description": null,
        "domain": "example.org",
        "expire_sec": 300,
        "group": null,
        "id": 1234,
        "master_ips": [],
        "refresh_sec": 300,
        "retry_sec": 300,
        "soa_email": "[email protected]",
        "status": "active",
        "tags": [
          "example tag",
          "another example"
        ],
        "ttl_sec": 300,
        "type": "master"
      }
  • status - The response status code.

    • Sample Response:
      200