vendor: update all dependencies to latest versions
This commit is contained in:
Generated
Vendored
+426
@@ -0,0 +1,426 @@
|
||||
package resourcehealth
|
||||
|
||||
// Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
//
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
"github.com/Azure/go-autorest/autorest/azure"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// AvailabilityStatusesClient is the the Resource Health Client.
|
||||
type AvailabilityStatusesClient struct {
|
||||
BaseClient
|
||||
}
|
||||
|
||||
// NewAvailabilityStatusesClient creates an instance of the AvailabilityStatusesClient client.
|
||||
func NewAvailabilityStatusesClient(subscriptionID string) AvailabilityStatusesClient {
|
||||
return NewAvailabilityStatusesClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewAvailabilityStatusesClientWithBaseURI creates an instance of the AvailabilityStatusesClient client.
|
||||
func NewAvailabilityStatusesClientWithBaseURI(baseURI string, subscriptionID string) AvailabilityStatusesClient {
|
||||
return AvailabilityStatusesClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// GetByResource gets current availability status for a single resource
|
||||
//
|
||||
// resourceURI is the fully qualified ID of the resource, including the resource name and resource type. Currently the
|
||||
// API support not nested and one nesting level resource types :
|
||||
// /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}
|
||||
// and
|
||||
// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}
|
||||
// filter is the filter to apply on the operation. For more information please see
|
||||
// https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN expand is setting
|
||||
// $expand=recommendedactions in url query expands the recommendedactions in the response.
|
||||
func (client AvailabilityStatusesClient) GetByResource(ctx context.Context, resourceURI string, filter string, expand string) (result AvailabilityStatus, err error) {
|
||||
req, err := client.GetByResourcePreparer(ctx, resourceURI, filter, expand)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resourcehealth.AvailabilityStatusesClient", "GetByResource", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.GetByResourceSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "resourcehealth.AvailabilityStatusesClient", "GetByResource", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.GetByResourceResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resourcehealth.AvailabilityStatusesClient", "GetByResource", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// GetByResourcePreparer prepares the GetByResource request.
|
||||
func (client AvailabilityStatusesClient) GetByResourcePreparer(ctx context.Context, resourceURI string, filter string, expand string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceUri": resourceURI,
|
||||
}
|
||||
|
||||
const APIVersion = "2015-01-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
if len(filter) > 0 {
|
||||
queryParameters["$filter"] = autorest.Encode("query", filter)
|
||||
}
|
||||
if len(expand) > 0 {
|
||||
queryParameters["$expand"] = autorest.Encode("query", expand)
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/{resourceUri}/providers/Microsoft.ResourceHealth/availabilityStatuses/current", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// GetByResourceSender sends the GetByResource request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client AvailabilityStatusesClient) GetByResourceSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
|
||||
}
|
||||
|
||||
// GetByResourceResponder handles the response to the GetByResource request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client AvailabilityStatusesClient) GetByResourceResponder(resp *http.Response) (result AvailabilityStatus, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// List lists the historical availability statuses for a single resource. Use the nextLink property in the response to
|
||||
// get the next page of availability status
|
||||
//
|
||||
// resourceURI is the fully qualified ID of the resource, including the resource name and resource type. Currently the
|
||||
// API support not nested and one nesting level resource types :
|
||||
// /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}
|
||||
// and
|
||||
// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}
|
||||
// filter is the filter to apply on the operation. For more information please see
|
||||
// https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN expand is setting
|
||||
// $expand=recommendedactions in url query expands the recommendedactions in the response.
|
||||
func (client AvailabilityStatusesClient) List(ctx context.Context, resourceURI string, filter string, expand string) (result AvailabilityStatusListResultPage, err error) {
|
||||
result.fn = client.listNextResults
|
||||
req, err := client.ListPreparer(ctx, resourceURI, filter, expand)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resourcehealth.AvailabilityStatusesClient", "List", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListSender(req)
|
||||
if err != nil {
|
||||
result.aslr.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "resourcehealth.AvailabilityStatusesClient", "List", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result.aslr, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resourcehealth.AvailabilityStatusesClient", "List", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListPreparer prepares the List request.
|
||||
func (client AvailabilityStatusesClient) ListPreparer(ctx context.Context, resourceURI string, filter string, expand string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceUri": resourceURI,
|
||||
}
|
||||
|
||||
const APIVersion = "2015-01-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
if len(filter) > 0 {
|
||||
queryParameters["$filter"] = autorest.Encode("query", filter)
|
||||
}
|
||||
if len(expand) > 0 {
|
||||
queryParameters["$expand"] = autorest.Encode("query", expand)
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/{resourceUri}/providers/Microsoft.ResourceHealth/availabilityStatuses", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// ListSender sends the List request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client AvailabilityStatusesClient) ListSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
|
||||
}
|
||||
|
||||
// ListResponder handles the response to the List request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client AvailabilityStatusesClient) ListResponder(resp *http.Response) (result AvailabilityStatusListResult, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// listNextResults retrieves the next set of results, if any.
|
||||
func (client AvailabilityStatusesClient) listNextResults(lastResults AvailabilityStatusListResult) (result AvailabilityStatusListResult, err error) {
|
||||
req, err := lastResults.availabilityStatusListResultPreparer()
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "resourcehealth.AvailabilityStatusesClient", "listNextResults", nil, "Failure preparing next results request")
|
||||
}
|
||||
if req == nil {
|
||||
return
|
||||
}
|
||||
resp, err := client.ListSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return result, autorest.NewErrorWithError(err, "resourcehealth.AvailabilityStatusesClient", "listNextResults", resp, "Failure sending next results request")
|
||||
}
|
||||
result, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resourcehealth.AvailabilityStatusesClient", "listNextResults", resp, "Failure responding to next results request")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// ListComplete enumerates all values, automatically crossing page boundaries as required.
|
||||
func (client AvailabilityStatusesClient) ListComplete(ctx context.Context, resourceURI string, filter string, expand string) (result AvailabilityStatusListResultIterator, err error) {
|
||||
result.page, err = client.List(ctx, resourceURI, filter, expand)
|
||||
return
|
||||
}
|
||||
|
||||
// ListByResourceGroup lists the current availability status for all the resources in the resource group. Use the
|
||||
// nextLink property in the response to get the next page of availability statuses.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. filter is the filter to apply on the operation. For more
|
||||
// information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN expand is
|
||||
// setting $expand=recommendedactions in url query expands the recommendedactions in the response.
|
||||
func (client AvailabilityStatusesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, filter string, expand string) (result AvailabilityStatusListResultPage, err error) {
|
||||
result.fn = client.listByResourceGroupNextResults
|
||||
req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, filter, expand)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resourcehealth.AvailabilityStatusesClient", "ListByResourceGroup", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListByResourceGroupSender(req)
|
||||
if err != nil {
|
||||
result.aslr.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "resourcehealth.AvailabilityStatusesClient", "ListByResourceGroup", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result.aslr, err = client.ListByResourceGroupResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resourcehealth.AvailabilityStatusesClient", "ListByResourceGroup", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListByResourceGroupPreparer prepares the ListByResourceGroup request.
|
||||
func (client AvailabilityStatusesClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string, filter string, expand string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2015-01-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
if len(filter) > 0 {
|
||||
queryParameters["$filter"] = autorest.Encode("query", filter)
|
||||
}
|
||||
if len(expand) > 0 {
|
||||
queryParameters["$expand"] = autorest.Encode("query", expand)
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ResourceHealth/availabilityStatuses", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client AvailabilityStatusesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client AvailabilityStatusesClient) ListByResourceGroupResponder(resp *http.Response) (result AvailabilityStatusListResult, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// listByResourceGroupNextResults retrieves the next set of results, if any.
|
||||
func (client AvailabilityStatusesClient) listByResourceGroupNextResults(lastResults AvailabilityStatusListResult) (result AvailabilityStatusListResult, err error) {
|
||||
req, err := lastResults.availabilityStatusListResultPreparer()
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "resourcehealth.AvailabilityStatusesClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request")
|
||||
}
|
||||
if req == nil {
|
||||
return
|
||||
}
|
||||
resp, err := client.ListByResourceGroupSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return result, autorest.NewErrorWithError(err, "resourcehealth.AvailabilityStatusesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request")
|
||||
}
|
||||
result, err = client.ListByResourceGroupResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resourcehealth.AvailabilityStatusesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required.
|
||||
func (client AvailabilityStatusesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, filter string, expand string) (result AvailabilityStatusListResultIterator, err error) {
|
||||
result.page, err = client.ListByResourceGroup(ctx, resourceGroupName, filter, expand)
|
||||
return
|
||||
}
|
||||
|
||||
// ListBySubscriptionID lists the current availability status for all the resources in the subscription. Use the
|
||||
// nextLink property in the response to get the next page of availability statuses.
|
||||
//
|
||||
// filter is the filter to apply on the operation. For more information please see
|
||||
// https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN expand is setting
|
||||
// $expand=recommendedactions in url query expands the recommendedactions in the response.
|
||||
func (client AvailabilityStatusesClient) ListBySubscriptionID(ctx context.Context, filter string, expand string) (result AvailabilityStatusListResultPage, err error) {
|
||||
result.fn = client.listBySubscriptionIDNextResults
|
||||
req, err := client.ListBySubscriptionIDPreparer(ctx, filter, expand)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resourcehealth.AvailabilityStatusesClient", "ListBySubscriptionID", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListBySubscriptionIDSender(req)
|
||||
if err != nil {
|
||||
result.aslr.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "resourcehealth.AvailabilityStatusesClient", "ListBySubscriptionID", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result.aslr, err = client.ListBySubscriptionIDResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resourcehealth.AvailabilityStatusesClient", "ListBySubscriptionID", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListBySubscriptionIDPreparer prepares the ListBySubscriptionID request.
|
||||
func (client AvailabilityStatusesClient) ListBySubscriptionIDPreparer(ctx context.Context, filter string, expand string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2015-01-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
if len(filter) > 0 {
|
||||
queryParameters["$filter"] = autorest.Encode("query", filter)
|
||||
}
|
||||
if len(expand) > 0 {
|
||||
queryParameters["$expand"] = autorest.Encode("query", expand)
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ResourceHealth/availabilityStatuses", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// ListBySubscriptionIDSender sends the ListBySubscriptionID request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client AvailabilityStatusesClient) ListBySubscriptionIDSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// ListBySubscriptionIDResponder handles the response to the ListBySubscriptionID request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client AvailabilityStatusesClient) ListBySubscriptionIDResponder(resp *http.Response) (result AvailabilityStatusListResult, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// listBySubscriptionIDNextResults retrieves the next set of results, if any.
|
||||
func (client AvailabilityStatusesClient) listBySubscriptionIDNextResults(lastResults AvailabilityStatusListResult) (result AvailabilityStatusListResult, err error) {
|
||||
req, err := lastResults.availabilityStatusListResultPreparer()
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "resourcehealth.AvailabilityStatusesClient", "listBySubscriptionIDNextResults", nil, "Failure preparing next results request")
|
||||
}
|
||||
if req == nil {
|
||||
return
|
||||
}
|
||||
resp, err := client.ListBySubscriptionIDSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return result, autorest.NewErrorWithError(err, "resourcehealth.AvailabilityStatusesClient", "listBySubscriptionIDNextResults", resp, "Failure sending next results request")
|
||||
}
|
||||
result, err = client.ListBySubscriptionIDResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resourcehealth.AvailabilityStatusesClient", "listBySubscriptionIDNextResults", resp, "Failure responding to next results request")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// ListBySubscriptionIDComplete enumerates all values, automatically crossing page boundaries as required.
|
||||
func (client AvailabilityStatusesClient) ListBySubscriptionIDComplete(ctx context.Context, filter string, expand string) (result AvailabilityStatusListResultIterator, err error) {
|
||||
result.page, err = client.ListBySubscriptionID(ctx, filter, expand)
|
||||
return
|
||||
}
|
||||
Generated
Vendored
+51
@@ -0,0 +1,51 @@
|
||||
// Package resourcehealth implements the Azure ARM Resourcehealth service API version 2015-01-01.
|
||||
//
|
||||
// The Resource Health Client.
|
||||
package resourcehealth
|
||||
|
||||
// Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
//
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
import (
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
)
|
||||
|
||||
const (
|
||||
// DefaultBaseURI is the default URI used for the service Resourcehealth
|
||||
DefaultBaseURI = "https://management.azure.com"
|
||||
)
|
||||
|
||||
// BaseClient is the base client for Resourcehealth.
|
||||
type BaseClient struct {
|
||||
autorest.Client
|
||||
BaseURI string
|
||||
SubscriptionID string
|
||||
}
|
||||
|
||||
// New creates an instance of the BaseClient client.
|
||||
func New(subscriptionID string) BaseClient {
|
||||
return NewWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewWithBaseURI creates an instance of the BaseClient client.
|
||||
func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient {
|
||||
return BaseClient{
|
||||
Client: autorest.NewClientWithUserAgent(UserAgent()),
|
||||
BaseURI: baseURI,
|
||||
SubscriptionID: subscriptionID,
|
||||
}
|
||||
}
|
||||
Generated
Vendored
+282
@@ -0,0 +1,282 @@
|
||||
package resourcehealth
|
||||
|
||||
// Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
//
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
import (
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
"github.com/Azure/go-autorest/autorest/date"
|
||||
"github.com/Azure/go-autorest/autorest/to"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// AvailabilityStateValues enumerates the values for availability state values.
|
||||
type AvailabilityStateValues string
|
||||
|
||||
const (
|
||||
// Available ...
|
||||
Available AvailabilityStateValues = "Available"
|
||||
// Unavailable ...
|
||||
Unavailable AvailabilityStateValues = "Unavailable"
|
||||
// Unknown ...
|
||||
Unknown AvailabilityStateValues = "Unknown"
|
||||
)
|
||||
|
||||
// ReasonChronicityTypes enumerates the values for reason chronicity types.
|
||||
type ReasonChronicityTypes string
|
||||
|
||||
const (
|
||||
// Persistent ...
|
||||
Persistent ReasonChronicityTypes = "Persistent"
|
||||
// Transient ...
|
||||
Transient ReasonChronicityTypes = "Transient"
|
||||
)
|
||||
|
||||
// AvailabilityStatus availabilityStatus of a resource.
|
||||
type AvailabilityStatus struct {
|
||||
autorest.Response `json:"-"`
|
||||
// ID - Azure Resource Manager Identity for the availabilityStatuses resource.
|
||||
ID *string `json:"id,omitempty"`
|
||||
// Name - current.
|
||||
Name *string `json:"name,omitempty"`
|
||||
// Type - Microsoft.ResourceHealth/AvailabilityStatuses.
|
||||
Type *string `json:"type,omitempty"`
|
||||
// Location - Azure Resource Manager geo location of the resource.
|
||||
Location *string `json:"location,omitempty"`
|
||||
// Properties - Properties of availability state.
|
||||
Properties *AvailabilityStatusProperties `json:"properties,omitempty"`
|
||||
}
|
||||
|
||||
// AvailabilityStatusListResult the List availabilityStatus operation response.
|
||||
type AvailabilityStatusListResult struct {
|
||||
autorest.Response `json:"-"`
|
||||
// Value - The list of availabilityStatuses.
|
||||
Value *[]AvailabilityStatus `json:"value,omitempty"`
|
||||
// NextLink - The URI to fetch the next page of availabilityStatuses. Call ListNext() with this URI to fetch the next page of availabilityStatuses.
|
||||
NextLink *string `json:"nextLink,omitempty"`
|
||||
}
|
||||
|
||||
// AvailabilityStatusListResultIterator provides access to a complete listing of AvailabilityStatus values.
|
||||
type AvailabilityStatusListResultIterator struct {
|
||||
i int
|
||||
page AvailabilityStatusListResultPage
|
||||
}
|
||||
|
||||
// Next advances to the next value. If there was an error making
|
||||
// the request the iterator does not advance and the error is returned.
|
||||
func (iter *AvailabilityStatusListResultIterator) Next() error {
|
||||
iter.i++
|
||||
if iter.i < len(iter.page.Values()) {
|
||||
return nil
|
||||
}
|
||||
err := iter.page.Next()
|
||||
if err != nil {
|
||||
iter.i--
|
||||
return err
|
||||
}
|
||||
iter.i = 0
|
||||
return nil
|
||||
}
|
||||
|
||||
// NotDone returns true if the enumeration should be started or is not yet complete.
|
||||
func (iter AvailabilityStatusListResultIterator) NotDone() bool {
|
||||
return iter.page.NotDone() && iter.i < len(iter.page.Values())
|
||||
}
|
||||
|
||||
// Response returns the raw server response from the last page request.
|
||||
func (iter AvailabilityStatusListResultIterator) Response() AvailabilityStatusListResult {
|
||||
return iter.page.Response()
|
||||
}
|
||||
|
||||
// Value returns the current value or a zero-initialized value if the
|
||||
// iterator has advanced beyond the end of the collection.
|
||||
func (iter AvailabilityStatusListResultIterator) Value() AvailabilityStatus {
|
||||
if !iter.page.NotDone() {
|
||||
return AvailabilityStatus{}
|
||||
}
|
||||
return iter.page.Values()[iter.i]
|
||||
}
|
||||
|
||||
// IsEmpty returns true if the ListResult contains no values.
|
||||
func (aslr AvailabilityStatusListResult) IsEmpty() bool {
|
||||
return aslr.Value == nil || len(*aslr.Value) == 0
|
||||
}
|
||||
|
||||
// availabilityStatusListResultPreparer prepares a request to retrieve the next set of results.
|
||||
// It returns nil if no more results exist.
|
||||
func (aslr AvailabilityStatusListResult) availabilityStatusListResultPreparer() (*http.Request, error) {
|
||||
if aslr.NextLink == nil || len(to.String(aslr.NextLink)) < 1 {
|
||||
return nil, nil
|
||||
}
|
||||
return autorest.Prepare(&http.Request{},
|
||||
autorest.AsJSON(),
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(to.String(aslr.NextLink)))
|
||||
}
|
||||
|
||||
// AvailabilityStatusListResultPage contains a page of AvailabilityStatus values.
|
||||
type AvailabilityStatusListResultPage struct {
|
||||
fn func(AvailabilityStatusListResult) (AvailabilityStatusListResult, error)
|
||||
aslr AvailabilityStatusListResult
|
||||
}
|
||||
|
||||
// Next advances to the next page of values. If there was an error making
|
||||
// the request the page does not advance and the error is returned.
|
||||
func (page *AvailabilityStatusListResultPage) Next() error {
|
||||
next, err := page.fn(page.aslr)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
page.aslr = next
|
||||
return nil
|
||||
}
|
||||
|
||||
// NotDone returns true if the page enumeration should be started or is not yet complete.
|
||||
func (page AvailabilityStatusListResultPage) NotDone() bool {
|
||||
return !page.aslr.IsEmpty()
|
||||
}
|
||||
|
||||
// Response returns the raw server response from the last page request.
|
||||
func (page AvailabilityStatusListResultPage) Response() AvailabilityStatusListResult {
|
||||
return page.aslr
|
||||
}
|
||||
|
||||
// Values returns the slice of values for the current page or nil if there are no values.
|
||||
func (page AvailabilityStatusListResultPage) Values() []AvailabilityStatus {
|
||||
if page.aslr.IsEmpty() {
|
||||
return nil
|
||||
}
|
||||
return *page.aslr.Value
|
||||
}
|
||||
|
||||
// AvailabilityStatusProperties properties of availability state.
|
||||
type AvailabilityStatusProperties struct {
|
||||
// AvailabilityState - Availability status of the resource. Possible values include: 'Available', 'Unavailable', 'Unknown'
|
||||
AvailabilityState AvailabilityStateValues `json:"availabilityState,omitempty"`
|
||||
// Summary - Summary description of the availability state.
|
||||
Summary *string `json:"summary,omitempty"`
|
||||
// DetailedStatus - Details of the availability status.
|
||||
DetailedStatus *string `json:"detailedStatus,omitempty"`
|
||||
// ReasonType - When the resource's availabilityState is Unavailable, it describes where the health impacting event was originated. Examples are planned, unplanned, user initiated or an outage etc.
|
||||
ReasonType *string `json:"reasonType,omitempty"`
|
||||
// RootCauseAttributionTime - When the resource's availabilityState is Unavailable, it provides the Timestamp for when the health impacting event was received.
|
||||
RootCauseAttributionTime *date.Time `json:"rootCauseAttributionTime,omitempty"`
|
||||
// ResolutionETA - When the resource's availabilityState is Unavailable and the reasonType is not User Initiated, it provides the date and time for when the issue is expected to be resolved.
|
||||
ResolutionETA *date.Time `json:"resolutionETA,omitempty"`
|
||||
// OccuredTime - Timestamp for when last change in health status occurred.
|
||||
OccuredTime *date.Time `json:"occuredTime,omitempty"`
|
||||
// ReasonChronicity - Chronicity of the availability transition. Possible values include: 'Transient', 'Persistent'
|
||||
ReasonChronicity ReasonChronicityTypes `json:"reasonChronicity,omitempty"`
|
||||
// ReportedTime - Timestamp for when the health was last checked.
|
||||
ReportedTime *date.Time `json:"reportedTime,omitempty"`
|
||||
// RecentlyResolvedState - An annotation describing a change in the availabilityState to Available from Unavailable with a reasonType of type Unplanned
|
||||
RecentlyResolvedState *AvailabilityStatusPropertiesRecentlyResolvedState `json:"recentlyResolvedState,omitempty"`
|
||||
// RecommendedActions - Lists actions the user can take based on the current availabilityState of the resource.
|
||||
RecommendedActions *[]RecommendedAction `json:"recommendedActions,omitempty"`
|
||||
// ServiceImpactingEvents - Lists the service impacting events that may be affecting the health of the resource.
|
||||
ServiceImpactingEvents *[]ServiceImpactingEvent `json:"serviceImpactingEvents,omitempty"`
|
||||
}
|
||||
|
||||
// AvailabilityStatusPropertiesRecentlyResolvedState an annotation describing a change in the availabilityState to
|
||||
// Available from Unavailable with a reasonType of type Unplanned
|
||||
type AvailabilityStatusPropertiesRecentlyResolvedState struct {
|
||||
// UnavailableOccurredTime - Timestamp for when the availabilityState changed to Unavailable
|
||||
UnavailableOccurredTime *date.Time `json:"unavailableOccurredTime,omitempty"`
|
||||
// ResolvedTime - Timestamp when the availabilityState changes to Available.
|
||||
ResolvedTime *date.Time `json:"resolvedTime,omitempty"`
|
||||
// UnavailabilitySummary - Brief description of cause of the resource becoming unavailable.
|
||||
UnavailabilitySummary *string `json:"unavailabilitySummary,omitempty"`
|
||||
}
|
||||
|
||||
// ErrorResponse error details.
|
||||
type ErrorResponse struct {
|
||||
// Code - The error code.
|
||||
Code *string `json:"code,omitempty"`
|
||||
// Message - The error message.
|
||||
Message *string `json:"message,omitempty"`
|
||||
// Details - The error details.
|
||||
Details *string `json:"details,omitempty"`
|
||||
}
|
||||
|
||||
// Operation operation available in the resourcehealth resource provider.
|
||||
type Operation struct {
|
||||
// Name - Name of the operation.
|
||||
Name *string `json:"name,omitempty"`
|
||||
// Display - Properties of the operation.
|
||||
Display *OperationDisplay `json:"display,omitempty"`
|
||||
}
|
||||
|
||||
// OperationDisplay properties of the operation.
|
||||
type OperationDisplay struct {
|
||||
// Provider - Provider name.
|
||||
Provider *string `json:"provider,omitempty"`
|
||||
// Resource - Resource name.
|
||||
Resource *string `json:"resource,omitempty"`
|
||||
// Operation - Operation.
|
||||
Operation *string `json:"operation,omitempty"`
|
||||
// Description - Description of the operation.
|
||||
Description *string `json:"description,omitempty"`
|
||||
}
|
||||
|
||||
// OperationListResult lists the operations response.
|
||||
type OperationListResult struct {
|
||||
autorest.Response `json:"-"`
|
||||
// Value - List of operations available in the resourcehealth resource provider.
|
||||
Value *[]Operation `json:"value,omitempty"`
|
||||
}
|
||||
|
||||
// RecommendedAction lists actions the user can take based on the current availabilityState of the resource.
|
||||
type RecommendedAction struct {
|
||||
// Action - Recommended action.
|
||||
Action *string `json:"action,omitempty"`
|
||||
// ActionURL - Link to the action
|
||||
ActionURL *string `json:"actionUrl,omitempty"`
|
||||
// ActionURLText - Substring of action, it describes which text should host the action url.
|
||||
ActionURLText *string `json:"actionUrlText,omitempty"`
|
||||
}
|
||||
|
||||
// ServiceImpactingEvent lists the service impacting events that may be affecting the health of the resource.
|
||||
type ServiceImpactingEvent struct {
|
||||
// EventStartTime - Timestamp for when the event started.
|
||||
EventStartTime *date.Time `json:"eventStartTime,omitempty"`
|
||||
// EventStatusLastModifiedTime - Timestamp for when event was submitted/detected.
|
||||
EventStatusLastModifiedTime *date.Time `json:"eventStatusLastModifiedTime,omitempty"`
|
||||
// CorrelationID - Correlation id for the event
|
||||
CorrelationID *string `json:"correlationId,omitempty"`
|
||||
// Status - Status of the service impacting event.
|
||||
Status *ServiceImpactingEventStatus `json:"status,omitempty"`
|
||||
// IncidentProperties - Properties of the service impacting event.
|
||||
IncidentProperties *ServiceImpactingEventIncidentProperties `json:"incidentProperties,omitempty"`
|
||||
}
|
||||
|
||||
// ServiceImpactingEventIncidentProperties properties of the service impacting event.
|
||||
type ServiceImpactingEventIncidentProperties struct {
|
||||
// Title - Title of the incident.
|
||||
Title *string `json:"title,omitempty"`
|
||||
// Service - Service impacted by the event.
|
||||
Service *string `json:"service,omitempty"`
|
||||
// Region - Region impacted by the event.
|
||||
Region *string `json:"region,omitempty"`
|
||||
// IncidentType - Type of Event.
|
||||
IncidentType *string `json:"incidentType,omitempty"`
|
||||
}
|
||||
|
||||
// ServiceImpactingEventStatus status of the service impacting event.
|
||||
type ServiceImpactingEventStatus struct {
|
||||
// Value - Current status of the event
|
||||
Value *string `json:"value,omitempty"`
|
||||
}
|
||||
Generated
Vendored
+98
@@ -0,0 +1,98 @@
|
||||
package resourcehealth
|
||||
|
||||
// Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
//
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
"github.com/Azure/go-autorest/autorest/azure"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// OperationsClient is the the Resource Health Client.
|
||||
type OperationsClient struct {
|
||||
BaseClient
|
||||
}
|
||||
|
||||
// NewOperationsClient creates an instance of the OperationsClient client.
|
||||
func NewOperationsClient(subscriptionID string) OperationsClient {
|
||||
return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client.
|
||||
func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient {
|
||||
return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// List lists available operations for the resourcehealth resource provider
|
||||
func (client OperationsClient) List(ctx context.Context) (result OperationListResult, err error) {
|
||||
req, err := client.ListPreparer(ctx)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resourcehealth.OperationsClient", "List", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "resourcehealth.OperationsClient", "List", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resourcehealth.OperationsClient", "List", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListPreparer prepares the List request.
|
||||
func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) {
|
||||
const APIVersion = "2015-01-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPath("/providers/Microsoft.ResourceHealth/operations"),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// ListSender sends the List request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
|
||||
}
|
||||
|
||||
// ListResponder handles the response to the List request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
Generated
Vendored
+28
@@ -0,0 +1,28 @@
|
||||
package resourcehealth
|
||||
|
||||
// Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
//
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
// UserAgent returns the UserAgent string to use when sending http.Requests.
|
||||
func UserAgent() string {
|
||||
return "Azure-SDK-For-Go/v12.2.0-beta services"
|
||||
}
|
||||
|
||||
// Version returns the semantic version (see http://semver.org) of the client.
|
||||
func Version() string {
|
||||
return "v12.2.0-beta"
|
||||
}
|
||||
Generated
Vendored
+426
@@ -0,0 +1,426 @@
|
||||
package resourcehealth
|
||||
|
||||
// Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
//
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
"github.com/Azure/go-autorest/autorest/azure"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// AvailabilityStatusesClient is the the Resource Health Client.
|
||||
type AvailabilityStatusesClient struct {
|
||||
BaseClient
|
||||
}
|
||||
|
||||
// NewAvailabilityStatusesClient creates an instance of the AvailabilityStatusesClient client.
|
||||
func NewAvailabilityStatusesClient(subscriptionID string) AvailabilityStatusesClient {
|
||||
return NewAvailabilityStatusesClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewAvailabilityStatusesClientWithBaseURI creates an instance of the AvailabilityStatusesClient client.
|
||||
func NewAvailabilityStatusesClientWithBaseURI(baseURI string, subscriptionID string) AvailabilityStatusesClient {
|
||||
return AvailabilityStatusesClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// GetByResource gets current availability status for a single resource
|
||||
//
|
||||
// resourceURI is the fully qualified ID of the resource, including the resource name and resource type. Currently the
|
||||
// API support not nested and one nesting level resource types :
|
||||
// /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}
|
||||
// and
|
||||
// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}
|
||||
// filter is the filter to apply on the operation. For more information please see
|
||||
// https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN expand is setting
|
||||
// $expand=recommendedactions in url query expands the recommendedactions in the response.
|
||||
func (client AvailabilityStatusesClient) GetByResource(ctx context.Context, resourceURI string, filter string, expand string) (result AvailabilityStatus, err error) {
|
||||
req, err := client.GetByResourcePreparer(ctx, resourceURI, filter, expand)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resourcehealth.AvailabilityStatusesClient", "GetByResource", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.GetByResourceSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "resourcehealth.AvailabilityStatusesClient", "GetByResource", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.GetByResourceResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resourcehealth.AvailabilityStatusesClient", "GetByResource", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// GetByResourcePreparer prepares the GetByResource request.
|
||||
func (client AvailabilityStatusesClient) GetByResourcePreparer(ctx context.Context, resourceURI string, filter string, expand string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceUri": resourceURI,
|
||||
}
|
||||
|
||||
const APIVersion = "2017-07-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
if len(filter) > 0 {
|
||||
queryParameters["$filter"] = autorest.Encode("query", filter)
|
||||
}
|
||||
if len(expand) > 0 {
|
||||
queryParameters["$expand"] = autorest.Encode("query", expand)
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/{resourceUri}/providers/Microsoft.ResourceHealth/availabilityStatuses/current", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// GetByResourceSender sends the GetByResource request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client AvailabilityStatusesClient) GetByResourceSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
|
||||
}
|
||||
|
||||
// GetByResourceResponder handles the response to the GetByResource request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client AvailabilityStatusesClient) GetByResourceResponder(resp *http.Response) (result AvailabilityStatus, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// List lists all historical availability transitions and impacting events for a single resource. Use the nextLink
|
||||
// property in the response to get the next page of availability status
|
||||
//
|
||||
// resourceURI is the fully qualified ID of the resource, including the resource name and resource type. Currently the
|
||||
// API support not nested and one nesting level resource types :
|
||||
// /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}
|
||||
// and
|
||||
// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}
|
||||
// filter is the filter to apply on the operation. For more information please see
|
||||
// https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN expand is setting
|
||||
// $expand=recommendedactions in url query expands the recommendedactions in the response.
|
||||
func (client AvailabilityStatusesClient) List(ctx context.Context, resourceURI string, filter string, expand string) (result AvailabilityStatusListResultPage, err error) {
|
||||
result.fn = client.listNextResults
|
||||
req, err := client.ListPreparer(ctx, resourceURI, filter, expand)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resourcehealth.AvailabilityStatusesClient", "List", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListSender(req)
|
||||
if err != nil {
|
||||
result.aslr.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "resourcehealth.AvailabilityStatusesClient", "List", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result.aslr, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resourcehealth.AvailabilityStatusesClient", "List", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListPreparer prepares the List request.
|
||||
func (client AvailabilityStatusesClient) ListPreparer(ctx context.Context, resourceURI string, filter string, expand string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceUri": resourceURI,
|
||||
}
|
||||
|
||||
const APIVersion = "2017-07-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
if len(filter) > 0 {
|
||||
queryParameters["$filter"] = autorest.Encode("query", filter)
|
||||
}
|
||||
if len(expand) > 0 {
|
||||
queryParameters["$expand"] = autorest.Encode("query", expand)
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/{resourceUri}/providers/Microsoft.ResourceHealth/availabilityStatuses", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// ListSender sends the List request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client AvailabilityStatusesClient) ListSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
|
||||
}
|
||||
|
||||
// ListResponder handles the response to the List request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client AvailabilityStatusesClient) ListResponder(resp *http.Response) (result AvailabilityStatusListResult, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// listNextResults retrieves the next set of results, if any.
|
||||
func (client AvailabilityStatusesClient) listNextResults(lastResults AvailabilityStatusListResult) (result AvailabilityStatusListResult, err error) {
|
||||
req, err := lastResults.availabilityStatusListResultPreparer()
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "resourcehealth.AvailabilityStatusesClient", "listNextResults", nil, "Failure preparing next results request")
|
||||
}
|
||||
if req == nil {
|
||||
return
|
||||
}
|
||||
resp, err := client.ListSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return result, autorest.NewErrorWithError(err, "resourcehealth.AvailabilityStatusesClient", "listNextResults", resp, "Failure sending next results request")
|
||||
}
|
||||
result, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resourcehealth.AvailabilityStatusesClient", "listNextResults", resp, "Failure responding to next results request")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// ListComplete enumerates all values, automatically crossing page boundaries as required.
|
||||
func (client AvailabilityStatusesClient) ListComplete(ctx context.Context, resourceURI string, filter string, expand string) (result AvailabilityStatusListResultIterator, err error) {
|
||||
result.page, err = client.List(ctx, resourceURI, filter, expand)
|
||||
return
|
||||
}
|
||||
|
||||
// ListByResourceGroup lists the current availability status for all the resources in the resource group. Use the
|
||||
// nextLink property in the response to get the next page of availability statuses.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. filter is the filter to apply on the operation. For more
|
||||
// information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN expand is
|
||||
// setting $expand=recommendedactions in url query expands the recommendedactions in the response.
|
||||
func (client AvailabilityStatusesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, filter string, expand string) (result AvailabilityStatusListResultPage, err error) {
|
||||
result.fn = client.listByResourceGroupNextResults
|
||||
req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, filter, expand)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resourcehealth.AvailabilityStatusesClient", "ListByResourceGroup", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListByResourceGroupSender(req)
|
||||
if err != nil {
|
||||
result.aslr.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "resourcehealth.AvailabilityStatusesClient", "ListByResourceGroup", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result.aslr, err = client.ListByResourceGroupResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resourcehealth.AvailabilityStatusesClient", "ListByResourceGroup", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListByResourceGroupPreparer prepares the ListByResourceGroup request.
|
||||
func (client AvailabilityStatusesClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string, filter string, expand string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-07-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
if len(filter) > 0 {
|
||||
queryParameters["$filter"] = autorest.Encode("query", filter)
|
||||
}
|
||||
if len(expand) > 0 {
|
||||
queryParameters["$expand"] = autorest.Encode("query", expand)
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ResourceHealth/availabilityStatuses", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client AvailabilityStatusesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client AvailabilityStatusesClient) ListByResourceGroupResponder(resp *http.Response) (result AvailabilityStatusListResult, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// listByResourceGroupNextResults retrieves the next set of results, if any.
|
||||
func (client AvailabilityStatusesClient) listByResourceGroupNextResults(lastResults AvailabilityStatusListResult) (result AvailabilityStatusListResult, err error) {
|
||||
req, err := lastResults.availabilityStatusListResultPreparer()
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "resourcehealth.AvailabilityStatusesClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request")
|
||||
}
|
||||
if req == nil {
|
||||
return
|
||||
}
|
||||
resp, err := client.ListByResourceGroupSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return result, autorest.NewErrorWithError(err, "resourcehealth.AvailabilityStatusesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request")
|
||||
}
|
||||
result, err = client.ListByResourceGroupResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resourcehealth.AvailabilityStatusesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required.
|
||||
func (client AvailabilityStatusesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, filter string, expand string) (result AvailabilityStatusListResultIterator, err error) {
|
||||
result.page, err = client.ListByResourceGroup(ctx, resourceGroupName, filter, expand)
|
||||
return
|
||||
}
|
||||
|
||||
// ListBySubscriptionID lists the current availability status for all the resources in the subscription. Use the
|
||||
// nextLink property in the response to get the next page of availability statuses.
|
||||
//
|
||||
// filter is the filter to apply on the operation. For more information please see
|
||||
// https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN expand is setting
|
||||
// $expand=recommendedactions in url query expands the recommendedactions in the response.
|
||||
func (client AvailabilityStatusesClient) ListBySubscriptionID(ctx context.Context, filter string, expand string) (result AvailabilityStatusListResultPage, err error) {
|
||||
result.fn = client.listBySubscriptionIDNextResults
|
||||
req, err := client.ListBySubscriptionIDPreparer(ctx, filter, expand)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resourcehealth.AvailabilityStatusesClient", "ListBySubscriptionID", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListBySubscriptionIDSender(req)
|
||||
if err != nil {
|
||||
result.aslr.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "resourcehealth.AvailabilityStatusesClient", "ListBySubscriptionID", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result.aslr, err = client.ListBySubscriptionIDResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resourcehealth.AvailabilityStatusesClient", "ListBySubscriptionID", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListBySubscriptionIDPreparer prepares the ListBySubscriptionID request.
|
||||
func (client AvailabilityStatusesClient) ListBySubscriptionIDPreparer(ctx context.Context, filter string, expand string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-07-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
if len(filter) > 0 {
|
||||
queryParameters["$filter"] = autorest.Encode("query", filter)
|
||||
}
|
||||
if len(expand) > 0 {
|
||||
queryParameters["$expand"] = autorest.Encode("query", expand)
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ResourceHealth/availabilityStatuses", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// ListBySubscriptionIDSender sends the ListBySubscriptionID request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client AvailabilityStatusesClient) ListBySubscriptionIDSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// ListBySubscriptionIDResponder handles the response to the ListBySubscriptionID request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client AvailabilityStatusesClient) ListBySubscriptionIDResponder(resp *http.Response) (result AvailabilityStatusListResult, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// listBySubscriptionIDNextResults retrieves the next set of results, if any.
|
||||
func (client AvailabilityStatusesClient) listBySubscriptionIDNextResults(lastResults AvailabilityStatusListResult) (result AvailabilityStatusListResult, err error) {
|
||||
req, err := lastResults.availabilityStatusListResultPreparer()
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "resourcehealth.AvailabilityStatusesClient", "listBySubscriptionIDNextResults", nil, "Failure preparing next results request")
|
||||
}
|
||||
if req == nil {
|
||||
return
|
||||
}
|
||||
resp, err := client.ListBySubscriptionIDSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return result, autorest.NewErrorWithError(err, "resourcehealth.AvailabilityStatusesClient", "listBySubscriptionIDNextResults", resp, "Failure sending next results request")
|
||||
}
|
||||
result, err = client.ListBySubscriptionIDResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resourcehealth.AvailabilityStatusesClient", "listBySubscriptionIDNextResults", resp, "Failure responding to next results request")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// ListBySubscriptionIDComplete enumerates all values, automatically crossing page boundaries as required.
|
||||
func (client AvailabilityStatusesClient) ListBySubscriptionIDComplete(ctx context.Context, filter string, expand string) (result AvailabilityStatusListResultIterator, err error) {
|
||||
result.page, err = client.ListBySubscriptionID(ctx, filter, expand)
|
||||
return
|
||||
}
|
||||
Generated
Vendored
+51
@@ -0,0 +1,51 @@
|
||||
// Package resourcehealth implements the Azure ARM Resourcehealth service API version 2017-07-01.
|
||||
//
|
||||
// The Resource Health Client.
|
||||
package resourcehealth
|
||||
|
||||
// Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
//
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
import (
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
)
|
||||
|
||||
const (
|
||||
// DefaultBaseURI is the default URI used for the service Resourcehealth
|
||||
DefaultBaseURI = "https://management.azure.com"
|
||||
)
|
||||
|
||||
// BaseClient is the base client for Resourcehealth.
|
||||
type BaseClient struct {
|
||||
autorest.Client
|
||||
BaseURI string
|
||||
SubscriptionID string
|
||||
}
|
||||
|
||||
// New creates an instance of the BaseClient client.
|
||||
func New(subscriptionID string) BaseClient {
|
||||
return NewWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewWithBaseURI creates an instance of the BaseClient client.
|
||||
func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient {
|
||||
return BaseClient{
|
||||
Client: autorest.NewClientWithUserAgent(UserAgent()),
|
||||
BaseURI: baseURI,
|
||||
SubscriptionID: subscriptionID,
|
||||
}
|
||||
}
|
||||
Generated
Vendored
+290
@@ -0,0 +1,290 @@
|
||||
package resourcehealth
|
||||
|
||||
// Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
//
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
import (
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
"github.com/Azure/go-autorest/autorest/date"
|
||||
"github.com/Azure/go-autorest/autorest/to"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// AvailabilityStateValues enumerates the values for availability state values.
|
||||
type AvailabilityStateValues string
|
||||
|
||||
const (
|
||||
// Available ...
|
||||
Available AvailabilityStateValues = "Available"
|
||||
// Unavailable ...
|
||||
Unavailable AvailabilityStateValues = "Unavailable"
|
||||
// Unknown ...
|
||||
Unknown AvailabilityStateValues = "Unknown"
|
||||
)
|
||||
|
||||
// ReasonChronicityTypes enumerates the values for reason chronicity types.
|
||||
type ReasonChronicityTypes string
|
||||
|
||||
const (
|
||||
// Persistent ...
|
||||
Persistent ReasonChronicityTypes = "Persistent"
|
||||
// Transient ...
|
||||
Transient ReasonChronicityTypes = "Transient"
|
||||
)
|
||||
|
||||
// AvailabilityStatus availabilityStatus of a resource.
|
||||
type AvailabilityStatus struct {
|
||||
autorest.Response `json:"-"`
|
||||
// ID - Azure Resource Manager Identity for the availabilityStatuses resource.
|
||||
ID *string `json:"id,omitempty"`
|
||||
// Name - current.
|
||||
Name *string `json:"name,omitempty"`
|
||||
// Type - Microsoft.ResourceHealth/AvailabilityStatuses.
|
||||
Type *string `json:"type,omitempty"`
|
||||
// Location - Azure Resource Manager geo location of the resource.
|
||||
Location *string `json:"location,omitempty"`
|
||||
// Properties - Properties of availability state.
|
||||
Properties *AvailabilityStatusProperties `json:"properties,omitempty"`
|
||||
}
|
||||
|
||||
// AvailabilityStatusListResult the List availabilityStatus operation response.
|
||||
type AvailabilityStatusListResult struct {
|
||||
autorest.Response `json:"-"`
|
||||
// Value - The list of availabilityStatuses.
|
||||
Value *[]AvailabilityStatus `json:"value,omitempty"`
|
||||
// NextLink - The URI to fetch the next page of availabilityStatuses. Call ListNext() with this URI to fetch the next page of availabilityStatuses.
|
||||
NextLink *string `json:"nextLink,omitempty"`
|
||||
}
|
||||
|
||||
// AvailabilityStatusListResultIterator provides access to a complete listing of AvailabilityStatus values.
|
||||
type AvailabilityStatusListResultIterator struct {
|
||||
i int
|
||||
page AvailabilityStatusListResultPage
|
||||
}
|
||||
|
||||
// Next advances to the next value. If there was an error making
|
||||
// the request the iterator does not advance and the error is returned.
|
||||
func (iter *AvailabilityStatusListResultIterator) Next() error {
|
||||
iter.i++
|
||||
if iter.i < len(iter.page.Values()) {
|
||||
return nil
|
||||
}
|
||||
err := iter.page.Next()
|
||||
if err != nil {
|
||||
iter.i--
|
||||
return err
|
||||
}
|
||||
iter.i = 0
|
||||
return nil
|
||||
}
|
||||
|
||||
// NotDone returns true if the enumeration should be started or is not yet complete.
|
||||
func (iter AvailabilityStatusListResultIterator) NotDone() bool {
|
||||
return iter.page.NotDone() && iter.i < len(iter.page.Values())
|
||||
}
|
||||
|
||||
// Response returns the raw server response from the last page request.
|
||||
func (iter AvailabilityStatusListResultIterator) Response() AvailabilityStatusListResult {
|
||||
return iter.page.Response()
|
||||
}
|
||||
|
||||
// Value returns the current value or a zero-initialized value if the
|
||||
// iterator has advanced beyond the end of the collection.
|
||||
func (iter AvailabilityStatusListResultIterator) Value() AvailabilityStatus {
|
||||
if !iter.page.NotDone() {
|
||||
return AvailabilityStatus{}
|
||||
}
|
||||
return iter.page.Values()[iter.i]
|
||||
}
|
||||
|
||||
// IsEmpty returns true if the ListResult contains no values.
|
||||
func (aslr AvailabilityStatusListResult) IsEmpty() bool {
|
||||
return aslr.Value == nil || len(*aslr.Value) == 0
|
||||
}
|
||||
|
||||
// availabilityStatusListResultPreparer prepares a request to retrieve the next set of results.
|
||||
// It returns nil if no more results exist.
|
||||
func (aslr AvailabilityStatusListResult) availabilityStatusListResultPreparer() (*http.Request, error) {
|
||||
if aslr.NextLink == nil || len(to.String(aslr.NextLink)) < 1 {
|
||||
return nil, nil
|
||||
}
|
||||
return autorest.Prepare(&http.Request{},
|
||||
autorest.AsJSON(),
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(to.String(aslr.NextLink)))
|
||||
}
|
||||
|
||||
// AvailabilityStatusListResultPage contains a page of AvailabilityStatus values.
|
||||
type AvailabilityStatusListResultPage struct {
|
||||
fn func(AvailabilityStatusListResult) (AvailabilityStatusListResult, error)
|
||||
aslr AvailabilityStatusListResult
|
||||
}
|
||||
|
||||
// Next advances to the next page of values. If there was an error making
|
||||
// the request the page does not advance and the error is returned.
|
||||
func (page *AvailabilityStatusListResultPage) Next() error {
|
||||
next, err := page.fn(page.aslr)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
page.aslr = next
|
||||
return nil
|
||||
}
|
||||
|
||||
// NotDone returns true if the page enumeration should be started or is not yet complete.
|
||||
func (page AvailabilityStatusListResultPage) NotDone() bool {
|
||||
return !page.aslr.IsEmpty()
|
||||
}
|
||||
|
||||
// Response returns the raw server response from the last page request.
|
||||
func (page AvailabilityStatusListResultPage) Response() AvailabilityStatusListResult {
|
||||
return page.aslr
|
||||
}
|
||||
|
||||
// Values returns the slice of values for the current page or nil if there are no values.
|
||||
func (page AvailabilityStatusListResultPage) Values() []AvailabilityStatus {
|
||||
if page.aslr.IsEmpty() {
|
||||
return nil
|
||||
}
|
||||
return *page.aslr.Value
|
||||
}
|
||||
|
||||
// AvailabilityStatusProperties properties of availability state.
|
||||
type AvailabilityStatusProperties struct {
|
||||
// AvailabilityState - Availability status of the resource. When it is null, this availabilityStatus object represents an availability impacting event. Possible values include: 'Available', 'Unavailable', 'Unknown'
|
||||
AvailabilityState AvailabilityStateValues `json:"availabilityState,omitempty"`
|
||||
// Summary - Summary description of the availability status.
|
||||
Summary *string `json:"summary,omitempty"`
|
||||
// DetailedStatus - Details of the availability status.
|
||||
DetailedStatus *string `json:"detailedStatus,omitempty"`
|
||||
// ReasonType - When the resource's availabilityState is Unavailable, it describes where the health impacting event was originated. Examples are planned, unplanned, user initiated or an outage etc.
|
||||
ReasonType *string `json:"reasonType,omitempty"`
|
||||
// RootCauseAttributionTime - When the resource's availabilityState is Unavailable, it provides the Timestamp for when the health impacting event was received.
|
||||
RootCauseAttributionTime *date.Time `json:"rootCauseAttributionTime,omitempty"`
|
||||
// HealthEventType - In case of an availability impacting event, it describes when the health impacting event was originated. Examples are Lifecycle, Downtime, Fault Analysis etc.
|
||||
HealthEventType *string `json:"healthEventType,omitempty"`
|
||||
// HealthEventCause - In case of an availability impacting event, it describes where the health impacting event was originated. Examples are PlatformInitiated, UserInitiated etc.
|
||||
HealthEventCause *string `json:"healthEventCause,omitempty"`
|
||||
// HealthEventCategory - In case of an availability impacting event, it describes the category of a PlatformInitiated health impacting event. Examples are Planned, Unplanned etc.
|
||||
HealthEventCategory *string `json:"healthEventCategory,omitempty"`
|
||||
// HealthEventID - It is a unique Id that identifies the event
|
||||
HealthEventID *string `json:"healthEventId,omitempty"`
|
||||
// ResolutionETA - When the resource's availabilityState is Unavailable and the reasonType is not User Initiated, it provides the date and time for when the issue is expected to be resolved.
|
||||
ResolutionETA *date.Time `json:"resolutionETA,omitempty"`
|
||||
// OccuredTime - Timestamp for when last change in health status occurred.
|
||||
OccuredTime *date.Time `json:"occuredTime,omitempty"`
|
||||
// ReasonChronicity - Chronicity of the availability transition. Possible values include: 'Transient', 'Persistent'
|
||||
ReasonChronicity ReasonChronicityTypes `json:"reasonChronicity,omitempty"`
|
||||
// ReportedTime - Timestamp for when the health was last checked.
|
||||
ReportedTime *date.Time `json:"reportedTime,omitempty"`
|
||||
// RecentlyResolvedState - An annotation describing a change in the availabilityState to Available from Unavailable with a reasonType of type Unplanned
|
||||
RecentlyResolvedState *AvailabilityStatusPropertiesRecentlyResolvedState `json:"recentlyResolvedState,omitempty"`
|
||||
// RecommendedActions - Lists actions the user can take based on the current availabilityState of the resource.
|
||||
RecommendedActions *[]RecommendedAction `json:"recommendedActions,omitempty"`
|
||||
// ServiceImpactingEvents - Lists the service impacting events that may be affecting the health of the resource.
|
||||
ServiceImpactingEvents *[]ServiceImpactingEvent `json:"serviceImpactingEvents,omitempty"`
|
||||
}
|
||||
|
||||
// AvailabilityStatusPropertiesRecentlyResolvedState an annotation describing a change in the availabilityState to
|
||||
// Available from Unavailable with a reasonType of type Unplanned
|
||||
type AvailabilityStatusPropertiesRecentlyResolvedState struct {
|
||||
// UnavailableOccurredTime - Timestamp for when the availabilityState changed to Unavailable
|
||||
UnavailableOccurredTime *date.Time `json:"unavailableOccurredTime,omitempty"`
|
||||
// ResolvedTime - Timestamp when the availabilityState changes to Available.
|
||||
ResolvedTime *date.Time `json:"resolvedTime,omitempty"`
|
||||
// UnavailabilitySummary - Brief description of cause of the resource becoming unavailable.
|
||||
UnavailabilitySummary *string `json:"unavailabilitySummary,omitempty"`
|
||||
}
|
||||
|
||||
// ErrorResponse error details.
|
||||
type ErrorResponse struct {
|
||||
// Code - The error code.
|
||||
Code *string `json:"code,omitempty"`
|
||||
// Message - The error message.
|
||||
Message *string `json:"message,omitempty"`
|
||||
// Details - The error details.
|
||||
Details *string `json:"details,omitempty"`
|
||||
}
|
||||
|
||||
// Operation operation available in the resourcehealth resource provider.
|
||||
type Operation struct {
|
||||
// Name - Name of the operation.
|
||||
Name *string `json:"name,omitempty"`
|
||||
// Display - Properties of the operation.
|
||||
Display *OperationDisplay `json:"display,omitempty"`
|
||||
}
|
||||
|
||||
// OperationDisplay properties of the operation.
|
||||
type OperationDisplay struct {
|
||||
// Provider - Provider name.
|
||||
Provider *string `json:"provider,omitempty"`
|
||||
// Resource - Resource name.
|
||||
Resource *string `json:"resource,omitempty"`
|
||||
// Operation - Operation.
|
||||
Operation *string `json:"operation,omitempty"`
|
||||
// Description - Description of the operation.
|
||||
Description *string `json:"description,omitempty"`
|
||||
}
|
||||
|
||||
// OperationListResult lists the operations response.
|
||||
type OperationListResult struct {
|
||||
autorest.Response `json:"-"`
|
||||
// Value - List of operations available in the resourcehealth resource provider.
|
||||
Value *[]Operation `json:"value,omitempty"`
|
||||
}
|
||||
|
||||
// RecommendedAction lists actions the user can take based on the current availabilityState of the resource.
|
||||
type RecommendedAction struct {
|
||||
// Action - Recommended action.
|
||||
Action *string `json:"action,omitempty"`
|
||||
// ActionURL - Link to the action
|
||||
ActionURL *string `json:"actionUrl,omitempty"`
|
||||
// ActionURLText - Substring of action, it describes which text should host the action url.
|
||||
ActionURLText *string `json:"actionUrlText,omitempty"`
|
||||
}
|
||||
|
||||
// ServiceImpactingEvent lists the service impacting events that may be affecting the health of the resource.
|
||||
type ServiceImpactingEvent struct {
|
||||
// EventStartTime - Timestamp for when the event started.
|
||||
EventStartTime *date.Time `json:"eventStartTime,omitempty"`
|
||||
// EventStatusLastModifiedTime - Timestamp for when event was submitted/detected.
|
||||
EventStatusLastModifiedTime *date.Time `json:"eventStatusLastModifiedTime,omitempty"`
|
||||
// CorrelationID - Correlation id for the event
|
||||
CorrelationID *string `json:"correlationId,omitempty"`
|
||||
// Status - Status of the service impacting event.
|
||||
Status *ServiceImpactingEventStatus `json:"status,omitempty"`
|
||||
// IncidentProperties - Properties of the service impacting event.
|
||||
IncidentProperties *ServiceImpactingEventIncidentProperties `json:"incidentProperties,omitempty"`
|
||||
}
|
||||
|
||||
// ServiceImpactingEventIncidentProperties properties of the service impacting event.
|
||||
type ServiceImpactingEventIncidentProperties struct {
|
||||
// Title - Title of the incident.
|
||||
Title *string `json:"title,omitempty"`
|
||||
// Service - Service impacted by the event.
|
||||
Service *string `json:"service,omitempty"`
|
||||
// Region - Region impacted by the event.
|
||||
Region *string `json:"region,omitempty"`
|
||||
// IncidentType - Type of Event.
|
||||
IncidentType *string `json:"incidentType,omitempty"`
|
||||
}
|
||||
|
||||
// ServiceImpactingEventStatus status of the service impacting event.
|
||||
type ServiceImpactingEventStatus struct {
|
||||
// Value - Current status of the event
|
||||
Value *string `json:"value,omitempty"`
|
||||
}
|
||||
Generated
Vendored
+98
@@ -0,0 +1,98 @@
|
||||
package resourcehealth
|
||||
|
||||
// Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
//
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
"github.com/Azure/go-autorest/autorest/azure"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// OperationsClient is the the Resource Health Client.
|
||||
type OperationsClient struct {
|
||||
BaseClient
|
||||
}
|
||||
|
||||
// NewOperationsClient creates an instance of the OperationsClient client.
|
||||
func NewOperationsClient(subscriptionID string) OperationsClient {
|
||||
return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client.
|
||||
func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient {
|
||||
return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// List lists available operations for the resourcehealth resource provider
|
||||
func (client OperationsClient) List(ctx context.Context) (result OperationListResult, err error) {
|
||||
req, err := client.ListPreparer(ctx)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resourcehealth.OperationsClient", "List", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "resourcehealth.OperationsClient", "List", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resourcehealth.OperationsClient", "List", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListPreparer prepares the List request.
|
||||
func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) {
|
||||
const APIVersion = "2017-07-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPath("/providers/Microsoft.ResourceHealth/operations"),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// ListSender sends the List request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
|
||||
}
|
||||
|
||||
// ListResponder handles the response to the List request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
Generated
Vendored
+28
@@ -0,0 +1,28 @@
|
||||
package resourcehealth
|
||||
|
||||
// Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
//
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
// UserAgent returns the UserAgent string to use when sending http.Requests.
|
||||
func UserAgent() string {
|
||||
return "Azure-SDK-For-Go/v12.2.0-beta services"
|
||||
}
|
||||
|
||||
// Version returns the semantic version (see http://semver.org) of the client.
|
||||
func Version() string {
|
||||
return "v12.2.0-beta"
|
||||
}
|
||||
Reference in New Issue
Block a user