Documentation
¶
Index ¶
- Constants
- Variables
- type Client
- func (c *Client) GetDNSNameServers(ctx context.Context) (string, error)
- func (c *Client) GetDNSNameServersList(ctx context.Context) ([]string, error)
- func (c *Client) GetDiskId(ctx context.Context, diskSerial string) (string, error)
- func (c *Client) GetDiskName(ctx context.Context, diskSerial string) (string, error)
- func (c *Client) GetDisks(ctx context.Context) ([]string, error)
- func (c *Client) GetDocument(ctx context.Context) (*Document, error)
- func (c *Client) GetEIPV4(ctx context.Context) (string, error)
- func (c *Client) GetGatewayByMac(ctx context.Context, mac string) (string, error)
- func (c *Client) GetHostname(ctx context.Context) (string, error)
- func (c *Client) GetIPV4PrefixesByMac(ctx context.Context, mac string) (string, error)
- func (c *Client) GetIPV6GatewayByMac(ctx context.Context, mac string) (string, error)
- func (c *Client) GetIPV6sByMac(ctx context.Context, mac string) ([]string, error)
- func (c *Client) GetImageId(ctx context.Context) (string, error)
- func (c *Client) GetInstanceId(ctx context.Context) (string, error)
- func (c *Client) GetInstanceName(ctx context.Context) (string, error)
- func (c *Client) GetInstanceType(ctx context.Context) (string, error)
- func (c *Client) GetInterfaceIdByMac(ctx context.Context, mac string) (string, error)
- func (c *Client) GetMac(ctx context.Context) (string, error)
- func (c *Client) GetMacs(ctx context.Context) ([]string, error)
- func (c *Client) GetMetaData(ctx context.Context, method, path string) ([]byte, error)
- func (c *Client) GetNTPServers(ctx context.Context) (string, error)
- func (c *Client) GetNTPServersList(ctx context.Context) ([]string, error)
- func (c *Client) GetNetMaskByMac(ctx context.Context, mac string) (string, error)
- func (c *Client) GetNetworkType(ctx context.Context) (string, error)
- func (c *Client) GetOwnerAccountId(ctx context.Context) (string, error)
- func (c *Client) GetPrimaryIPAddressByMac(ctx context.Context, mac string) (string, error)
- func (c *Client) GetPrivateIPV4(ctx context.Context) (string, error)
- func (c *Client) GetPrivateIPV4sByMac(ctx context.Context, mac string) ([]string, error)
- func (c *Client) GetPublicIPV4(ctx context.Context) (string, error)
- func (c *Client) GetRawDocument(ctx context.Context) (string, error)
- func (c *Client) GetRawRoleCredentials(ctx context.Context, roleName string) (string, error)
- func (c *Client) GetRegionId(ctx context.Context) (string, error)
- func (c *Client) GetRoleCredentials(ctx context.Context, roleName string) (*RoleCredentials, error)
- func (c *Client) GetRoleName(ctx context.Context) (string, error)
- func (c *Client) GetSerialNumber(ctx context.Context) (string, error)
- func (c *Client) GetSourceAddress(ctx context.Context) (string, error)
- func (c *Client) GetSourceAddressList(ctx context.Context) ([]string, error)
- func (c *Client) GetSpotTerminationTime(ctx context.Context) (time.Time, error)
- func (c *Client) GetUserData(ctx context.Context) (string, error)
- func (c *Client) GetVSwitchCidrBlock(ctx context.Context) (string, error)
- func (c *Client) GetVSwitchCidrBlockId(ctx context.Context) (string, error)
- func (c *Client) GetVSwitchCidrBlockIdByMac(ctx context.Context, mac string) (string, error)
- func (c *Client) GetVSwitchIPV6CidrBlockByMac(ctx context.Context, mac string) (string, error)
- func (c *Client) GetVSwitchId(ctx context.Context) (string, error)
- func (c *Client) GetVSwitchIdByMac(ctx context.Context, mac string) (string, error)
- func (c *Client) GetVpcCidrBlock(ctx context.Context) (string, error)
- func (c *Client) GetVpcCidrBlockId(ctx context.Context) (string, error)
- func (c *Client) GetVpcIPV6CidrBlocksByMac(ctx context.Context, mac string) ([]string, error)
- func (c *Client) GetVpcId(ctx context.Context) (string, error)
- func (c *Client) GetVpcIdByMac(ctx context.Context, mac string) (string, error)
- func (c *Client) GetZoneId(ctx context.Context) (string, error)
- func (c *Client) NewDocumentPKCS7Signature(ctx context.Context, audience string) (string, error)
- func (c *Client) SetEndpoint(endpoint string) *Client
- type ClientOptions
- type Document
- type HTTPError
- type MockWrapper
- type RetryOptions
- type RoleCredentials
- type TransportWrapper
Constants ¶
View Source
const ( DefaultEndpoint = "http://100.100.100.200" EnvEndpoint = "ALIBABA_CLOUD_IMDS_ENDPOINT" EnvIMDSV2Disabled = "ALIBABA_CLOUD_IMDSV2_DISABLED" EnvIMDSRoleName = "ALIBABA_CLOUD_ECS_METADATA" )
Variables ¶
View Source
var DefaultClient, _ = NewClient(ClientOptions{})
View Source
var UserAgent = ""
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(opts ClientOptions) (*Client, error)
func (*Client) GetDNSNameServers ¶ added in v0.0.8
func (*Client) GetDNSNameServersList ¶ added in v0.0.9
func (*Client) GetDiskName ¶ added in v0.0.4
func (*Client) GetGatewayByMac ¶ added in v0.0.4
func (*Client) GetHostname ¶ added in v0.0.8
func (*Client) GetIPV4PrefixesByMac ¶ added in v0.0.4
func (*Client) GetIPV6GatewayByMac ¶ added in v0.0.4
func (*Client) GetIPV6sByMac ¶ added in v0.0.4
func (*Client) GetImageId ¶ added in v0.0.4
func (*Client) GetInstanceName ¶
func (*Client) GetInstanceType ¶
func (*Client) GetInterfaceIdByMac ¶ added in v0.0.4
func (*Client) GetMetaData ¶
func (*Client) GetNTPServers ¶ added in v0.0.8
func (*Client) GetNTPServersList ¶ added in v0.0.9
func (*Client) GetNetMaskByMac ¶ added in v0.0.4
func (*Client) GetNetworkType ¶
func (*Client) GetOwnerAccountId ¶
func (*Client) GetPrimaryIPAddressByMac ¶ added in v0.0.4
func (*Client) GetPrivateIPV4 ¶
func (*Client) GetPrivateIPV4sByMac ¶ added in v0.0.4
func (*Client) GetRawDocument ¶
func (*Client) GetRawRoleCredentials ¶ added in v0.0.2
func (*Client) GetRoleCredentials ¶ added in v0.0.2
func (*Client) GetSerialNumber ¶ added in v0.0.4
func (*Client) GetSourceAddress ¶ added in v0.0.8
func (*Client) GetSourceAddressList ¶ added in v0.0.9
func (*Client) GetSpotTerminationTime ¶ added in v0.0.6
func (*Client) GetVSwitchCidrBlock ¶ added in v0.0.8
func (*Client) GetVSwitchCidrBlockId ¶
GetVSwitchCidrBlockId deprecated, use GetVSwitchCidrBlock instead
func (*Client) GetVSwitchCidrBlockIdByMac ¶ added in v0.0.4
func (*Client) GetVSwitchIPV6CidrBlockByMac ¶ added in v0.0.4
func (*Client) GetVSwitchIdByMac ¶ added in v0.0.4
func (*Client) GetVpcCidrBlock ¶ added in v0.0.8
func (*Client) GetVpcCidrBlockId ¶
GetVpcCidrBlockId deprecated, use GetVpcCidrBlock instead
func (*Client) GetVpcIPV6CidrBlocksByMac ¶ added in v0.0.4
func (*Client) GetVpcIdByMac ¶ added in v0.0.4
func (*Client) NewDocumentPKCS7Signature ¶
func (*Client) SetEndpoint ¶ added in v0.0.4
type ClientOptions ¶
type ClientOptions struct { // default: DefaultEndpoint Endpoint string // ram role of ecs instance RoleName string DisableIMDSV2 bool // default: 18000, 5 hours TokenTTLSeconds int TransportWrappers []TransportWrapper // default: 30 seconds Timeout time.Duration // default: time.Now NowFunc func() time.Time DisableRetry bool // default: DefaultRetryOptions() RetryOptions *RetryOptions UserAgent string // contains filtered or unexported fields }
type Document ¶
type Document struct { AccountId string `json:"account-id"` // always is empty? OwnerAccountId string `json:"owner-account-id"` InstanceId string `json:"instance-id"` Mac string `json:"mac"` RegionId string `json:"region-id"` SerialNumber string `json:"serial-number"` ZoneId string `json:"zone-id"` InstanceType string `json:"instance-type"` ImageId string `json:"image-id"` PrivateIp string `json:"private-ip"` }
type HTTPError ¶
type MockWrapper ¶ added in v0.0.4
type RetryOptions ¶
func DefaultRetryOptions ¶
func DefaultRetryOptions() *RetryOptions
type RoleCredentials ¶ added in v0.0.2
type TransportWrapper ¶
type TransportWrapper func(rt http.RoundTripper) http.RoundTripper
Click to show internal directories.
Click to hide internal directories.