vendor: update all dependencies to latest versions

This commit is contained in:
Nick Craig-Wood
2017-09-30 15:27:27 +01:00
parent 911d121bb9
commit b017fcfe9a
3048 changed files with 537055 additions and 189679 deletions
@@ -0,0 +1,172 @@
package recoveryservices
// 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/azure"
"net/http"
)
// BackupStorageConfigsClient is the recovery Services Client
type BackupStorageConfigsClient struct {
ManagementClient
}
// NewBackupStorageConfigsClient creates an instance of the BackupStorageConfigsClient client.
func NewBackupStorageConfigsClient(subscriptionID string) BackupStorageConfigsClient {
return NewBackupStorageConfigsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewBackupStorageConfigsClientWithBaseURI creates an instance of the BackupStorageConfigsClient client.
func NewBackupStorageConfigsClientWithBaseURI(baseURI string, subscriptionID string) BackupStorageConfigsClient {
return BackupStorageConfigsClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// Get fetches resource storage config.
//
// resourceGroupName is the name of the resource group where the recovery services vault is present. vaultName is the
// name of the recovery services vault.
func (client BackupStorageConfigsClient) Get(resourceGroupName string, vaultName string) (result BackupStorageConfig, err error) {
req, err := client.GetPreparer(resourceGroupName, vaultName)
if err != nil {
err = autorest.NewErrorWithError(err, "recoveryservices.BackupStorageConfigsClient", "Get", nil, "Failure preparing request")
return
}
resp, err := client.GetSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "recoveryservices.BackupStorageConfigsClient", "Get", resp, "Failure sending request")
return
}
result, err = client.GetResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "recoveryservices.BackupStorageConfigsClient", "Get", resp, "Failure responding to request")
}
return
}
// GetPreparer prepares the Get request.
func (client BackupStorageConfigsClient) GetPreparer(resourceGroupName string, vaultName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vaultName": autorest.Encode("path", vaultName),
}
const APIVersion = "2016-12-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
// http.Response Body if it receives an error.
func (client BackupStorageConfigsClient) GetSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// GetResponder handles the response to the Get request. The method always
// closes the http.Response Body.
func (client BackupStorageConfigsClient) GetResponder(resp *http.Response) (result BackupStorageConfig, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// Update updates vault storage model type.
//
// resourceGroupName is the name of the resource group where the recovery services vault is present. vaultName is the
// name of the recovery services vault. backupStorageConfig is backup storage config.
func (client BackupStorageConfigsClient) Update(resourceGroupName string, vaultName string, backupStorageConfig BackupStorageConfig) (result autorest.Response, err error) {
req, err := client.UpdatePreparer(resourceGroupName, vaultName, backupStorageConfig)
if err != nil {
err = autorest.NewErrorWithError(err, "recoveryservices.BackupStorageConfigsClient", "Update", nil, "Failure preparing request")
return
}
resp, err := client.UpdateSender(req)
if err != nil {
result.Response = resp
err = autorest.NewErrorWithError(err, "recoveryservices.BackupStorageConfigsClient", "Update", resp, "Failure sending request")
return
}
result, err = client.UpdateResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "recoveryservices.BackupStorageConfigsClient", "Update", resp, "Failure responding to request")
}
return
}
// UpdatePreparer prepares the Update request.
func (client BackupStorageConfigsClient) UpdatePreparer(resourceGroupName string, vaultName string, backupStorageConfig BackupStorageConfig) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vaultName": autorest.Encode("path", vaultName),
}
const APIVersion = "2016-12-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig", pathParameters),
autorest.WithJSON(backupStorageConfig),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// UpdateSender sends the Update request. The method will close the
// http.Response Body if it receives an error.
func (client BackupStorageConfigsClient) UpdateSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// UpdateResponder handles the response to the Update request. The method always
// closes the http.Response Body.
func (client BackupStorageConfigsClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
autorest.ByClosing())
result.Response = resp
return
}
@@ -0,0 +1,173 @@
package recoveryservices
// 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/azure"
"net/http"
)
// BackupVaultConfigsClient is the recovery Services Client
type BackupVaultConfigsClient struct {
ManagementClient
}
// NewBackupVaultConfigsClient creates an instance of the BackupVaultConfigsClient client.
func NewBackupVaultConfigsClient(subscriptionID string) BackupVaultConfigsClient {
return NewBackupVaultConfigsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewBackupVaultConfigsClientWithBaseURI creates an instance of the BackupVaultConfigsClient client.
func NewBackupVaultConfigsClientWithBaseURI(baseURI string, subscriptionID string) BackupVaultConfigsClient {
return BackupVaultConfigsClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// Get fetches vault config.
//
// resourceGroupName is the name of the resource group where the recovery services vault is present. vaultName is the
// name of the recovery services vault.
func (client BackupVaultConfigsClient) Get(resourceGroupName string, vaultName string) (result BackupVaultConfig, err error) {
req, err := client.GetPreparer(resourceGroupName, vaultName)
if err != nil {
err = autorest.NewErrorWithError(err, "recoveryservices.BackupVaultConfigsClient", "Get", nil, "Failure preparing request")
return
}
resp, err := client.GetSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "recoveryservices.BackupVaultConfigsClient", "Get", resp, "Failure sending request")
return
}
result, err = client.GetResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "recoveryservices.BackupVaultConfigsClient", "Get", resp, "Failure responding to request")
}
return
}
// GetPreparer prepares the Get request.
func (client BackupVaultConfigsClient) GetPreparer(resourceGroupName string, vaultName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vaultName": autorest.Encode("path", vaultName),
}
const APIVersion = "2016-12-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupconfig/vaultconfig", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
// http.Response Body if it receives an error.
func (client BackupVaultConfigsClient) GetSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// GetResponder handles the response to the Get request. The method always
// closes the http.Response Body.
func (client BackupVaultConfigsClient) GetResponder(resp *http.Response) (result BackupVaultConfig, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// Update updates vault config model type.
//
// resourceGroupName is the name of the resource group where the recovery services vault is present. vaultName is the
// name of the recovery services vault. backupVaultConfig is backup vault config.
func (client BackupVaultConfigsClient) Update(resourceGroupName string, vaultName string, backupVaultConfig BackupVaultConfig) (result BackupVaultConfig, err error) {
req, err := client.UpdatePreparer(resourceGroupName, vaultName, backupVaultConfig)
if err != nil {
err = autorest.NewErrorWithError(err, "recoveryservices.BackupVaultConfigsClient", "Update", nil, "Failure preparing request")
return
}
resp, err := client.UpdateSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "recoveryservices.BackupVaultConfigsClient", "Update", resp, "Failure sending request")
return
}
result, err = client.UpdateResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "recoveryservices.BackupVaultConfigsClient", "Update", resp, "Failure responding to request")
}
return
}
// UpdatePreparer prepares the Update request.
func (client BackupVaultConfigsClient) UpdatePreparer(resourceGroupName string, vaultName string, backupVaultConfig BackupVaultConfig) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vaultName": autorest.Encode("path", vaultName),
}
const APIVersion = "2016-12-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupconfig/vaultconfig", pathParameters),
autorest.WithJSON(backupVaultConfig),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// UpdateSender sends the Update request. The method will close the
// http.Response Body if it receives an error.
func (client BackupVaultConfigsClient) UpdateSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// UpdateResponder handles the response to the Update request. The method always
// closes the http.Response Body.
func (client BackupVaultConfigsClient) UpdateResponder(resp *http.Response) (result BackupVaultConfig, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
+4 -6
View File
@@ -1,7 +1,6 @@
// Package recoveryservices implements the Azure ARM Recoveryservices service
// API version 2016-06-01.
//
// Package recoveryservices implements the Azure ARM Recoveryservices service API version .
//
// Recovery Services Client
package recoveryservices
// Copyright (c) Microsoft and contributors. All rights reserved.
@@ -18,9 +17,8 @@ package recoveryservices
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
// 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"
+384 -19
View File
@@ -14,17 +14,46 @@ package recoveryservices
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
import (
"encoding/json"
"errors"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/date"
"github.com/Azure/go-autorest/autorest/to"
"net/http"
)
// AuthType enumerates the values for auth type.
type AuthType string
const (
// AAD specifies the aad state for auth type.
AAD AuthType = "AAD"
// AccessControlService specifies the access control service state for auth type.
AccessControlService AuthType = "AccessControlService"
// ACS specifies the acs state for auth type.
ACS AuthType = "ACS"
// AzureActiveDirectory specifies the azure active directory state for auth type.
AzureActiveDirectory AuthType = "AzureActiveDirectory"
// Invalid specifies the invalid state for auth type.
Invalid AuthType = "Invalid"
)
// EnhancedSecurityState enumerates the values for enhanced security state.
type EnhancedSecurityState string
const (
// EnhancedSecurityStateDisabled specifies the enhanced security state disabled state for enhanced security state.
EnhancedSecurityStateDisabled EnhancedSecurityState = "Disabled"
// EnhancedSecurityStateEnabled specifies the enhanced security state enabled state for enhanced security state.
EnhancedSecurityStateEnabled EnhancedSecurityState = "Enabled"
// EnhancedSecurityStateInvalid specifies the enhanced security state invalid state for enhanced security state.
EnhancedSecurityStateInvalid EnhancedSecurityState = "Invalid"
)
// SkuName enumerates the values for sku name.
type SkuName string
@@ -35,6 +64,42 @@ const (
Standard SkuName = "Standard"
)
// StorageModelType enumerates the values for storage model type.
type StorageModelType string
const (
// StorageModelTypeGeoRedundant specifies the storage model type geo redundant state for storage model type.
StorageModelTypeGeoRedundant StorageModelType = "GeoRedundant"
// StorageModelTypeInvalid specifies the storage model type invalid state for storage model type.
StorageModelTypeInvalid StorageModelType = "Invalid"
// StorageModelTypeLocallyRedundant specifies the storage model type locally redundant state for storage model type.
StorageModelTypeLocallyRedundant StorageModelType = "LocallyRedundant"
)
// StorageType enumerates the values for storage type.
type StorageType string
const (
// StorageTypeGeoRedundant specifies the storage type geo redundant state for storage type.
StorageTypeGeoRedundant StorageType = "GeoRedundant"
// StorageTypeInvalid specifies the storage type invalid state for storage type.
StorageTypeInvalid StorageType = "Invalid"
// StorageTypeLocallyRedundant specifies the storage type locally redundant state for storage type.
StorageTypeLocallyRedundant StorageType = "LocallyRedundant"
)
// StorageTypeState enumerates the values for storage type state.
type StorageTypeState string
const (
// StorageTypeStateInvalid specifies the storage type state invalid state for storage type state.
StorageTypeStateInvalid StorageTypeState = "Invalid"
// StorageTypeStateLocked specifies the storage type state locked state for storage type state.
StorageTypeStateLocked StorageTypeState = "Locked"
// StorageTypeStateUnlocked specifies the storage type state unlocked state for storage type state.
StorageTypeStateUnlocked StorageTypeState = "Unlocked"
)
// TriggerType enumerates the values for trigger type.
type TriggerType string
@@ -45,6 +110,24 @@ const (
UserTriggered TriggerType = "UserTriggered"
)
// UsagesUnit enumerates the values for usages unit.
type UsagesUnit string
const (
// Bytes specifies the bytes state for usages unit.
Bytes UsagesUnit = "Bytes"
// BytesPerSecond specifies the bytes per second state for usages unit.
BytesPerSecond UsagesUnit = "BytesPerSecond"
// Count specifies the count state for usages unit.
Count UsagesUnit = "Count"
// CountPerSecond specifies the count per second state for usages unit.
CountPerSecond UsagesUnit = "CountPerSecond"
// Percent specifies the percent state for usages unit.
Percent UsagesUnit = "Percent"
// Seconds specifies the seconds state for usages unit.
Seconds UsagesUnit = "Seconds"
)
// VaultUpgradeState enumerates the values for vault upgrade state.
type VaultUpgradeState string
@@ -59,6 +142,45 @@ const (
Upgraded VaultUpgradeState = "Upgraded"
)
// BackupStorageConfig is the backup storage config.
type BackupStorageConfig struct {
autorest.Response `json:"-"`
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
Type *string `json:"type,omitempty"`
ETag *string `json:"eTag,omitempty"`
*BackupStorageConfigProperties `json:"properties,omitempty"`
}
// BackupStorageConfigProperties is the backup storage config.
type BackupStorageConfigProperties struct {
StorageModelType StorageModelType `json:"storageModelType,omitempty"`
StorageType StorageType `json:"storageType,omitempty"`
StorageTypeState StorageTypeState `json:"storageTypeState,omitempty"`
}
// BackupVaultConfig is backup vault config details.
type BackupVaultConfig struct {
autorest.Response `json:"-"`
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
Type *string `json:"type,omitempty"`
ETag *string `json:"eTag,omitempty"`
*BackupVaultConfigProperties `json:"properties,omitempty"`
}
// BackupVaultConfigProperties is backup vault config details.
type BackupVaultConfigProperties struct {
StorageType StorageType `json:"storageType,omitempty"`
StorageTypeState StorageTypeState `json:"storageTypeState,omitempty"`
EnhancedSecurityState EnhancedSecurityState `json:"enhancedSecurityState,omitempty"`
}
// CertificateRequest is details of the certificate to be uploaded to the vault.
type CertificateRequest struct {
Properties *RawCertificateData `json:"properties,omitempty"`
}
// ClientDiscoveryDisplay is localized display information of an operation.
type ClientDiscoveryDisplay struct {
Provider *string `json:"Provider,omitempty"`
@@ -67,24 +189,24 @@ type ClientDiscoveryDisplay struct {
Description *string `json:"Description,omitempty"`
}
// ClientDiscoveryForLogSpecification is log specification for the operation.
// ClientDiscoveryForLogSpecification is class to represent shoebox log specification in json client discovery.
type ClientDiscoveryForLogSpecification struct {
Name *string `json:"name,omitempty"`
DisplayName *string `json:"displayName,omitempty"`
BlobDuration *date.Time `json:"blobDuration,omitempty"`
Name *string `json:"name,omitempty"`
DisplayName *string `json:"displayName,omitempty"`
BlobDuration *string `json:"blobDuration,omitempty"`
}
// ClientDiscoveryForServiceSpecification is operation properties.
// ClientDiscoveryForProperties is class to represent shoebox properties in json client discovery.
type ClientDiscoveryForProperties struct {
ServiceSpecification *ClientDiscoveryForServiceSpecification `json:"serviceSpecification,omitempty"`
}
// ClientDiscoveryForServiceSpecification is class to represent shoebox service specification in json client discovery.
type ClientDiscoveryForServiceSpecification struct {
LogSpecifications *[]ClientDiscoveryForLogSpecification `json:"logSpecifications,omitempty"`
}
// ClientDiscoveryProperties is operation properties.
type ClientDiscoveryProperties struct {
ServiceSpecification *ClientDiscoveryForServiceSpecification `json:"serviceSpecification,omitempty"`
}
// ClientDiscoveryResponse is list of available operations.
// ClientDiscoveryResponse is operations List response which contains list of available APIs.
type ClientDiscoveryResponse struct {
autorest.Response `json:"-"`
Value *[]ClientDiscoveryValueForSingleAPI `json:"Value,omitempty"`
@@ -105,13 +227,58 @@ func (client ClientDiscoveryResponse) ClientDiscoveryResponsePreparer() (*http.R
// ClientDiscoveryValueForSingleAPI is available operation details.
type ClientDiscoveryValueForSingleAPI struct {
Name *string `json:"Name,omitempty"`
Display *ClientDiscoveryDisplay `json:"Display,omitempty"`
Origin *string `json:"Origin,omitempty"`
*ClientDiscoveryProperties `json:"Properties,omitempty"`
Name *string `json:"Name,omitempty"`
Display *ClientDiscoveryDisplay `json:"Display,omitempty"`
Origin *string `json:"Origin,omitempty"`
Properties *ClientDiscoveryForProperties `json:"Properties,omitempty"`
}
// Resource is aRM Resource.
// JobsSummary is summary of the replication job data for this vault.
type JobsSummary struct {
FailedJobs *int32 `json:"failedJobs,omitempty"`
SuspendedJobs *int32 `json:"suspendedJobs,omitempty"`
InProgressJobs *int32 `json:"inProgressJobs,omitempty"`
}
// MonitoringSummary is summary of the replication monitoring data for this vault.
type MonitoringSummary struct {
UnHealthyVMCount *int32 `json:"unHealthyVmCount,omitempty"`
UnHealthyProviderCount *int32 `json:"unHealthyProviderCount,omitempty"`
EventsCount *int32 `json:"eventsCount,omitempty"`
DeprecatedProviderCount *int32 `json:"deprecatedProviderCount,omitempty"`
SupportedProviderCount *int32 `json:"supportedProviderCount,omitempty"`
UnsupportedProviderCount *int32 `json:"unsupportedProviderCount,omitempty"`
}
// NameInfo is the name of usage.
type NameInfo struct {
Value *string `json:"value,omitempty"`
LocalizedValue *string `json:"localizedValue,omitempty"`
}
// RawCertificateData is raw certificate data.
type RawCertificateData struct {
AuthType AuthType `json:"authType,omitempty"`
Certificate *[]byte `json:"certificate,omitempty"`
}
// ReplicationUsage is replication usages of a vault.
type ReplicationUsage struct {
MonitoringSummary *MonitoringSummary `json:"monitoringSummary,omitempty"`
JobsSummary *JobsSummary `json:"jobsSummary,omitempty"`
ProtectedItemCount *int32 `json:"protectedItemCount,omitempty"`
RecoveryPlanCount *int32 `json:"recoveryPlanCount,omitempty"`
RegisteredServersCount *int32 `json:"registeredServersCount,omitempty"`
RecoveryServicesProviderAuthType *int32 `json:"recoveryServicesProviderAuthType,omitempty"`
}
// ReplicationUsageList is replication usages for vault.
type ReplicationUsageList struct {
autorest.Response `json:"-"`
Value *[]ReplicationUsage `json:"value,omitempty"`
}
// Resource is ARM Resource.
type Resource struct {
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
@@ -119,6 +286,127 @@ type Resource struct {
ETag *string `json:"eTag,omitempty"`
}
// ResourceCertificateAndAadDetails is certificate details representing the Vault credentials for AAD.
type ResourceCertificateAndAadDetails struct {
Certificate *[]byte `json:"certificate,omitempty"`
FriendlyName *string `json:"friendlyName,omitempty"`
Issuer *string `json:"issuer,omitempty"`
ResourceID *int64 `json:"resourceId,omitempty"`
Subject *string `json:"subject,omitempty"`
Thumbprint *string `json:"thumbprint,omitempty"`
ValidFrom *date.Time `json:"validFrom,omitempty"`
ValidTo *date.Time `json:"validTo,omitempty"`
AuthType AuthType `json:"authType,omitempty"`
AadAuthority *string `json:"aadAuthority,omitempty"`
AadTenantID *string `json:"aadTenantId,omitempty"`
ServicePrincipalClientID *string `json:"servicePrincipalClientId,omitempty"`
ServicePrincipalObjectID *string `json:"servicePrincipalObjectId,omitempty"`
AzureManagementEndpointAudience *string `json:"azureManagementEndpointAudience,omitempty"`
}
// MarshalJSON is the custom marshaler for ResourceCertificateAndAadDetails.
func (rcaad ResourceCertificateAndAadDetails) MarshalJSON() ([]byte, error) {
rcaad.AuthType = AzureActiveDirectory
type Alias ResourceCertificateAndAadDetails
return json.Marshal(&struct {
Alias
}{
Alias: (Alias)(rcaad),
})
}
// AsResourceCertificateAndAadDetails is the ResourceCertificateDetails implementation for ResourceCertificateAndAadDetails.
func (rcaad ResourceCertificateAndAadDetails) AsResourceCertificateAndAadDetails() (*ResourceCertificateAndAadDetails, bool) {
return &rcaad, true
}
// AsResourceCertificateAndAcsDetails is the ResourceCertificateDetails implementation for ResourceCertificateAndAadDetails.
func (rcaad ResourceCertificateAndAadDetails) AsResourceCertificateAndAcsDetails() (*ResourceCertificateAndAcsDetails, bool) {
return nil, false
}
// ResourceCertificateAndAcsDetails is certificate details representing the Vault credentials for ACS.
type ResourceCertificateAndAcsDetails struct {
Certificate *[]byte `json:"certificate,omitempty"`
FriendlyName *string `json:"friendlyName,omitempty"`
Issuer *string `json:"issuer,omitempty"`
ResourceID *int64 `json:"resourceId,omitempty"`
Subject *string `json:"subject,omitempty"`
Thumbprint *string `json:"thumbprint,omitempty"`
ValidFrom *date.Time `json:"validFrom,omitempty"`
ValidTo *date.Time `json:"validTo,omitempty"`
AuthType AuthType `json:"authType,omitempty"`
GlobalAcsNamespace *string `json:"globalAcsNamespace,omitempty"`
GlobalAcsHostName *string `json:"globalAcsHostName,omitempty"`
GlobalAcsRPRealm *string `json:"globalAcsRPRealm,omitempty"`
}
// MarshalJSON is the custom marshaler for ResourceCertificateAndAcsDetails.
func (rcaad ResourceCertificateAndAcsDetails) MarshalJSON() ([]byte, error) {
rcaad.AuthType = AccessControlService
type Alias ResourceCertificateAndAcsDetails
return json.Marshal(&struct {
Alias
}{
Alias: (Alias)(rcaad),
})
}
// AsResourceCertificateAndAadDetails is the ResourceCertificateDetails implementation for ResourceCertificateAndAcsDetails.
func (rcaad ResourceCertificateAndAcsDetails) AsResourceCertificateAndAadDetails() (*ResourceCertificateAndAadDetails, bool) {
return nil, false
}
// AsResourceCertificateAndAcsDetails is the ResourceCertificateDetails implementation for ResourceCertificateAndAcsDetails.
func (rcaad ResourceCertificateAndAcsDetails) AsResourceCertificateAndAcsDetails() (*ResourceCertificateAndAcsDetails, bool) {
return &rcaad, true
}
// ResourceCertificateDetails is certificate details representing the Vault credentials.
type ResourceCertificateDetails interface {
AsResourceCertificateAndAadDetails() (*ResourceCertificateAndAadDetails, bool)
AsResourceCertificateAndAcsDetails() (*ResourceCertificateAndAcsDetails, bool)
}
func unmarshalResourceCertificateDetails(body []byte) (ResourceCertificateDetails, error) {
var m map[string]interface{}
err := json.Unmarshal(body, &m)
if err != nil {
return nil, err
}
switch m["authType"] {
case string(AzureActiveDirectory):
var rcaad ResourceCertificateAndAadDetails
err := json.Unmarshal(body, &rcaad)
return rcaad, err
case string(AccessControlService):
var rcaad ResourceCertificateAndAcsDetails
err := json.Unmarshal(body, &rcaad)
return rcaad, err
default:
return nil, errors.New("Unsupported type")
}
}
func unmarshalResourceCertificateDetailsArray(body []byte) ([]ResourceCertificateDetails, error) {
var rawMessages []*json.RawMessage
err := json.Unmarshal(body, &rawMessages)
if err != nil {
return nil, err
}
rcdArray := make([]ResourceCertificateDetails, len(rawMessages))
for index, rawMessage := range rawMessages {
rcd, err := unmarshalResourceCertificateDetails(*rawMessage)
if err != nil {
return nil, err
}
rcdArray[index] = rcd
}
return rcdArray, nil
}
// Sku is identifies the unique system identifier for each Azure resource.
type Sku struct {
Name SkuName `json:"name,omitempty"`
@@ -160,6 +448,67 @@ type Vault struct {
Sku *Sku `json:"sku,omitempty"`
}
// VaultCertificateResponse is certificate corresponding to a vault that can be used by clients to register themselves
// with the vault.
type VaultCertificateResponse struct {
autorest.Response `json:"-"`
Name *string `json:"name,omitempty"`
Type *string `json:"type,omitempty"`
ID *string `json:"id,omitempty"`
Properties ResourceCertificateDetails `json:"properties,omitempty"`
}
// UnmarshalJSON is the custom unmarshaler for VaultCertificateResponse struct.
func (vcr *VaultCertificateResponse) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
err := json.Unmarshal(body, &m)
if err != nil {
return err
}
var v *json.RawMessage
v = m["name"]
if v != nil {
var name string
err = json.Unmarshal(*m["name"], &name)
if err != nil {
return err
}
vcr.Name = &name
}
v = m["type"]
if v != nil {
var typeVar string
err = json.Unmarshal(*m["type"], &typeVar)
if err != nil {
return err
}
vcr.Type = &typeVar
}
v = m["id"]
if v != nil {
var ID string
err = json.Unmarshal(*m["id"], &ID)
if err != nil {
return err
}
vcr.ID = &ID
}
v = m["properties"]
if v != nil {
properties, err := unmarshalResourceCertificateDetails(*m["properties"])
if err != nil {
return err
}
vcr.Properties = properties
}
return nil
}
// VaultExtendedInfo is vault extended information.
type VaultExtendedInfo struct {
IntegrityKey *string `json:"integrityKey,omitempty"`
@@ -190,3 +539,19 @@ type VaultProperties struct {
ProvisioningState *string `json:"provisioningState,omitempty"`
UpgradeDetails *UpgradeDetails `json:"upgradeDetails,omitempty"`
}
// VaultUsage is usages of a vault.
type VaultUsage struct {
Unit UsagesUnit `json:"unit,omitempty"`
QuotaPeriod *string `json:"quotaPeriod,omitempty"`
NextResetTime *date.Time `json:"nextResetTime,omitempty"`
CurrentValue *int64 `json:"currentValue,omitempty"`
Limit *int64 `json:"limit,omitempty"`
Name *NameInfo `json:"name,omitempty"`
}
// VaultUsageList is usage for vault.
type VaultUsageList struct {
autorest.Response `json:"-"`
Value *[]VaultUsage `json:"value,omitempty"`
}
+53 -19
View File
@@ -14,9 +14,8 @@ package recoveryservices
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
// 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"
@@ -24,8 +23,7 @@ import (
"net/http"
)
// OperationsClient is the client for the Operations methods of the
// Recoveryservices service.
// OperationsClient is the recovery Services Client
type OperationsClient struct {
ManagementClient
}
@@ -35,18 +33,14 @@ func NewOperationsClient(subscriptionID string) OperationsClient {
return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewOperationsClientWithBaseURI creates an instance of the OperationsClient
// client.
// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client.
func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient {
return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// List returns the list of available operations.
//
// resourceGroupName is the name of the resource group where the recovery
// services vault is present.
func (client OperationsClient) List(resourceGroupName string) (result ClientDiscoveryResponse, err error) {
req, err := client.ListPreparer(resourceGroupName)
func (client OperationsClient) List() (result ClientDiscoveryResponse, err error) {
req, err := client.ListPreparer()
if err != nil {
err = autorest.NewErrorWithError(err, "recoveryservices.OperationsClient", "List", nil, "Failure preparing request")
return
@@ -68,12 +62,7 @@ func (client OperationsClient) List(resourceGroupName string) (result ClientDisc
}
// ListPreparer prepares the List request.
func (client OperationsClient) ListPreparer(resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
func (client OperationsClient) ListPreparer() (*http.Request, error) {
const APIVersion = "2016-06-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
@@ -82,7 +71,7 @@ func (client OperationsClient) ListPreparer(resourceGroupName string) (*http.Req
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/operations", pathParameters),
autorest.WithPath("/providers/Microsoft.RecoveryServices/operations"),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
@@ -129,3 +118,48 @@ func (client OperationsClient) ListNextResults(lastResults ClientDiscoveryRespon
return
}
// ListComplete gets all elements from the list without paging.
func (client OperationsClient) ListComplete(cancel <-chan struct{}) (<-chan ClientDiscoveryValueForSingleAPI, <-chan error) {
resultChan := make(chan ClientDiscoveryValueForSingleAPI)
errChan := make(chan error, 1)
go func() {
defer func() {
close(resultChan)
close(errChan)
}()
list, err := client.List()
if err != nil {
errChan <- err
return
}
if list.Value != nil {
for _, item := range *list.Value {
select {
case <-cancel:
return
case resultChan <- item:
// Intentionally left blank
}
}
}
for list.NextLink != nil {
list, err = client.ListNextResults(list)
if err != nil {
errChan <- err
return
}
if list.Value != nil {
for _, item := range *list.Value {
select {
case <-cancel:
return
case resultChan <- item:
// Intentionally left blank
}
}
}
}
}()
return resultChan, errChan
}
@@ -0,0 +1,105 @@
package recoveryservices
// 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/azure"
"net/http"
)
// RegisteredIdentitiesClient is the recovery Services Client
type RegisteredIdentitiesClient struct {
ManagementClient
}
// NewRegisteredIdentitiesClient creates an instance of the RegisteredIdentitiesClient client.
func NewRegisteredIdentitiesClient(subscriptionID string) RegisteredIdentitiesClient {
return NewRegisteredIdentitiesClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewRegisteredIdentitiesClientWithBaseURI creates an instance of the RegisteredIdentitiesClient client.
func NewRegisteredIdentitiesClientWithBaseURI(baseURI string, subscriptionID string) RegisteredIdentitiesClient {
return RegisteredIdentitiesClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// Delete unregisters the given container from your Recovery Services vault.
//
// resourceGroupName is the name of the resource group where the recovery services vault is present. vaultName is the
// name of the recovery services vault. identityName is name of the protection container to unregister.
func (client RegisteredIdentitiesClient) Delete(resourceGroupName string, vaultName string, identityName string) (result autorest.Response, err error) {
req, err := client.DeletePreparer(resourceGroupName, vaultName, identityName)
if err != nil {
err = autorest.NewErrorWithError(err, "recoveryservices.RegisteredIdentitiesClient", "Delete", nil, "Failure preparing request")
return
}
resp, err := client.DeleteSender(req)
if err != nil {
result.Response = resp
err = autorest.NewErrorWithError(err, "recoveryservices.RegisteredIdentitiesClient", "Delete", resp, "Failure sending request")
return
}
result, err = client.DeleteResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "recoveryservices.RegisteredIdentitiesClient", "Delete", resp, "Failure responding to request")
}
return
}
// DeletePreparer prepares the Delete request.
func (client RegisteredIdentitiesClient) DeletePreparer(resourceGroupName string, vaultName string, identityName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"identityName": autorest.Encode("path", identityName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vaultName": autorest.Encode("path", vaultName),
}
const APIVersion = "2016-06-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/registeredIdentities/{identityName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error.
func (client RegisteredIdentitiesClient) DeleteSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// DeleteResponder handles the response to the Delete request. The method always
// closes the http.Response Body.
func (client RegisteredIdentitiesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
autorest.ByClosing())
result.Response = resp
return
}
@@ -0,0 +1,105 @@
package recoveryservices
// 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/azure"
"net/http"
)
// ReplicationUsagesClient is the recovery Services Client
type ReplicationUsagesClient struct {
ManagementClient
}
// NewReplicationUsagesClient creates an instance of the ReplicationUsagesClient client.
func NewReplicationUsagesClient(subscriptionID string) ReplicationUsagesClient {
return NewReplicationUsagesClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewReplicationUsagesClientWithBaseURI creates an instance of the ReplicationUsagesClient client.
func NewReplicationUsagesClientWithBaseURI(baseURI string, subscriptionID string) ReplicationUsagesClient {
return ReplicationUsagesClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// List fetches the replication usages of the vault.
//
// resourceGroupName is the name of the resource group where the recovery services vault is present. vaultName is the
// name of the recovery services vault.
func (client ReplicationUsagesClient) List(resourceGroupName string, vaultName string) (result ReplicationUsageList, err error) {
req, err := client.ListPreparer(resourceGroupName, vaultName)
if err != nil {
err = autorest.NewErrorWithError(err, "recoveryservices.ReplicationUsagesClient", "List", nil, "Failure preparing request")
return
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "recoveryservices.ReplicationUsagesClient", "List", resp, "Failure sending request")
return
}
result, err = client.ListResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "recoveryservices.ReplicationUsagesClient", "List", resp, "Failure responding to request")
}
return
}
// ListPreparer prepares the List request.
func (client ReplicationUsagesClient) ListPreparer(resourceGroupName string, vaultName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vaultName": autorest.Encode("path", vaultName),
}
const APIVersion = "2016-06-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/replicationUsages", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client ReplicationUsagesClient) ListSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// ListResponder handles the response to the List request. The method always
// closes the http.Response Body.
func (client ReplicationUsagesClient) ListResponder(resp *http.Response) (result ReplicationUsageList, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
+105
View File
@@ -0,0 +1,105 @@
package recoveryservices
// 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/azure"
"net/http"
)
// UsagesClient is the recovery Services Client
type UsagesClient struct {
ManagementClient
}
// NewUsagesClient creates an instance of the UsagesClient client.
func NewUsagesClient(subscriptionID string) UsagesClient {
return NewUsagesClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewUsagesClientWithBaseURI creates an instance of the UsagesClient client.
func NewUsagesClientWithBaseURI(baseURI string, subscriptionID string) UsagesClient {
return UsagesClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// ListByVaults fetches the usages of the vault.
//
// resourceGroupName is the name of the resource group where the recovery services vault is present. vaultName is the
// name of the recovery services vault.
func (client UsagesClient) ListByVaults(resourceGroupName string, vaultName string) (result VaultUsageList, err error) {
req, err := client.ListByVaultsPreparer(resourceGroupName, vaultName)
if err != nil {
err = autorest.NewErrorWithError(err, "recoveryservices.UsagesClient", "ListByVaults", nil, "Failure preparing request")
return
}
resp, err := client.ListByVaultsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "recoveryservices.UsagesClient", "ListByVaults", resp, "Failure sending request")
return
}
result, err = client.ListByVaultsResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "recoveryservices.UsagesClient", "ListByVaults", resp, "Failure responding to request")
}
return
}
// ListByVaultsPreparer prepares the ListByVaults request.
func (client UsagesClient) ListByVaultsPreparer(resourceGroupName string, vaultName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vaultName": autorest.Encode("path", vaultName),
}
const APIVersion = "2016-06-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/usages", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListByVaultsSender sends the ListByVaults request. The method will close the
// http.Response Body if it receives an error.
func (client UsagesClient) ListByVaultsSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// ListByVaultsResponder handles the response to the ListByVaults request. The method always
// closes the http.Response Body.
func (client UsagesClient) ListByVaultsResponder(resp *http.Response) (result VaultUsageList, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
@@ -0,0 +1,109 @@
package recoveryservices
// 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/azure"
"net/http"
)
// VaultCertificatesClient is the recovery Services Client
type VaultCertificatesClient struct {
ManagementClient
}
// NewVaultCertificatesClient creates an instance of the VaultCertificatesClient client.
func NewVaultCertificatesClient(subscriptionID string) VaultCertificatesClient {
return NewVaultCertificatesClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewVaultCertificatesClientWithBaseURI creates an instance of the VaultCertificatesClient client.
func NewVaultCertificatesClientWithBaseURI(baseURI string, subscriptionID string) VaultCertificatesClient {
return VaultCertificatesClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// Create upload a certificate for a resource.
//
// resourceGroupName is the name of the resource group where the recovery services vault is present. vaultName is the
// name of the recovery services vault. certificateName is certificate friendly name. certificateRequest is input
// parameters for uploading the vault certificate.
func (client VaultCertificatesClient) Create(resourceGroupName string, vaultName string, certificateName string, certificateRequest CertificateRequest) (result VaultCertificateResponse, err error) {
req, err := client.CreatePreparer(resourceGroupName, vaultName, certificateName, certificateRequest)
if err != nil {
err = autorest.NewErrorWithError(err, "recoveryservices.VaultCertificatesClient", "Create", nil, "Failure preparing request")
return
}
resp, err := client.CreateSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "recoveryservices.VaultCertificatesClient", "Create", resp, "Failure sending request")
return
}
result, err = client.CreateResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "recoveryservices.VaultCertificatesClient", "Create", resp, "Failure responding to request")
}
return
}
// CreatePreparer prepares the Create request.
func (client VaultCertificatesClient) CreatePreparer(resourceGroupName string, vaultName string, certificateName string, certificateRequest CertificateRequest) (*http.Request, error) {
pathParameters := map[string]interface{}{
"certificateName": autorest.Encode("path", certificateName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vaultName": autorest.Encode("path", vaultName),
}
const APIVersion = "2016-06-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/certificates/{certificateName}", pathParameters),
autorest.WithJSON(certificateRequest),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// CreateSender sends the Create request. The method will close the
// http.Response Body if it receives an error.
func (client VaultCertificatesClient) CreateSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// CreateResponder handles the response to the Create request. The method always
// closes the http.Response Body.
func (client VaultCertificatesClient) CreateResponder(resp *http.Response) (result VaultCertificateResponse, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
@@ -14,9 +14,8 @@ package recoveryservices
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
// 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"
@@ -24,30 +23,25 @@ import (
"net/http"
)
// VaultExtendedInfoClient is the client for the VaultExtendedInfo methods of
// the Recoveryservices service.
// VaultExtendedInfoClient is the recovery Services Client
type VaultExtendedInfoClient struct {
ManagementClient
}
// NewVaultExtendedInfoClient creates an instance of the
// VaultExtendedInfoClient client.
// NewVaultExtendedInfoClient creates an instance of the VaultExtendedInfoClient client.
func NewVaultExtendedInfoClient(subscriptionID string) VaultExtendedInfoClient {
return NewVaultExtendedInfoClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewVaultExtendedInfoClientWithBaseURI creates an instance of the
// VaultExtendedInfoClient client.
// NewVaultExtendedInfoClientWithBaseURI creates an instance of the VaultExtendedInfoClient client.
func NewVaultExtendedInfoClientWithBaseURI(baseURI string, subscriptionID string) VaultExtendedInfoClient {
return VaultExtendedInfoClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// CreateOrUpdate create vault extended info.
//
// resourceGroupName is the name of the resource group where the recovery
// services vault is present. vaultName is the name of the recovery services
// vault. resourceResourceExtendedInfoDetails is
// resourceResourceExtendedInfoDetails
// resourceGroupName is the name of the resource group where the recovery services vault is present. vaultName is the
// name of the recovery services vault. resourceResourceExtendedInfoDetails is resourceResourceExtendedInfoDetails
func (client VaultExtendedInfoClient) CreateOrUpdate(resourceGroupName string, vaultName string, resourceResourceExtendedInfoDetails VaultExtendedInfoResource) (result VaultExtendedInfoResource, err error) {
req, err := client.CreateOrUpdatePreparer(resourceGroupName, vaultName, resourceResourceExtendedInfoDetails)
if err != nil {
@@ -114,9 +108,8 @@ func (client VaultExtendedInfoClient) CreateOrUpdateResponder(resp *http.Respons
// Get get the vault extended info.
//
// resourceGroupName is the name of the resource group where the recovery
// services vault is present. vaultName is the name of the recovery services
// vault.
// resourceGroupName is the name of the resource group where the recovery services vault is present. vaultName is the
// name of the recovery services vault.
func (client VaultExtendedInfoClient) Get(resourceGroupName string, vaultName string) (result VaultExtendedInfoResource, err error) {
req, err := client.GetPreparer(resourceGroupName, vaultName)
if err != nil {
@@ -181,10 +174,8 @@ func (client VaultExtendedInfoClient) GetResponder(resp *http.Response) (result
// Update update vault extended info.
//
// resourceGroupName is the name of the resource group where the recovery
// services vault is present. vaultName is the name of the recovery services
// vault. resourceResourceExtendedInfoDetails is
// resourceResourceExtendedInfoDetails
// resourceGroupName is the name of the resource group where the recovery services vault is present. vaultName is the
// name of the recovery services vault. resourceResourceExtendedInfoDetails is resourceResourceExtendedInfoDetails
func (client VaultExtendedInfoClient) Update(resourceGroupName string, vaultName string, resourceResourceExtendedInfoDetails VaultExtendedInfoResource) (result VaultExtendedInfoResource, err error) {
req, err := client.UpdatePreparer(resourceGroupName, vaultName, resourceResourceExtendedInfoDetails)
if err != nil {
+13 -21
View File
@@ -14,9 +14,8 @@ package recoveryservices
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
// 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"
@@ -24,8 +23,7 @@ import (
"net/http"
)
// VaultsClient is the client for the Vaults methods of the Recoveryservices
// service.
// VaultsClient is the recovery Services Client
type VaultsClient struct {
ManagementClient
}
@@ -42,9 +40,8 @@ func NewVaultsClientWithBaseURI(baseURI string, subscriptionID string) VaultsCli
// CreateOrUpdate creates or updates a Recovery Services vault.
//
// resourceGroupName is the name of the resource group where the recovery
// services vault is present. vaultName is the name of the recovery services
// vault. vault is recovery Services Vault to be created.
// resourceGroupName is the name of the resource group where the recovery services vault is present. vaultName is the
// name of the recovery services vault. vault is recovery Services Vault to be created.
func (client VaultsClient) CreateOrUpdate(resourceGroupName string, vaultName string, vault Vault) (result Vault, err error) {
req, err := client.CreateOrUpdatePreparer(resourceGroupName, vaultName, vault)
if err != nil {
@@ -111,9 +108,8 @@ func (client VaultsClient) CreateOrUpdateResponder(resp *http.Response) (result
// Delete deletes a vault.
//
// resourceGroupName is the name of the resource group where the recovery
// services vault is present. vaultName is the name of the recovery services
// vault.
// resourceGroupName is the name of the resource group where the recovery services vault is present. vaultName is the
// name of the recovery services vault.
func (client VaultsClient) Delete(resourceGroupName string, vaultName string) (result autorest.Response, err error) {
req, err := client.DeletePreparer(resourceGroupName, vaultName)
if err != nil {
@@ -177,9 +173,8 @@ func (client VaultsClient) DeleteResponder(resp *http.Response) (result autorest
// Get get the Vault details.
//
// resourceGroupName is the name of the resource group where the recovery
// services vault is present. vaultName is the name of the recovery services
// vault.
// resourceGroupName is the name of the resource group where the recovery services vault is present. vaultName is the
// name of the recovery services vault.
func (client VaultsClient) Get(resourceGroupName string, vaultName string) (result Vault, err error) {
req, err := client.GetPreparer(resourceGroupName, vaultName)
if err != nil {
@@ -244,8 +239,7 @@ func (client VaultsClient) GetResponder(resp *http.Response) (result Vault, err
// ListByResourceGroup retrieve a list of Vaults.
//
// resourceGroupName is the name of the resource group where the recovery
// services vault is present.
// resourceGroupName is the name of the resource group where the recovery services vault is present.
func (client VaultsClient) ListByResourceGroup(resourceGroupName string) (result VaultList, err error) {
req, err := client.ListByResourceGroupPreparer(resourceGroupName)
if err != nil {
@@ -307,8 +301,7 @@ func (client VaultsClient) ListByResourceGroupResponder(resp *http.Response) (re
return
}
// ListBySubscriptionID fetches all the resources of the specified type in the
// subscription.
// ListBySubscriptionID fetches all the resources of the specified type in the subscription.
func (client VaultsClient) ListBySubscriptionID() (result VaultList, err error) {
req, err := client.ListBySubscriptionIDPreparer()
if err != nil {
@@ -371,9 +364,8 @@ func (client VaultsClient) ListBySubscriptionIDResponder(resp *http.Response) (r
// Update updates the vault.
//
// resourceGroupName is the name of the resource group where the recovery
// services vault is present. vaultName is the name of the recovery services
// vault. vault is recovery Services Vault to be created.
// resourceGroupName is the name of the resource group where the recovery services vault is present. vaultName is the
// name of the recovery services vault. vault is recovery Services Vault to be created.
func (client VaultsClient) Update(resourceGroupName string, vaultName string, vault Vault) (result Vault, err error) {
req, err := client.UpdatePreparer(resourceGroupName, vaultName, vault)
if err != nil {
+4 -5
View File
@@ -14,16 +14,15 @@ package recoveryservices
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
// 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/v10.1.0-beta arm-recoveryservices/2016-06-01"
return "Azure-SDK-For-Go/v11.0.0-beta arm-recoveryservices/"
}
// Version returns the semantic version (see http://semver.org) of the client.
func Version() string {
return "v10.1.0-beta"
return "v11.0.0-beta"
}