Documentation ¶
Overview ¶
Package armclient implements the client for ARM.
Index ¶
- func GetChildResourceID(subscriptionID, resourceGroupName, resourceType, resourceName, ... string) string
- func GetChildResourcesListID(subscriptionID, resourceGroupName, resourceType, resourceName, ... string) string
- func GetProviderResourceID(subscriptionID, providerNamespace string) string
- func GetProviderResourcesListID(subscriptionID string) string
- func GetResourceID(subscriptionID, resourceGroupName, resourceType, resourceName string) string
- func GetUserAgent(client autorest.Client) string
- func NormalizeAzureRegion(name string) string
- type Client
- func (c *Client) CloseResponse(ctx context.Context, response *http.Response)
- func (c *Client) DeleteResource(ctx context.Context, resourceID, ifMatch string) *retry.Error
- func (c *Client) DeleteResourceAsync(ctx context.Context, resourceID, ifMatch string) (*azure.Future, *retry.Error)
- func (c *Client) GetResource(ctx context.Context, resourceID, expand string) (*http.Response, *retry.Error)
- func (c *Client) GetResourceWithDecorators(ctx context.Context, resourceID string, decorators []autorest.PrepareDecorator) (*http.Response, *retry.Error)
- func (c *Client) HeadResource(ctx context.Context, resourceID string) (*http.Response, *retry.Error)
- func (c *Client) PatchResource(ctx context.Context, resourceID string, parameters interface{}) (*http.Response, *retry.Error)
- func (c *Client) PostResource(ctx context.Context, resourceID, action string, parameters interface{}) (*http.Response, *retry.Error)
- func (c *Client) PrepareDeleteRequest(ctx context.Context, decorators ...autorest.PrepareDecorator) (*http.Request, error)
- func (c *Client) PrepareGetRequest(ctx context.Context, decorators ...autorest.PrepareDecorator) (*http.Request, error)
- func (c *Client) PrepareHeadRequest(ctx context.Context, decorators ...autorest.PrepareDecorator) (*http.Request, error)
- func (c *Client) PreparePatchRequest(ctx context.Context, decorators ...autorest.PrepareDecorator) (*http.Request, error)
- func (c *Client) PreparePostRequest(ctx context.Context, decorators ...autorest.PrepareDecorator) (*http.Request, error)
- func (c *Client) PreparePutRequest(ctx context.Context, decorators ...autorest.PrepareDecorator) (*http.Request, error)
- func (c *Client) PutResource(ctx context.Context, resourceID string, parameters interface{}) (*http.Response, *retry.Error)
- func (c *Client) PutResourceAsync(ctx context.Context, resourceID string, parameters interface{}) (*azure.Future, *retry.Error)
- func (c *Client) PutResourceWithDecorators(ctx context.Context, resourceID string, parameters interface{}, ...) (*http.Response, *retry.Error)
- func (c *Client) PutResources(ctx context.Context, resources map[string]interface{}) map[string]*PutResourcesResponse
- func (c *Client) PutResourcesInBatches(ctx context.Context, resources map[string]interface{}, batchSize int) map[string]*PutResourcesResponse
- func (c *Client) Send(ctx context.Context, request *http.Request) (*http.Response, *retry.Error)
- func (c *Client) SendAsync(ctx context.Context, request *http.Request) (*azure.Future, *http.Response, *retry.Error)
- func (c *Client) WaitForAsyncOperationCompletion(ctx context.Context, future *azure.Future, asyncOperationName string) error
- func (c *Client) WaitForAsyncOperationResult(ctx context.Context, future *azure.Future, asyncOperationName string) (*http.Response, error)
- type Interface
- type PutResourcesResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetChildResourceID ¶
func GetChildResourceID(subscriptionID, resourceGroupName, resourceType, resourceName, childResourceType, childResourceName string) string
GetChildResourceID gets Azure child resource ID
func GetChildResourcesListID ¶
func GetChildResourcesListID(subscriptionID, resourceGroupName, resourceType, resourceName, childResourceType string) string
GetChildResourcesListID gets Azure child resources list ID
func GetProviderResourceID ¶
GetProviderResourceID gets Azure RP resource ID
func GetProviderResourcesListID ¶
GetProviderResourcesListID gets Azure RP resources list ID
func GetResourceID ¶
GetResourceID gets Azure resource ID
func GetUserAgent ¶
GetUserAgent gets the autorest client with a user agent that includes "kubernetes" and the full kubernetes git version string example: Azure-SDK-for-Go/7.0.1 arm-network/2016-09-01; kubernetes-cloudprovider/v1.17.0;
func NormalizeAzureRegion ¶
NormalizeAzureRegion returns a normalized Azure region with white spaces removed and converted to lower case
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client implements ARM client Interface.
func New ¶
func New(authorizer autorest.Authorizer, baseURI, userAgent, apiVersion, clientRegion string, clientBackoff *retry.Backoff) *Client
New creates a ARM client
func (*Client) CloseResponse ¶
CloseResponse closes a response
func (*Client) DeleteResource ¶
DeleteResource deletes a resource by resource ID
func (*Client) DeleteResourceAsync ¶
func (c *Client) DeleteResourceAsync(ctx context.Context, resourceID, ifMatch string) (*azure.Future, *retry.Error)
DeleteResourceAsync delete a resource by resource ID and returns a future representing the async result
func (*Client) GetResource ¶
func (c *Client) GetResource(ctx context.Context, resourceID, expand string) (*http.Response, *retry.Error)
GetResource get a resource by resource ID
func (*Client) GetResourceWithDecorators ¶
func (c *Client) GetResourceWithDecorators(ctx context.Context, resourceID string, decorators []autorest.PrepareDecorator) (*http.Response, *retry.Error)
GetResourceWithDecorators get a resource with decorators by resource ID
func (*Client) HeadResource ¶
func (c *Client) HeadResource(ctx context.Context, resourceID string) (*http.Response, *retry.Error)
HeadResource heads a resource by resource ID
func (*Client) PatchResource ¶
func (c *Client) PatchResource(ctx context.Context, resourceID string, parameters interface{}) (*http.Response, *retry.Error)
PatchResource patches a resource by resource ID
func (*Client) PostResource ¶
func (c *Client) PostResource(ctx context.Context, resourceID, action string, parameters interface{}) (*http.Response, *retry.Error)
PostResource posts a resource by resource ID
func (*Client) PrepareDeleteRequest ¶
func (c *Client) PrepareDeleteRequest(ctx context.Context, decorators ...autorest.PrepareDecorator) (*http.Request, error)
PrepareDeleteRequest preparse delete request
func (*Client) PrepareGetRequest ¶
func (c *Client) PrepareGetRequest(ctx context.Context, decorators ...autorest.PrepareDecorator) (*http.Request, error)
PrepareGetRequest prepares get request
func (*Client) PrepareHeadRequest ¶
func (c *Client) PrepareHeadRequest(ctx context.Context, decorators ...autorest.PrepareDecorator) (*http.Request, error)
PrepareHeadRequest prepares head request
func (*Client) PreparePatchRequest ¶
func (c *Client) PreparePatchRequest(ctx context.Context, decorators ...autorest.PrepareDecorator) (*http.Request, error)
PreparePatchRequest prepares patch request
func (*Client) PreparePostRequest ¶
func (c *Client) PreparePostRequest(ctx context.Context, decorators ...autorest.PrepareDecorator) (*http.Request, error)
PreparePostRequest prepares post request
func (*Client) PreparePutRequest ¶
func (c *Client) PreparePutRequest(ctx context.Context, decorators ...autorest.PrepareDecorator) (*http.Request, error)
PreparePutRequest prepares put request
func (*Client) PutResource ¶
func (c *Client) PutResource(ctx context.Context, resourceID string, parameters interface{}) (*http.Response, *retry.Error)
PutResource puts a resource by resource ID
func (*Client) PutResourceAsync ¶
func (c *Client) PutResourceAsync(ctx context.Context, resourceID string, parameters interface{}) (*azure.Future, *retry.Error)
PutResourceAsync puts a resource by resource ID in async mode
func (*Client) PutResourceWithDecorators ¶
func (c *Client) PutResourceWithDecorators(ctx context.Context, resourceID string, parameters interface{}, decorators []autorest.PrepareDecorator) (*http.Response, *retry.Error)
PutResourceWithDecorators puts a resource by resource ID
func (*Client) PutResources ¶
func (c *Client) PutResources(ctx context.Context, resources map[string]interface{}) map[string]*PutResourcesResponse
PutResources puts a list of resources from resources map[resourceID]parameters. Those resources sync requests are sequential while async requests are concurrent. It's especially useful when the ARM API doesn't support concurrent requests.
func (*Client) PutResourcesInBatches ¶ added in v1.0.8
func (c *Client) PutResourcesInBatches(ctx context.Context, resources map[string]interface{}, batchSize int) map[string]*PutResourcesResponse
PutResourcesInBatches is similar with PutResources, but it sends sync request concurrently in batches.
func (*Client) Send ¶
Send sends a http request to ARM service with possible retry to regional ARM endpoint.
func (*Client) SendAsync ¶
func (c *Client) SendAsync(ctx context.Context, request *http.Request) (*azure.Future, *http.Response, *retry.Error)
SendAsync send a request and return a future object representing the async result as well as the origin http response
type Interface ¶
type Interface interface { // Send sends a http request to ARM service with possible retry to regional ARM endpoint. Send(ctx context.Context, request *http.Request) (*http.Response, *retry.Error) // PreparePutRequest prepares put request PreparePutRequest(ctx context.Context, decorators ...autorest.PrepareDecorator) (*http.Request, error) // PreparePostRequest prepares post request PreparePostRequest(ctx context.Context, decorators ...autorest.PrepareDecorator) (*http.Request, error) // PrepareGetRequest prepares get request PrepareGetRequest(ctx context.Context, decorators ...autorest.PrepareDecorator) (*http.Request, error) // PrepareDeleteRequest preparse delete request PrepareDeleteRequest(ctx context.Context, decorators ...autorest.PrepareDecorator) (*http.Request, error) // PrepareHeadRequest prepares head request PrepareHeadRequest(ctx context.Context, decorators ...autorest.PrepareDecorator) (*http.Request, error) // WaitForAsyncOperationCompletion waits for an operation completion WaitForAsyncOperationCompletion(ctx context.Context, future *azure.Future, asyncOperationName string) error // WaitForAsyncOperationResult waits for an operation result. WaitForAsyncOperationResult(ctx context.Context, future *azure.Future, asyncOperationName string) (*http.Response, error) // SendAsync send a request and return a future object representing the async result as well as the origin http response SendAsync(ctx context.Context, request *http.Request) (*azure.Future, *http.Response, *retry.Error) // PutResource puts a resource by resource ID PutResource(ctx context.Context, resourceID string, parameters interface{}) (*http.Response, *retry.Error) // PutResources puts a list of resources from resources map[resourceID]parameters. // Those resources sync requests are sequential while async requests are concurrent. It 's especially // useful when the ARM API doesn't support concurrent requests. PutResources(ctx context.Context, resources map[string]interface{}) map[string]*PutResourcesResponse // PutResourcesInBatches is similar with PutResources, but it sends sync request concurrently in batches. PutResourcesInBatches(ctx context.Context, resources map[string]interface{}, batchSize int) map[string]*PutResourcesResponse // PutResourceWithDecorators puts a resource with decorators by resource ID PutResourceWithDecorators(ctx context.Context, resourceID string, parameters interface{}, decorators []autorest.PrepareDecorator) (*http.Response, *retry.Error) // PatchResource patches a resource by resource ID PatchResource(ctx context.Context, resourceID string, parameters interface{}) (*http.Response, *retry.Error) // PutResourceAsync puts a resource by resource ID in async mode PutResourceAsync(ctx context.Context, resourceID string, parameters interface{}) (*azure.Future, *retry.Error) // HeadResource heads a resource by resource ID HeadResource(ctx context.Context, resourceID string) (*http.Response, *retry.Error) // GetResource get a resource by resource ID GetResource(ctx context.Context, resourceID, expand string) (*http.Response, *retry.Error) //GetResourceWithDecorators get a resource with decorators by resource ID GetResourceWithDecorators(ctx context.Context, resourceID string, decorators []autorest.PrepareDecorator) (*http.Response, *retry.Error) // PostResource posts a resource by resource ID PostResource(ctx context.Context, resourceID, action string, parameters interface{}) (*http.Response, *retry.Error) // DeleteResource deletes a resource by resource ID DeleteResource(ctx context.Context, resourceID, ifMatch string) *retry.Error // DeleteResourceAsync delete a resource by resource ID and returns a future representing the async result DeleteResourceAsync(ctx context.Context, resourceID, ifMatch string) (*azure.Future, *retry.Error) // CloseResponse closes a response CloseResponse(ctx context.Context, response *http.Response) }
Interface is the client interface for ARM. Don't forget to run the following command to generate the mock client: mockgen -source=$GOPATH/src/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/armclient/interface.go -package=mockarmclient Interface > $GOPATH/src/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/armclient/mockarmclient/interface.go
Directories ¶
Path | Synopsis |
---|---|
Package mockarmclient implements the mock client for ARM.
|
Package mockarmclient implements the mock client for ARM. |