imds

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client provides the API client for interacting with the Instance Metadata Service API.

func New

func New(options Options) *Client

func NewClient

func NewClient() *Client

NewClient returns an initialized Client based on the functional options. Provide additional functional options to further configure the behavior of the client, such as changing the client's endpoint or adding custom middleware behavior.

func (*Client) GetInstanceMetadata

func (c *Client) GetInstanceMetadata(ctx context.Context, params *GetInstanceMetadataInput) (*GetMetadataInstanceOutput, error)

GetInstanceIdentity retrieves an identity document describing an instance. Error is returned if the request fails or is unable to parse the response.

type GetInstanceMetadataInput

type GetInstanceMetadataInput struct{}

GetInstanceMetadataInput provides the input parameters for GetMetadataInstance operation.

type GetMetadataInstanceOutput

type GetMetadataInstanceOutput struct {
	InstanceIdentityDocument
}

GetMetadataInstanceOutput provides the output parameters for GetMetadataInstance operation.

type InstanceIdentityDocument

type InstanceIdentityDocument struct {
	Hostname    string `json:"hostname,omitempty"`
	ID          int    `json:"id,omitempty"`
	Image       string `json:"image,omitempty"`
	MachineType string `json:"machineType,omitempty"`
	Zone        string `json:"zone,omitempty"`
}

InstanceIdentityDocument provides the shape for unmarshaling an metadata instance document

type Options

type Options struct {
	// The endpoint the client will use to retrieve instance metadata.
	Endpoint string

	// The HTTP client to invoke API calls with. Defaults to client's default
	// HTTP implementation if nil.
	HTTPClient http.Client

	Format string
}

Options provides the fields for configuring the API client's behavior.

Jump to

Keyboard shortcuts

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