Skip to content
This repository has been archived by the owner on Jan 21, 2020. It is now read-only.

Latest commit

 

History

History
146 lines (118 loc) · 2.72 KB

instance.md

File metadata and controls

146 lines (118 loc) · 2.72 KB

Instance plugin API

API

Method Instance.Validate

Checks whether an instance configuration is valid. Must be free of side-effects.

Request

{
  "Properties": {}
}

Parameters:

  • Properties: A JSON object representing the Instance. The schema is defined by the Instance plugin in use.

Response

{
  "OK": true
}

Fields:

  • OK: Whether the operation succeeded.

Method Instance.Provision

Provisions a new instance.

Request

{
  "Spec": {
    "Properties": {},
    "Tags": {"tag_key": "tag_value"},
    "Init": "",
    "LogicalID": "logical_id",
    "Attachments": [{"ID": "attachment_id", "Type": "block-device"}]
  }
}

Parameters:

Response

{
  "ID": "instance_id"
}

Fields:

Method Instance.Destroy

Permanently destroys an instance.

Request

{
  "Instance": "instance_id",
  "Context" : {
    "Reason" : "rolling_update"
  }
}

Parameters:

Response

{
  "OK": true
}

Fields:

  • OK: Whether the operation succeeded.

Method Instance.Label

Labels an instance. The plugin should add or update the labels given.

Request

{
  "Instance": "instance_id",
  "Labels" : {
     "label1" : "value1",
     "label2" : "value2",
     "label3" : "value3"
  }
}

Parameters:

Response

{
  "OK": true
}

Fields:

  • OK: Whether the operation succeeded.

Method Instance.DescribeInstances

Fetches details about Instances.

Request

{
  "Tags": {"tag_key": "tag_value"},
  "Properties" : true
}

Parameters:

  • Tags: Instance tags to match. If multiple tags are specified, only Instances matching all tags are returned.
  • Properties: Boolean to indicate whether the client requests additional details via the Description.Properties field.

Response

{
  "Descriptions": [
    {
      "ID": "instance_id",
      "LogicalID": "logical_id",
      "Tags": {"tag_key": "tag_value"},
      "Properties" : { "some_status" : "ok", "some_state" : 10 }
    }
  ]
}

Fields: