api

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const ComputeAPIVersion = "2022-08-01"
View Source
const NetworkAPIVersion = "2022-07-01"
View Source
const ResourcesAPIVersion = "2021-04-01"
View Source
const StorageAPIVersion = "2022-05-01"
View Source
const SubscriptionsAPIVersion = "2021-01-01"

Variables

This section is empty.

Functions

func DecodeError

func DecodeError(statusCode int, body []byte) error

func IsAuthFailure

func IsAuthFailure(err error) bool

func IsNotFound

func IsNotFound(err error) bool

func NewHTTPClient

func NewHTTPClient() *http.Client

Types

type APIError

type APIError struct {
	StatusCode int
	Code       string
	Message    string
	RequestID  string
}

func (*APIError) Error

func (e *APIError) Error() string

type BlobContainer

type BlobContainer struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

type BlobService

type BlobService struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

type Client

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

func NewClient

func NewClient(ts *auth.TokenSource, endpoints cloud.Endpoints, opts ...Option) *Client

func (*Client) Do

func (c *Client) Do(ctx context.Context, req Request, out any) error

type IPConfiguration

type IPConfiguration struct {
	Name       string               `json:"name"`
	Properties IPConfigurationProps `json:"properties"`
}

type IPConfigurationProps

type IPConfigurationProps struct {
	PrivateIPAddress string       `json:"privateIPAddress"`
	PublicIPAddress  *ResourceRef `json:"publicIPAddress,omitempty"`
}

type ListBlobContainersResponse

type ListBlobContainersResponse struct {
	Value    []BlobContainer `json:"value"`
	NextLink string          `json:"nextLink"`
}

type ListBlobServicesResponse

type ListBlobServicesResponse struct {
	Value []BlobService `json:"value"`
}

type ListResourceGroupsResponse

type ListResourceGroupsResponse struct {
	Value    []ResourceGroup `json:"value"`
	NextLink string          `json:"nextLink"`
}

type ListStorageAccountsResponse

type ListStorageAccountsResponse struct {
	Value    []StorageAccount `json:"value"`
	NextLink string           `json:"nextLink"`
}

type ListSubscriptionsResponse

type ListSubscriptionsResponse struct {
	Value    []Subscription `json:"value"`
	NextLink string         `json:"nextLink"`
}

type ListVirtualMachinesResponse

type ListVirtualMachinesResponse struct {
	Value    []VirtualMachine `json:"value"`
	NextLink string           `json:"nextLink"`
}

type NetworkInterface

type NetworkInterface struct {
	ID         string                `json:"id"`
	Name       string                `json:"name"`
	Properties NetworkInterfaceProps `json:"properties"`
}

type NetworkInterfaceProps

type NetworkInterfaceProps struct {
	IPConfigurations []IPConfiguration `json:"ipConfigurations"`
}

type Option

type Option func(*Client)

func WithBaseURL

func WithBaseURL(raw string) Option

func WithHTTPClient

func WithHTTPClient(hc *http.Client) Option

func WithRetryPolicy

func WithRetryPolicy(p RetryPolicy) Option

type Pager

type Pager[T any] struct {
	// contains filtered or unexported fields
}

Pager walks Azure ARM list responses that use nextLink.

func NewPager

func NewPager[T any](c *Client, initial Request) *Pager[T]

func (*Pager[T]) All

func (p *Pager[T]) All(ctx context.Context) ([]T, error)

type PublicIPAddress

type PublicIPAddress struct {
	ID         string               `json:"id"`
	Name       string               `json:"name"`
	Properties PublicIPAddressProps `json:"properties"`
}

type PublicIPAddressProps

type PublicIPAddressProps struct {
	IPAddress string `json:"ipAddress"`
}

type Request

type Request struct {
	Method     string
	Path       string
	Query      url.Values
	Headers    http.Header
	Body       []byte
	Idempotent bool
}

type ResourceGroup

type ResourceGroup struct {
	ID       string `json:"id"`
	Name     string `json:"name"`
	Location string `json:"location"`
}

type ResourceID

type ResourceID struct {
	SubscriptionID string
	ResourceGroup  string
	Provider       string
	ResourceType   string
	ResourceName   string
}

func ParseResourceID

func ParseResourceID(id string) (ResourceID, error)

type ResourceRef

type ResourceRef struct {
	ID string `json:"id"`
}

type RetryPolicy

type RetryPolicy interface {
	Do(ctx context.Context, idempotent bool, fn func() (*http.Response, error)) (*http.Response, error)
}

func DefaultRetryPolicy

func DefaultRetryPolicy() RetryPolicy

type StorageAccount

type StorageAccount struct {
	ID       string `json:"id"`
	Name     string `json:"name"`
	Location string `json:"location"`
}

type Subscription

type Subscription struct {
	SubscriptionID string `json:"subscriptionId"`
	DisplayName    string `json:"displayName"`
	State          string `json:"state"`
}

type VMNetworkInterfaceRef

type VMNetworkInterfaceRef struct {
	ID string `json:"id"`
}

type VMNetworkProfile

type VMNetworkProfile struct {
	NetworkInterfaces []VMNetworkInterfaceRef `json:"networkInterfaces"`
}

type VirtualMachine

type VirtualMachine struct {
	ID         string              `json:"id"`
	Name       string              `json:"name"`
	Location   string              `json:"location"`
	Status     string              `json:"status"`
	Properties VirtualMachineProps `json:"properties"`
}

type VirtualMachineProps

type VirtualMachineProps struct {
	ProvisioningState string            `json:"provisioningState"`
	NetworkProfile    *VMNetworkProfile `json:"networkProfile,omitempty"`
}

Jump to

Keyboard shortcuts

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