tcec2manager

package
v0.0.0-...-a5b7ecb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 11, 2019 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Overview

A taskcluster service which manages EC2 instances. This service does not understand any taskcluster concepts intrinsicaly other than using the name `workerType` to refer to a group of associated instances. Unless you are working on building a provisioner for AWS, you almost certainly do not want to use this service

See: https://docs.taskcluster.net/reference/core/ec2-manager/api-docs

How to use this package

First create an EC2Manager object:

eC2Manager := tcec2manager.New(nil)

and then call one or more of eC2Manager's methods, e.g.:

data, err := eC2Manager.ListWorkerTypes(.....)

handling any errors...

if err != nil {
	// handle error...
}

Taskcluster Schema

The source code of this go package was auto-generated from the API definition at https://references.taskcluster.net/ec2-manager/v1/api.json together with the input and output schemas it references, downloaded on Mon, 7 May 2018 at 13:22:00 UTC. The code was generated by https://github.com/taskcluster/taskcluster-client-go/blob/master/build.sh.

Index

Constants

View Source
const (
	DefaultBaseURL = "localhost:5555/v1"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EC2Manager

type EC2Manager tcclient.Client

func New

func New(credentials *tcclient.Credentials) *EC2Manager

New returns an EC2Manager client, configured to run against production. Pass in nil to create a client without authentication. The returned client is mutable, so returned settings can be altered.

eC2Manager := tcec2manager.New(nil)                              // client without authentication
eC2Manager.BaseURL = "http://localhost:1234/api/EC2Manager/v1"   // alternative API endpoint (production by default)
data, err := eC2Manager.ListWorkerTypes(.....)                   // for example, call the ListWorkerTypes(.....) API endpoint (described further down)...
if err != nil {
	// handle errors...
}

func NewFromEnv

func NewFromEnv() *EC2Manager

NewFromEnv returns an EC2Manager client with credentials taken from the environment variables:

TASKCLUSTER_CLIENT_ID
TASKCLUSTER_ACCESS_TOKEN
TASKCLUSTER_CERTIFICATE

If environment variables TASKCLUSTER_CLIENT_ID is empty string or undefined authentication will be disabled.

func (*EC2Manager) APIReference

func (eC2Manager *EC2Manager) APIReference() error

Stability: *** EXPERIMENTAL ***

Generate an API reference for this service

See https://docs.taskcluster.net/reference/core/ec2-manager/api-docs#apiReference

func (*EC2Manager) AllState

func (eC2Manager *EC2Manager) AllState() error

Stability: *** EXPERIMENTAL ***

This method is only for debugging the ec2-manager

Required scopes:

ec2-manager:internals

See https://docs.taskcluster.net/reference/core/ec2-manager/api-docs#allState

func (*EC2Manager) AllState_SignedURL

func (eC2Manager *EC2Manager) AllState_SignedURL(duration time.Duration) (*url.URL, error)

Returns a signed URL for AllState, valid for the specified duration.

Required scopes:

ec2-manager:internals

See AllState for more details.

func (*EC2Manager) AmiUsage

func (eC2Manager *EC2Manager) AmiUsage() error

Stability: *** EXPERIMENTAL ***

List AMIs and their usage by returning a list of objects in the form: { region: string

  volumetype: string
  lastused: timestamp
}

Required scopes:

ec2-manager:internals

See https://docs.taskcluster.net/reference/core/ec2-manager/api-docs#amiUsage

func (*EC2Manager) AmiUsage_SignedURL

func (eC2Manager *EC2Manager) AmiUsage_SignedURL(duration time.Duration) (*url.URL, error)

Returns a signed URL for AmiUsage, valid for the specified duration.

Required scopes:

ec2-manager:internals

See AmiUsage for more details.

func (*EC2Manager) DbpoolStats

func (eC2Manager *EC2Manager) DbpoolStats() error

Stability: *** EXPERIMENTAL ***

This method is only for debugging the ec2-manager

Required scopes:

ec2-manager:internals

See https://docs.taskcluster.net/reference/core/ec2-manager/api-docs#dbpoolStats

func (*EC2Manager) DbpoolStats_SignedURL

func (eC2Manager *EC2Manager) DbpoolStats_SignedURL(duration time.Duration) (*url.URL, error)

Returns a signed URL for DbpoolStats, valid for the specified duration.

Required scopes:

ec2-manager:internals

See DbpoolStats for more details.

func (*EC2Manager) EbsUsage

func (eC2Manager *EC2Manager) EbsUsage() error

Stability: *** EXPERIMENTAL ***

Lists current EBS volume usage by returning a list of objects that are uniquely defined by {region, volumetype, state} in the form: { region: string,

  volumetype: string,
  state: string,
  totalcount: integer,
  totalgb: integer,
  touched: timestamp (last time that information was updated),
}

Required scopes:

ec2-manager:internals

See https://docs.taskcluster.net/reference/core/ec2-manager/api-docs#ebsUsage

func (*EC2Manager) EbsUsage_SignedURL

func (eC2Manager *EC2Manager) EbsUsage_SignedURL(duration time.Duration) (*url.URL, error)

Returns a signed URL for EbsUsage, valid for the specified duration.

Required scopes:

ec2-manager:internals

See EbsUsage for more details.

func (*EC2Manager) EnsureKeyPair

func (eC2Manager *EC2Manager) EnsureKeyPair(name string, payload *SSHPublicKey) error

Stability: *** EXPERIMENTAL ***

Idempotently ensure that a keypair of a given name exists

Required scopes:

ec2-manager:manage-key-pairs:<name>

See https://docs.taskcluster.net/reference/core/ec2-manager/api-docs#ensureKeyPair

func (*EC2Manager) EnsureKeyPair_SignedURL

func (eC2Manager *EC2Manager) EnsureKeyPair_SignedURL(name string, duration time.Duration) (*url.URL, error)

Returns a signed URL for EnsureKeyPair, valid for the specified duration.

Required scopes:

ec2-manager:manage-key-pairs:<name>

See EnsureKeyPair for more details.

func (*EC2Manager) GetHealth

func (eC2Manager *EC2Manager) GetHealth() (*HealthOfTheEC2Account, error)

Stability: *** EXPERIMENTAL ***

Give some basic stats on the health of our EC2 account

See https://docs.taskcluster.net/reference/core/ec2-manager/api-docs#getHealth

func (*EC2Manager) GetPrices

func (eC2Manager *EC2Manager) GetPrices() (*ListOfPrices, error)

Stability: *** EXPERIMENTAL ***

Return a list of possible prices for EC2

See https://docs.taskcluster.net/reference/core/ec2-manager/api-docs#getPrices

func (*EC2Manager) GetRecentErrors

func (eC2Manager *EC2Manager) GetRecentErrors() (*Errors, error)

Stability: *** EXPERIMENTAL ***

Return a list of recent errors encountered

See https://docs.taskcluster.net/reference/core/ec2-manager/api-docs#getRecentErrors

func (*EC2Manager) GetSpecificPrices

func (eC2Manager *EC2Manager) GetSpecificPrices(payload *ListOfRestrictionsForPrices) (*ListOfPrices, error)

Stability: *** EXPERIMENTAL ***

Return a list of possible prices for EC2

See https://docs.taskcluster.net/reference/core/ec2-manager/api-docs#getSpecificPrices

func (*EC2Manager) ListWorkerTypes

func (eC2Manager *EC2Manager) ListWorkerTypes() (*ListOfWorkerTypes, error)

Stability: *** EXPERIMENTAL ***

This method is only for debugging the ec2-manager

See https://docs.taskcluster.net/reference/core/ec2-manager/api-docs#listWorkerTypes

func (*EC2Manager) Ping

func (eC2Manager *EC2Manager) Ping() error

Respond without doing anything. This endpoint is used to check that the service is up.

See https://docs.taskcluster.net/reference/core/ec2-manager/api-docs#ping

func (*EC2Manager) PurgeQueues

func (eC2Manager *EC2Manager) PurgeQueues() error

Stability: *** EXPERIMENTAL ***

This method is only for debugging the ec2-manager

Required scopes:

ec2-manager:internals

See https://docs.taskcluster.net/reference/core/ec2-manager/api-docs#purgeQueues

func (*EC2Manager) PurgeQueues_SignedURL

func (eC2Manager *EC2Manager) PurgeQueues_SignedURL(duration time.Duration) (*url.URL, error)

Returns a signed URL for PurgeQueues, valid for the specified duration.

Required scopes:

ec2-manager:internals

See PurgeQueues for more details.

func (*EC2Manager) Regions

func (eC2Manager *EC2Manager) Regions() error

Stability: *** EXPERIMENTAL ***

This method is only for debugging the ec2-manager

Required scopes:

ec2-manager:internals

See https://docs.taskcluster.net/reference/core/ec2-manager/api-docs#regions

func (*EC2Manager) Regions_SignedURL

func (eC2Manager *EC2Manager) Regions_SignedURL(duration time.Duration) (*url.URL, error)

Returns a signed URL for Regions, valid for the specified duration.

Required scopes:

ec2-manager:internals

See Regions for more details.

func (*EC2Manager) RemoveKeyPair

func (eC2Manager *EC2Manager) RemoveKeyPair(name string) error

Stability: *** EXPERIMENTAL ***

Ensure that a keypair of a given name does not exist.

Required scopes:

ec2-manager:manage-key-pairs:<name>

See https://docs.taskcluster.net/reference/core/ec2-manager/api-docs#removeKeyPair

func (*EC2Manager) RunInstance

func (eC2Manager *EC2Manager) RunInstance(workerType string, payload *MakeASpotRequest) error

Stability: *** EXPERIMENTAL ***

Request an instance of a worker type

Required scopes:

ec2-manager:manage-resources:<workerType>

See https://docs.taskcluster.net/reference/core/ec2-manager/api-docs#runInstance

func (*EC2Manager) SqsStats

func (eC2Manager *EC2Manager) SqsStats() error

Stability: *** EXPERIMENTAL ***

This method is only for debugging the ec2-manager

Required scopes:

ec2-manager:internals

See https://docs.taskcluster.net/reference/core/ec2-manager/api-docs#sqsStats

func (*EC2Manager) SqsStats_SignedURL

func (eC2Manager *EC2Manager) SqsStats_SignedURL(duration time.Duration) (*url.URL, error)

Returns a signed URL for SqsStats, valid for the specified duration.

Required scopes:

ec2-manager:internals

See SqsStats for more details.

func (*EC2Manager) TerminateInstance

func (eC2Manager *EC2Manager) TerminateInstance(region, instanceId string) error

Stability: *** EXPERIMENTAL ***

Terminate an instance in a specified region

Required scopes:

Any of:
- ec2-manager:manage-instances:<region>:<instanceId>
- ec2-manager:manage-resources:<workerType>

See https://docs.taskcluster.net/reference/core/ec2-manager/api-docs#terminateInstance

func (*EC2Manager) TerminateWorkerType

func (eC2Manager *EC2Manager) TerminateWorkerType(workerType string) error

Stability: *** EXPERIMENTAL ***

Terminate all instances for this worker type

Required scopes:

ec2-manager:manage-resources:<workerType>

See https://docs.taskcluster.net/reference/core/ec2-manager/api-docs#terminateWorkerType

func (*EC2Manager) WorkerTypeErrors

func (eC2Manager *EC2Manager) WorkerTypeErrors(workerType string) (*Errors, error)

Stability: *** EXPERIMENTAL ***

Return a list of the most recent errors encountered by a worker type

See https://docs.taskcluster.net/reference/core/ec2-manager/api-docs#workerTypeErrors

func (*EC2Manager) WorkerTypeHealth

func (eC2Manager *EC2Manager) WorkerTypeHealth(workerType string) (*HealthOfTheEC2Account, error)

Stability: *** EXPERIMENTAL ***

Return a view of the health of a given worker type

See https://docs.taskcluster.net/reference/core/ec2-manager/api-docs#workerTypeHealth

func (*EC2Manager) WorkerTypeState

func (eC2Manager *EC2Manager) WorkerTypeState(workerType string) (*OverviewOfComputationalResources1, error)

Stability: *** EXPERIMENTAL ***

Return state information for a given worker type

See https://docs.taskcluster.net/reference/core/ec2-manager/api-docs#workerTypeState

func (*EC2Manager) WorkerTypeStats

func (eC2Manager *EC2Manager) WorkerTypeStats(workerType string) (*OverviewOfComputationalResources, error)

Stability: *** EXPERIMENTAL ***

Return an object which has a generic state description. This only contains counts of instances

See https://docs.taskcluster.net/reference/core/ec2-manager/api-docs#workerTypeStats

type Entry1

type Entry1 struct {

	// EC2 instance type
	//
	// See http://schemas.taskcluster.net/ec2-manager/v1/prices.json#/items/properties/instanceType
	InstanceType string `json:"instanceType,omitempty"`

	// Amount of dollars for an hour of usage for this configuration
	//
	// See http://schemas.taskcluster.net/ec2-manager/v1/prices.json#/items/properties/price
	Price float64 `json:"price,omitempty"`

	// EC2 region
	//
	// See http://schemas.taskcluster.net/ec2-manager/v1/prices.json#/items/properties/region
	Region string `json:"region,omitempty"`

	// Possible values:
	//   * "spot"
	//   * "ondemand"
	//
	// See http://schemas.taskcluster.net/ec2-manager/v1/prices.json#/items/properties/type
	Type string `json:"type,omitempty"`

	// EC2 availability zone identifier
	//
	// See http://schemas.taskcluster.net/ec2-manager/v1/prices.json#/items/properties/zone
	Zone string `json:"zone,omitempty"`
}

See http://schemas.taskcluster.net/ec2-manager/v1/prices.json#/items

type Entry2

type Entry2 struct {

	// Possible values:
	//   * "instanceType"
	//   * "region"
	//   * "price"
	//   * "minPrice"
	//   * "maxPrice"
	//   * "zone"
	//   * "type"
	//
	// See http://schemas.taskcluster.net/ec2-manager/v1/prices-request.json#/items/properties/key
	Key string `json:"key,omitempty"`

	// One of:
	//   * Var5
	//   * Var6
	//   * Var7
	//
	// See http://schemas.taskcluster.net/ec2-manager/v1/prices-request.json#/items/properties/restriction
	Restriction json.RawMessage `json:"restriction,omitempty"`
}

See http://schemas.taskcluster.net/ec2-manager/v1/prices-request.json#/items

type Errors

type Errors struct {

	// See http://schemas.taskcluster.net/ec2-manager/v1/errors.json#/properties/errors
	Errors []Var4 `json:"errors,omitempty"`
}

This method returns a list of errors. It currently gives the error code only because we're not sure of the security implications of exposing the full message. We do store complete error messages, but are figuring out how to best expose them

See http://schemas.taskcluster.net/ec2-manager/v1/errors.json#

type HealthOfTheEC2Account

type HealthOfTheEC2Account struct {

	// See http://schemas.taskcluster.net/ec2-manager/v1/health.json#/properties/requestHealth
	RequestHealth []json.RawMessage `json:"requestHealth,omitempty"`

	// An overview of currently running instances
	//
	// See http://schemas.taskcluster.net/ec2-manager/v1/health.json#/properties/running
	Running []Var2 `json:"running,omitempty"`

	// See http://schemas.taskcluster.net/ec2-manager/v1/health.json#/properties/terminationHealth
	TerminationHealth []json.RawMessage `json:"terminationHealth,omitempty"`
}

This method provides a summary of the health in the EC2 account being managed. Values for the overall account are provided, broken down by Region, Availability Zone and Instance Type.

See http://schemas.taskcluster.net/ec2-manager/v1/health.json#

type LaunchInfo

type LaunchInfo json.RawMessage

This is an EC2-Manager specific wrapping of the request body for the upstream EC2 API. Values from this are passed through verbatim. A small number of checks are done on the data before making the call, as well as having some schema keys set to ensure certain values are either present or absent

Defined properties:

struct {

	// This is the AMI Identifier for this spot request.  This image must
	// already exist and must be in the region of the request.  Note that
	// AMI images are per-region, so you must copy or regenerate the image
	// for each region.
	//
	// See http://schemas.taskcluster.net/ec2-manager/v1/run-instance-request.json#/properties/LaunchInfo/properties/ImageId
	ImageID string `json:"ImageId,omitempty"`

	// The instance type to use for this spot request
	//
	// See http://schemas.taskcluster.net/ec2-manager/v1/run-instance-request.json#/properties/LaunchInfo/properties/InstanceType
	InstanceType string `json:"InstanceType,omitempty"`

	// A valid EC2 KeyPair name.  The KeyPair must already exist
	//
	// See http://schemas.taskcluster.net/ec2-manager/v1/run-instance-request.json#/properties/LaunchInfo/properties/KeyName
	KeyName string `json:"KeyName,omitempty"`

	// This is a list of the security groups this image will use.  These
	// groups must already exist in the region.
	//
	// See http://schemas.taskcluster.net/ec2-manager/v1/run-instance-request.json#/properties/LaunchInfo/properties/SecurityGroups
	SecurityGroups []string `json:"SecurityGroups,omitempty"`
}

Additional properties allowed

See http://schemas.taskcluster.net/ec2-manager/v1/run-instance-request.json#/properties/LaunchInfo

func (*LaunchInfo) MarshalJSON

func (this *LaunchInfo) MarshalJSON() ([]byte, error)

MarshalJSON calls json.RawMessage method of the same name. Required since LaunchInfo is of type json.RawMessage...

func (*LaunchInfo) UnmarshalJSON

func (this *LaunchInfo) UnmarshalJSON(data []byte) error

UnmarshalJSON is a copy of the json.RawMessage implementation.

type ListOfPrices

type ListOfPrices []Entry1

A list of prices for EC2

See http://schemas.taskcluster.net/ec2-manager/v1/prices.json#

type ListOfRestrictionsForPrices

type ListOfRestrictionsForPrices []Entry2

A list of prices for EC2

See http://schemas.taskcluster.net/ec2-manager/v1/prices-request.json#

type ListOfWorkerTypes

type ListOfWorkerTypes []string

A list of names of worker types

See http://schemas.taskcluster.net/ec2-manager/v1/list-worker-types.json#

type MakeASpotRequest

type MakeASpotRequest struct {

	// A ClientToken string per the implementation requirements of the EC2 api.
	// This string must be no more than 64 characters of ASCII.  We restrict the
	// client tokens further to alphanumeric ASCII with the addition of the `-`
	// and `_` characters
	//
	// Syntax:     ^[a-zA-Z0-0_-]{1,64}
	// Min length: 1
	// Max length: 64
	//
	// See http://schemas.taskcluster.net/ec2-manager/v1/run-instance-request.json#/properties/ClientToken
	ClientToken string `json:"ClientToken,omitempty"`

	// This is an EC2-Manager specific wrapping of the request body for the
	// upstream EC2 API.  Values from this are passed through verbatim.  A small
	// number of checks are done on the data before making the call, as well as
	// having some schema keys set to ensure certain values are either present
	// or absent
	//
	// Defined properties:
	//
	//  struct {
	//
	//  	// This is the AMI Identifier for this spot request.  This image must
	//  	// already exist and must be in the region of the request.  Note that
	//  	// AMI images are per-region, so you must copy or regenerate the image
	//  	// for each region.
	//  	//
	//  	// See http://schemas.taskcluster.net/ec2-manager/v1/run-instance-request.json#/properties/LaunchInfo/properties/ImageId
	//  	ImageID string `json:"ImageId,omitempty"`
	//
	//  	// The instance type to use for this spot request
	//  	//
	//  	// See http://schemas.taskcluster.net/ec2-manager/v1/run-instance-request.json#/properties/LaunchInfo/properties/InstanceType
	//  	InstanceType string `json:"InstanceType,omitempty"`
	//
	//  	// A valid EC2 KeyPair name.  The KeyPair must already exist
	//  	//
	//  	// See http://schemas.taskcluster.net/ec2-manager/v1/run-instance-request.json#/properties/LaunchInfo/properties/KeyName
	//  	KeyName string `json:"KeyName,omitempty"`
	//
	//  	// This is a list of the security groups this image will use.  These
	//  	// groups must already exist in the region.
	//  	//
	//  	// See http://schemas.taskcluster.net/ec2-manager/v1/run-instance-request.json#/properties/LaunchInfo/properties/SecurityGroups
	//  	SecurityGroups []string `json:"SecurityGroups,omitempty"`
	//  }
	//
	// Additional properties allowed
	//
	// See http://schemas.taskcluster.net/ec2-manager/v1/run-instance-request.json#/properties/LaunchInfo
	LaunchInfo json.RawMessage `json:"LaunchInfo,omitempty"`

	// The EC2 region in which this spot request is to be made.  This should be
	// the lower case api-identifier.  For example `us-east-1`
	//
	// See http://schemas.taskcluster.net/ec2-manager/v1/run-instance-request.json#/properties/Region
	Region string `json:"Region,omitempty"`

	// Specify whether to use a spot request or an on-demand instance.  This is
	// not inferred from the SpotPrice being set or not because we want to allow
	// for the default behaviour for spot prices, which is to use the spot
	// market with a default price of the on-demand price
	//
	// Possible values:
	//   * "spot"
	//   * "on-demand"
	//
	// See http://schemas.taskcluster.net/ec2-manager/v1/run-instance-request.json#/properties/RequestType
	RequestType string `json:"RequestType,omitempty"`

	// The actual price of the bid.  This is passed directly to the EC2 api and
	// so should not have any internal multipliers (e.g. capacity or utility)
	// applied
	//
	// See http://schemas.taskcluster.net/ec2-manager/v1/run-instance-request.json#/properties/SpotPrice
	SpotPrice float64 `json:"SpotPrice,omitempty"`
}

Presented here are the fields that are absolutely 100% required to make a spot request. The `LaunchSpecification` property is an opaque datastructure from EC2, however the fields which we know are absolutely required are described

See http://schemas.taskcluster.net/ec2-manager/v1/run-instance-request.json#

type OverviewOfComputationalResources

type OverviewOfComputationalResources struct {

	// See http://schemas.taskcluster.net/ec2-manager/v1/worker-type-resources.json#/properties/pending
	Pending []json.RawMessage `json:"pending,omitempty"`

	// See http://schemas.taskcluster.net/ec2-manager/v1/worker-type-resources.json#/properties/running
	Running []interface{} `json:"running,omitempty"`
}

Overview of computational resources for a given worker type

See http://schemas.taskcluster.net/ec2-manager/v1/worker-type-resources.json#

type OverviewOfComputationalResources1

type OverviewOfComputationalResources1 struct {

	// See http://schemas.taskcluster.net/ec2-manager/v1/worker-type-state.json#/properties/instances
	Instances []interface{} `json:"instances,omitempty"`
}

Overview of computational resources for a given worker type

See http://schemas.taskcluster.net/ec2-manager/v1/worker-type-state.json#

type SSHPublicKey

type SSHPublicKey struct {

	// An OpenSSH format Public Key as described by tools.ietf.org/html/rfc4253#section-6.6
	//
	// Syntax:     ^(ssh-\S*)\s*(\S*)\s*(.*)$
	//
	// See http://schemas.taskcluster.net/ec2-manager/v1/create-key-pair.json#/properties/pubkey
	Pubkey string `json:"pubkey,omitempty"`
}

See http://schemas.taskcluster.net/ec2-manager/v1/create-key-pair.json#

type Var

type Var json.RawMessage

Defined properties:

struct {

	// See http://schemas.taskcluster.net/ec2-manager/v1/worker-type-resources.json#/properties/pending/items/properties/count
	Count float64 `json:"count,omitempty"`

	// See http://schemas.taskcluster.net/ec2-manager/v1/worker-type-resources.json#/properties/pending/items/properties/instanceType
	InstanceType string `json:"instanceType,omitempty"`

	// Possible values:
	//   * "instance"
	//
	// See http://schemas.taskcluster.net/ec2-manager/v1/worker-type-resources.json#/properties/pending/items/properties/type
	Type string `json:"type,omitempty"`
}

Additional properties allowed

See http://schemas.taskcluster.net/ec2-manager/v1/worker-type-resources.json#/properties/pending/items

func (*Var) MarshalJSON

func (this *Var) MarshalJSON() ([]byte, error)

MarshalJSON calls json.RawMessage method of the same name. Required since Var is of type json.RawMessage...

func (*Var) UnmarshalJSON

func (this *Var) UnmarshalJSON(data []byte) error

UnmarshalJSON is a copy of the json.RawMessage implementation.

type Var1

type Var1 json.RawMessage

This is a list of outcomes for a specific region, availability zone and instance type. These are calls to the EC2 runInstances method, which is how we request instances. If a call to this method is successful, then we expect to get an instance to match

Defined properties:

struct {

	// See http://schemas.taskcluster.net/ec2-manager/v1/health.json#/properties/requestHealth/items/properties/az
	Az string `json:"az,omitempty"`

	// The number of calls failed due to a misconfiguration of the worker type.  Due to the large number of error codes the EC2 API might return, this is a best effort categorization.  It covers codes which are like "Invalid%" using SQL pattern mattching on the codes from https://docs.aws.amazon.com/AWSEC2/latest/APIReference/errors-overview.html It is not categorized by which field was invalid in this response
	//
	// See http://schemas.taskcluster.net/ec2-manager/v1/health.json#/properties/requestHealth/items/properties/configuration_issue
	Configuration_Issue int64 `json:"configuration_issue,omitempty"`

	// The total number of calls which failed, inrespective of why
	//
	// See http://schemas.taskcluster.net/ec2-manager/v1/health.json#/properties/requestHealth/items/properties/failed
	Failed int64 `json:"failed,omitempty"`

	// See http://schemas.taskcluster.net/ec2-manager/v1/health.json#/properties/requestHealth/items/properties/instanceType
	InstanceType string `json:"instanceType,omitempty"`

	// Number of runInstances calls which have failed because there aren't
	// enough hosts for the resources to be allocated.
	//
	// See http://schemas.taskcluster.net/ec2-manager/v1/health.json#/properties/requestHealth/items/properties/insufficient_capacity
	Insufficient_Capacity int64 `json:"insufficient_capacity,omitempty"`

	// The number of calls which failed due to a limit being exceeded.
	// Due to the large number of error codes the EC2 API might return,
	// this is a best effort categorization.  It covers codes which are
	// like "%LimitExceeded" using SQL pattern mattching, but not
	// RequestLimitExceeded on the codes from
	// https://docs.aws.amazon.com/AWSEC2/latest/APIReference/errors-overview.html
	// It is not categorized by which limit was exceeded in this response
	//
	// See http://schemas.taskcluster.net/ec2-manager/v1/health.json#/properties/requestHealth/items/properties/limit_exceeded
	Limit_Exceeded int64 `json:"limit_exceeded,omitempty"`

	// See http://schemas.taskcluster.net/ec2-manager/v1/health.json#/properties/requestHealth/items/properties/region
	Region string `json:"region,omitempty"`

	// The number of instances which have been requested successfully
	//
	// See http://schemas.taskcluster.net/ec2-manager/v1/health.json#/properties/requestHealth/items/properties/successful
	Successful int64 `json:"successful,omitempty"`

	// Number of calls which have been throttled in this region.  These
	// are errors with the code RequestLimitExceeded.
	//
	// See http://schemas.taskcluster.net/ec2-manager/v1/health.json#/properties/requestHealth/items/properties/throttled_calls
	Throttled_Calls int64 `json:"throttled_calls,omitempty"`
}

Additional properties allowed

See http://schemas.taskcluster.net/ec2-manager/v1/health.json#/properties/requestHealth/items

func (*Var1) MarshalJSON

func (this *Var1) MarshalJSON() ([]byte, error)

MarshalJSON calls json.RawMessage method of the same name. Required since Var1 is of type json.RawMessage...

func (*Var1) UnmarshalJSON

func (this *Var1) UnmarshalJSON(data []byte) error

UnmarshalJSON is a copy of the json.RawMessage implementation.

type Var3

type Var3 json.RawMessage

This is a list of summaries of instances which have terminated

Defined properties:

struct {

	// See http://schemas.taskcluster.net/ec2-manager/v1/health.json#/properties/terminationHealth/items/properties/az
	Az string `json:"az,omitempty"`

	// A count of the instances which were shutdown cleanty.  For the
	// purposes of this API, a clean shutdown is one which was initiated
	// by us.  This includes API shutdowns or workers ending themselves.
	// It does not mean the actual workload ran successfully, rather that
	// we chose to terminate it
	//
	// See http://schemas.taskcluster.net/ec2-manager/v1/health.json#/properties/terminationHealth/items/properties/clean_shutdown
	Clean_Shutdown int64 `json:"clean_shutdown,omitempty"`

	// See http://schemas.taskcluster.net/ec2-manager/v1/health.json#/properties/terminationHealth/items/properties/instanceType
	InstanceType string `json:"instanceType,omitempty"`

	// The number of instances which were terminated due to a lack of
	// capacity.  More than likely, this will always be zero because the
	// new spot service is now synchronous, so runInstances calls should
	// fail
	//
	// See http://schemas.taskcluster.net/ec2-manager/v1/health.json#/properties/terminationHealth/items/properties/insufficient_capacity
	Insufficient_Capacity int64 `json:"insufficient_capacity,omitempty"`

	// The number of instances which were terminated due to not being able
	// to find the AMI
	//
	// See http://schemas.taskcluster.net/ec2-manager/v1/health.json#/properties/terminationHealth/items/properties/missing_ami
	Missing_Ami int64 `json:"missing_ami,omitempty"`

	// The number of terminations which we cannot find a code.  This means
	// we cannot determine whether this should be classified as a good or
	// bad outcome.  The specific reason is that the code which polls for
	// termination reason was not able to run before the EC2 API dropped
	// the instance from its database
	//
	// See http://schemas.taskcluster.net/ec2-manager/v1/health.json#/properties/terminationHealth/items/properties/no_code
	No_Code int64 `json:"no_code,omitempty"`

	// See http://schemas.taskcluster.net/ec2-manager/v1/health.json#/properties/terminationHealth/items/properties/region
	Region string `json:"region,omitempty"`

	// The number of instances which were killed by the spot service
	//
	// See http://schemas.taskcluster.net/ec2-manager/v1/health.json#/properties/terminationHealth/items/properties/spot_kill
	Spot_Kill int64 `json:"spot_kill,omitempty"`

	// The number of instances which failed to start, either because of an
	// error on our side or on the EC2 side
	//
	// See http://schemas.taskcluster.net/ec2-manager/v1/health.json#/properties/terminationHealth/items/properties/startup_failed
	Startup_Failed int64 `json:"startup_failed,omitempty"`

	// The number of terminations which have a code which this code does
	// not recognize
	//
	// See http://schemas.taskcluster.net/ec2-manager/v1/health.json#/properties/terminationHealth/items/properties/unknown_code
	Unknown_Code int64 `json:"unknown_code,omitempty"`

	// The number of instances which were terminated due to exceeding the
	// limit for number of ebs volumes
	//
	// See http://schemas.taskcluster.net/ec2-manager/v1/health.json#/properties/terminationHealth/items/properties/volume_limit_exceeded
	Volume_Limit_Exceeded int64 `json:"volume_limit_exceeded,omitempty"`
}

Additional properties allowed

See http://schemas.taskcluster.net/ec2-manager/v1/health.json#/properties/terminationHealth/items

func (*Var3) MarshalJSON

func (this *Var3) MarshalJSON() ([]byte, error)

MarshalJSON calls json.RawMessage method of the same name. Required since Var3 is of type json.RawMessage...

func (*Var3) UnmarshalJSON

func (this *Var3) UnmarshalJSON(data []byte) error

UnmarshalJSON is a copy of the json.RawMessage implementation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL