Documentation ¶
Index ¶
- func DoRequest(ctx context.Context, method, path string) (string, error)
- func DoRequestAsync(ctx context.Context, method, path string) chan RequestResult
- func DoRequestWithBody(ctx context.Context, method, path, body string) (string, error)
- func DoResourceGraphQuery(ctx context.Context, subscription, query string) (string, error)
- func GetAPIVersion(armType string) (string, error)
- func GetTenantID() string
- func PopulateResourceAPILookup(ctx context.Context)
- type DeploymentsResponse
- type OperationsRequest
- type ProvidersResponse
- type RequestResult
- type Resource
- type ResourceGroupResponse
- type ResourceQueryResponse
- type ResourceResponse
- type SubResourcesResponse
- type SubResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DoRequestAsync ¶
func DoRequestAsync(ctx context.Context, method, path string) chan RequestResult
DoRequestAsync makes an ARM rest request
func DoRequestWithBody ¶ added in v1.0.247
DoRequestWithBody makes an ARM rest request
func DoResourceGraphQuery ¶
DoResourceGraphQuery performs an azure graph query
func GetAPIVersion ¶
GetAPIVersion returns the most recent API version for a resource
func PopulateResourceAPILookup ¶
PopulateResourceAPILookup is used to build a cache of resourcetypes -> api versions this is needed when requesting details from a resource as APIVersion isn't known and is required
Types ¶
type DeploymentsResponse ¶ added in v1.0.218
type DeploymentsResponse struct { Value []struct { ID string `json:"id"` Name string `json:"name"` Properties struct { CorrelationID string `json:"correlationId"` Dependencies []struct { DependsOn []struct { ID string `json:"id"` ResourceName string `json:"resourceName"` ResourceType string `json:"resourceType"` } `json:"dependsOn"` ID string `json:"id"` ResourceName string `json:"resourceName"` ResourceType string `json:"resourceType"` } `json:"dependencies"` Duration string `json:"duration"` Mode string `json:"mode"` OutputResources []struct { ID string `json:"id"` } `json:"outputResources"` Outputs map[string]interface{} `json:"outputs"` Parameters map[string]interface{} `json:"parameters"` Providers []struct { Namespace string `json:"namespace"` ResourceTypes []struct { Locations []string `json:"locations"` ResourceType string `json:"resourceType"` } `json:"resourceTypes"` } `json:"providers"` ProvisioningState string `json:"provisioningState"` TemplateHash string `json:"templateHash"` Template map[string]interface{} `json:"template"` TemplateLink struct { ContentVersion string `json:"contentVersion"` URI string `json:"uri"` } `json:"templateLink"` Timestamp string `json:"timestamp"` } `json:"properties"` } `json:"value"` }
DeploymentsResponse is returned by a request for deployments in an RG
type OperationsRequest ¶
type OperationsRequest struct { DisplayName string `json:"displayName"` Operations []struct { Name string `json:"name"` DisplayName string `json:"displayName"` Description string `json:"description"` Origin interface{} `json:"origin"` Properties interface{} `json:"properties"` IsDataAction bool `json:"isDataAction"` } `json:"operations"` ResourceTypes []struct { Name string `json:"name"` DisplayName string `json:"displayName"` Operations []struct { Name string `json:"name"` DisplayName string `json:"displayName"` Description string `json:"description"` Origin interface{} `json:"origin"` Properties interface{} `json:"properties"` IsDataAction bool `json:"isDataAction"` } `json:"operations"` } `json:"resourceTypes"` ID string `json:"id"` Type string `json:"type"` Name string `json:"name"` }
OperationsRequest list the actions that can be performed
type ProvidersResponse ¶
type ProvidersResponse struct { Providers []struct { ID string `json:"id"` Namespace string `json:"namespace"` Authorization struct { ApplicationID string `json:"applicationId"` RoleDefinitionID string `json:"roleDefinitionId"` } `json:"authorization,omitempty"` ResourceTypes []struct { ResourceType string `json:"resourceType"` Locations []interface{} `json:"locations"` APIVersions []string `json:"apiVersions"` } `json:"resourceTypes"` RegistrationState string `json:"registrationState"` Authorizations []struct { ApplicationID string `json:"applicationId"` RoleDefinitionID string `json:"roleDefinitionId"` } `json:"authorizations,omitempty"` } `json:"value"` }
ProvidersResponse providers list rest type
type RequestResult ¶
RequestResult used with async channel
type Resource ¶
type Resource struct { ID string `json:"id"` Name string `json:"name"` Type string `json:"type"` Sku struct { Name string `json:"name"` Tier string `json:"tier"` } `json:"sku"` Kind string `json:"kind"` Location string `json:"location"` Properties struct { ProvisioningState string `json:"provisioningState"` } `json:"properties"` }
Resource is a resource in azure
type ResourceGroupResponse ¶
type ResourceGroupResponse struct { Groups []struct { ID string `json:"id"` Name string `json:"name"` Location string `json:"location"` Properties struct { ProvisioningState string `json:"provisioningState"` } `json:"properties"` } `json:"value"` }
ResourceGroupResponse ResourceGroup rest type
type ResourceQueryResponse ¶
type ResourceQueryResponse struct { TotalRecords int `json:"totalRecords"` Count int `json:"count"` Data struct { Columns []struct { Name string `json:"name"` Type string `json:"type"` } `json:"columns"` Rows [][]interface{} `json:"rows"` } `json:"data"` Facets []interface{} `json:"facets"` ResultTruncated string `json:"resultTruncated"` }
ResourceQueryResponse list query response
type ResourceResponse ¶
type ResourceResponse struct {
Resources []Resource `json:"value"`
}
ResourceResponse Resources list rest type
type SubResourcesResponse ¶
type SubResourcesResponse struct { Resources []struct { ID string `json:"id"` Name string `json:"name"` Type string `json:"type"` Location string `json:"location"` Tags struct { Test string `json:"test"` } `json:"tags,omitempty"` Sku struct { Name string `json:"name"` Tier string `json:"tier"` } `json:"sku,omitempty"` Kind string `json:"kind,omitempty"` Plan struct { Name string `json:"name"` PromotionCode string `json:"promotionCode"` Product string `json:"product"` Publisher string `json:"publisher"` } `json:"plan,omitempty"` } `json:"value"` NextLink string `json:"nextLink"` }
SubResourcesResponse is the response from the /resources call on a sub
type SubResponse ¶
type SubResponse struct { Subs []struct { ID string `json:"id"` SubscriptionID string `json:"subscriptionId"` DisplayName string `json:"displayName"` State string `json:"state"` SubscriptionPolicies struct { LocationPlacementID string `json:"locationPlacementId"` QuotaID string `json:"quotaId"` SpendingLimit string `json:"spendingLimit"` } `json:"subscriptionPolicies"` } `json:"value"` }
SubResponse Subscriptions REST type