зеркало из https://github.com/Azure/ARO-RP.git
Generate clients for new API
This commit is contained in:
Родитель
873ffe9cdb
Коммит
d5c757c810
|
@ -1,4 +1,4 @@
|
|||
468fa0da0a50d50640ec57843ad288af343128b39f5bf23e76e4e336580883d4 swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2020-04-30/redhatopenshift.json
|
||||
c323c84befa5ea11da50a2407050abed6540ea01e796720bc2241604ce80567c swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/preview/2021-09-01-preview/redhatopenshift.json
|
||||
e4e522e41855de71c0318db31cbd96c8713e7a74e7c81911bb494f0b194b3f43 swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-04-01/redhatopenshift.json
|
||||
895ec8758158ab788088bc92eb2a2c4aa7a448bc53192aea4cb38efa033fdd2d swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/redhatopenshift.json
|
||||
8354875552d07de5c826568e8feeea4eb0a0b8103225f2ad353e8864bfee737e swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/redhatopenshift.json
|
||||
|
|
|
@ -0,0 +1,52 @@
|
|||
// Package redhatopenshift implements the Azure ARM Redhatopenshift service API version 2022-09-04.
|
||||
//
|
||||
// Rest API for Azure Red Hat OpenShift 4
|
||||
package redhatopenshift
|
||||
|
||||
// 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 Redhatopenshift
|
||||
DefaultBaseURI = "https://management.azure.com"
|
||||
)
|
||||
|
||||
// BaseClient is the base client for Redhatopenshift.
|
||||
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 using a custom endpoint. Use this when interacting with
|
||||
// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
|
||||
func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient {
|
||||
return BaseClient{
|
||||
Client: autorest.NewClientWithUserAgent(UserAgent()),
|
||||
BaseURI: baseURI,
|
||||
SubscriptionID: subscriptionID,
|
||||
}
|
||||
}
|
|
@ -0,0 +1,120 @@
|
|||
package redhatopenshift
|
||||
|
||||
// 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.
|
||||
|
||||
// CreatedByType enumerates the values for created by type.
|
||||
type CreatedByType string
|
||||
|
||||
const (
|
||||
// Application ...
|
||||
Application CreatedByType = "Application"
|
||||
// Key ...
|
||||
Key CreatedByType = "Key"
|
||||
// ManagedIdentity ...
|
||||
ManagedIdentity CreatedByType = "ManagedIdentity"
|
||||
// User ...
|
||||
User CreatedByType = "User"
|
||||
)
|
||||
|
||||
// PossibleCreatedByTypeValues returns an array of possible values for the CreatedByType const type.
|
||||
func PossibleCreatedByTypeValues() []CreatedByType {
|
||||
return []CreatedByType{Application, Key, ManagedIdentity, User}
|
||||
}
|
||||
|
||||
// EncryptionAtHost enumerates the values for encryption at host.
|
||||
type EncryptionAtHost string
|
||||
|
||||
const (
|
||||
// Disabled ...
|
||||
Disabled EncryptionAtHost = "Disabled"
|
||||
// Enabled ...
|
||||
Enabled EncryptionAtHost = "Enabled"
|
||||
)
|
||||
|
||||
// PossibleEncryptionAtHostValues returns an array of possible values for the EncryptionAtHost const type.
|
||||
func PossibleEncryptionAtHostValues() []EncryptionAtHost {
|
||||
return []EncryptionAtHost{Disabled, Enabled}
|
||||
}
|
||||
|
||||
// FipsValidatedModules enumerates the values for fips validated modules.
|
||||
type FipsValidatedModules string
|
||||
|
||||
const (
|
||||
// FipsValidatedModulesDisabled ...
|
||||
FipsValidatedModulesDisabled FipsValidatedModules = "Disabled"
|
||||
// FipsValidatedModulesEnabled ...
|
||||
FipsValidatedModulesEnabled FipsValidatedModules = "Enabled"
|
||||
)
|
||||
|
||||
// PossibleFipsValidatedModulesValues returns an array of possible values for the FipsValidatedModules const type.
|
||||
func PossibleFipsValidatedModulesValues() []FipsValidatedModules {
|
||||
return []FipsValidatedModules{FipsValidatedModulesDisabled, FipsValidatedModulesEnabled}
|
||||
}
|
||||
|
||||
// ProvisioningState enumerates the values for provisioning state.
|
||||
type ProvisioningState string
|
||||
|
||||
const (
|
||||
// AdminUpdating ...
|
||||
AdminUpdating ProvisioningState = "AdminUpdating"
|
||||
// Creating ...
|
||||
Creating ProvisioningState = "Creating"
|
||||
// Deleting ...
|
||||
Deleting ProvisioningState = "Deleting"
|
||||
// Failed ...
|
||||
Failed ProvisioningState = "Failed"
|
||||
// Succeeded ...
|
||||
Succeeded ProvisioningState = "Succeeded"
|
||||
// Updating ...
|
||||
Updating ProvisioningState = "Updating"
|
||||
)
|
||||
|
||||
// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type.
|
||||
func PossibleProvisioningStateValues() []ProvisioningState {
|
||||
return []ProvisioningState{AdminUpdating, Creating, Deleting, Failed, Succeeded, Updating}
|
||||
}
|
||||
|
||||
// SoftwareDefinedNetwork enumerates the values for software defined network.
|
||||
type SoftwareDefinedNetwork string
|
||||
|
||||
const (
|
||||
// OpenShiftSDN ...
|
||||
OpenShiftSDN SoftwareDefinedNetwork = "OpenShiftSDN"
|
||||
// OVNKubernetes ...
|
||||
OVNKubernetes SoftwareDefinedNetwork = "OVNKubernetes"
|
||||
)
|
||||
|
||||
// PossibleSoftwareDefinedNetworkValues returns an array of possible values for the SoftwareDefinedNetwork const type.
|
||||
func PossibleSoftwareDefinedNetworkValues() []SoftwareDefinedNetwork {
|
||||
return []SoftwareDefinedNetwork{OpenShiftSDN, OVNKubernetes}
|
||||
}
|
||||
|
||||
// Visibility enumerates the values for visibility.
|
||||
type Visibility string
|
||||
|
||||
const (
|
||||
// Private ...
|
||||
Private Visibility = "Private"
|
||||
// Public ...
|
||||
Public Visibility = "Public"
|
||||
)
|
||||
|
||||
// PossibleVisibilityValues returns an array of possible values for the Visibility const type.
|
||||
func PossibleVisibilityValues() []Visibility {
|
||||
return []Visibility{Private, Public}
|
||||
}
|
|
@ -0,0 +1,910 @@
|
|||
package redhatopenshift
|
||||
|
||||
// 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"
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
"github.com/Azure/go-autorest/autorest/azure"
|
||||
"github.com/Azure/go-autorest/autorest/date"
|
||||
"github.com/Azure/go-autorest/autorest/to"
|
||||
"github.com/Azure/go-autorest/tracing"
|
||||
)
|
||||
|
||||
// The package's fully qualified name.
|
||||
const fqdn = "github.com/Azure/ARO-RP/pkg/client/services/redhatopenshift/mgmt/2022-09-04/redhatopenshift"
|
||||
|
||||
// APIServerProfile aPIServerProfile represents an API server profile.
|
||||
type APIServerProfile struct {
|
||||
// Visibility - API server visibility. Possible values include: 'Private', 'Public'
|
||||
Visibility Visibility `json:"visibility,omitempty"`
|
||||
// URL - The URL to access the cluster API server.
|
||||
URL *string `json:"url,omitempty"`
|
||||
// IP - The IP of the cluster API server.
|
||||
IP *string `json:"ip,omitempty"`
|
||||
}
|
||||
|
||||
// AzureEntityResource the resource model definition for an Azure Resource Manager resource with an etag.
|
||||
type AzureEntityResource struct {
|
||||
// Etag - READ-ONLY; Resource Etag.
|
||||
Etag *string `json:"etag,omitempty"`
|
||||
// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
|
||||
ID *string `json:"id,omitempty"`
|
||||
// Name - READ-ONLY; The name of the resource
|
||||
Name *string `json:"name,omitempty"`
|
||||
// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
|
||||
Type *string `json:"type,omitempty"`
|
||||
}
|
||||
|
||||
// MarshalJSON is the custom marshaler for AzureEntityResource.
|
||||
func (aer AzureEntityResource) MarshalJSON() ([]byte, error) {
|
||||
objectMap := make(map[string]interface{})
|
||||
return json.Marshal(objectMap)
|
||||
}
|
||||
|
||||
// CloudError cloudError represents a cloud error.
|
||||
type CloudError struct {
|
||||
// Error - An error response from the service.
|
||||
Error *CloudErrorBody `json:"error,omitempty"`
|
||||
}
|
||||
|
||||
// CloudErrorBody cloudErrorBody represents the body of a cloud error.
|
||||
type CloudErrorBody struct {
|
||||
// Code - An identifier for the error. Codes are invariant and are intended to be consumed programmatically.
|
||||
Code *string `json:"code,omitempty"`
|
||||
// Message - A message describing the error, intended to be suitable for display in a user interface.
|
||||
Message *string `json:"message,omitempty"`
|
||||
// Target - The target of the particular error. For example, the name of the property in error.
|
||||
Target *string `json:"target,omitempty"`
|
||||
// Details - A list of additional details about the error.
|
||||
Details *[]CloudErrorBody `json:"details,omitempty"`
|
||||
}
|
||||
|
||||
// ClusterProfile clusterProfile represents a cluster profile.
|
||||
type ClusterProfile struct {
|
||||
// PullSecret - The pull secret for the cluster.
|
||||
PullSecret *string `json:"pullSecret,omitempty"`
|
||||
// Domain - The domain for the cluster.
|
||||
Domain *string `json:"domain,omitempty"`
|
||||
// Version - The version of the cluster.
|
||||
Version *string `json:"version,omitempty"`
|
||||
// ResourceGroupID - The ID of the cluster resource group.
|
||||
ResourceGroupID *string `json:"resourceGroupId,omitempty"`
|
||||
// FipsValidatedModules - If FIPS validated crypto modules are used. Possible values include: 'FipsValidatedModulesDisabled', 'FipsValidatedModulesEnabled'
|
||||
FipsValidatedModules FipsValidatedModules `json:"fipsValidatedModules,omitempty"`
|
||||
}
|
||||
|
||||
// ConsoleProfile consoleProfile represents a console profile.
|
||||
type ConsoleProfile struct {
|
||||
// URL - The URL to access the cluster console.
|
||||
URL *string `json:"url,omitempty"`
|
||||
}
|
||||
|
||||
// Display display represents the display details of an operation.
|
||||
type Display struct {
|
||||
// Provider - Friendly name of the resource provider.
|
||||
Provider *string `json:"provider,omitempty"`
|
||||
// Resource - Resource type on which the operation is performed.
|
||||
Resource *string `json:"resource,omitempty"`
|
||||
// Operation - Operation type: read, write, delete, listKeys/action, etc.
|
||||
Operation *string `json:"operation,omitempty"`
|
||||
// Description - Friendly name of the operation.
|
||||
Description *string `json:"description,omitempty"`
|
||||
}
|
||||
|
||||
// IngressProfile ingressProfile represents an ingress profile.
|
||||
type IngressProfile struct {
|
||||
// Name - The ingress profile name.
|
||||
Name *string `json:"name,omitempty"`
|
||||
// Visibility - Ingress visibility. Possible values include: 'Private', 'Public'
|
||||
Visibility Visibility `json:"visibility,omitempty"`
|
||||
// IP - The IP of the ingress.
|
||||
IP *string `json:"ip,omitempty"`
|
||||
}
|
||||
|
||||
// MasterProfile masterProfile represents a master profile.
|
||||
type MasterProfile struct {
|
||||
// VMSize - The size of the master VMs.
|
||||
VMSize *string `json:"vmSize,omitempty"`
|
||||
// SubnetID - The Azure resource ID of the master subnet.
|
||||
SubnetID *string `json:"subnetId,omitempty"`
|
||||
// EncryptionAtHost - Whether master virtual machines are encrypted at host. Possible values include: 'Disabled', 'Enabled'
|
||||
EncryptionAtHost EncryptionAtHost `json:"encryptionAtHost,omitempty"`
|
||||
// DiskEncryptionSetID - The resource ID of an associated DiskEncryptionSet, if applicable.
|
||||
DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"`
|
||||
}
|
||||
|
||||
// NetworkProfile networkProfile represents a network profile.
|
||||
type NetworkProfile struct {
|
||||
// SoftwareDefinedNetwork - The Software Defined Network (SDN) type to use when installing the cluster. Possible values include: 'OVNKubernetes', 'OpenShiftSDN'
|
||||
SoftwareDefinedNetwork SoftwareDefinedNetwork `json:"softwareDefinedNetwork,omitempty"`
|
||||
// PodCidr - The CIDR used for OpenShift/Kubernetes Pods.
|
||||
PodCidr *string `json:"podCidr,omitempty"`
|
||||
// ServiceCidr - The CIDR used for OpenShift/Kubernetes Services.
|
||||
ServiceCidr *string `json:"serviceCidr,omitempty"`
|
||||
}
|
||||
|
||||
// OpenShiftCluster openShiftCluster represents an Azure Red Hat OpenShift cluster.
|
||||
type OpenShiftCluster struct {
|
||||
autorest.Response `json:"-"`
|
||||
// OpenShiftClusterProperties - The cluster properties.
|
||||
*OpenShiftClusterProperties `json:"properties,omitempty"`
|
||||
// SystemData - READ-ONLY; The system meta data relating to this resource.
|
||||
SystemData *SystemData `json:"systemData,omitempty"`
|
||||
// Tags - Resource tags.
|
||||
Tags map[string]*string `json:"tags"`
|
||||
// Location - The geo-location where the resource lives
|
||||
Location *string `json:"location,omitempty"`
|
||||
// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
|
||||
ID *string `json:"id,omitempty"`
|
||||
// Name - READ-ONLY; The name of the resource
|
||||
Name *string `json:"name,omitempty"`
|
||||
// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
|
||||
Type *string `json:"type,omitempty"`
|
||||
}
|
||||
|
||||
// MarshalJSON is the custom marshaler for OpenShiftCluster.
|
||||
func (osc OpenShiftCluster) MarshalJSON() ([]byte, error) {
|
||||
objectMap := make(map[string]interface{})
|
||||
if osc.OpenShiftClusterProperties != nil {
|
||||
objectMap["properties"] = osc.OpenShiftClusterProperties
|
||||
}
|
||||
if osc.Tags != nil {
|
||||
objectMap["tags"] = osc.Tags
|
||||
}
|
||||
if osc.Location != nil {
|
||||
objectMap["location"] = osc.Location
|
||||
}
|
||||
return json.Marshal(objectMap)
|
||||
}
|
||||
|
||||
// UnmarshalJSON is the custom unmarshaler for OpenShiftCluster struct.
|
||||
func (osc *OpenShiftCluster) UnmarshalJSON(body []byte) error {
|
||||
var m map[string]*json.RawMessage
|
||||
err := json.Unmarshal(body, &m)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
for k, v := range m {
|
||||
switch k {
|
||||
case "properties":
|
||||
if v != nil {
|
||||
var openShiftClusterProperties OpenShiftClusterProperties
|
||||
err = json.Unmarshal(*v, &openShiftClusterProperties)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
osc.OpenShiftClusterProperties = &openShiftClusterProperties
|
||||
}
|
||||
case "systemData":
|
||||
if v != nil {
|
||||
var systemData SystemData
|
||||
err = json.Unmarshal(*v, &systemData)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
osc.SystemData = &systemData
|
||||
}
|
||||
case "tags":
|
||||
if v != nil {
|
||||
var tags map[string]*string
|
||||
err = json.Unmarshal(*v, &tags)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
osc.Tags = tags
|
||||
}
|
||||
case "location":
|
||||
if v != nil {
|
||||
var location string
|
||||
err = json.Unmarshal(*v, &location)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
osc.Location = &location
|
||||
}
|
||||
case "id":
|
||||
if v != nil {
|
||||
var ID string
|
||||
err = json.Unmarshal(*v, &ID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
osc.ID = &ID
|
||||
}
|
||||
case "name":
|
||||
if v != nil {
|
||||
var name string
|
||||
err = json.Unmarshal(*v, &name)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
osc.Name = &name
|
||||
}
|
||||
case "type":
|
||||
if v != nil {
|
||||
var typeVar string
|
||||
err = json.Unmarshal(*v, &typeVar)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
osc.Type = &typeVar
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// OpenShiftClusterAdminKubeconfig openShiftClusterAdminKubeconfig represents an OpenShift cluster's admin
|
||||
// kubeconfig.
|
||||
type OpenShiftClusterAdminKubeconfig struct {
|
||||
autorest.Response `json:"-"`
|
||||
// Kubeconfig - The base64-encoded kubeconfig file.
|
||||
Kubeconfig *string `json:"kubeconfig,omitempty"`
|
||||
}
|
||||
|
||||
// OpenShiftClusterCredentials openShiftClusterCredentials represents an OpenShift cluster's credentials.
|
||||
type OpenShiftClusterCredentials struct {
|
||||
autorest.Response `json:"-"`
|
||||
// KubeadminUsername - The username for the kubeadmin user.
|
||||
KubeadminUsername *string `json:"kubeadminUsername,omitempty"`
|
||||
// KubeadminPassword - The password for the kubeadmin user.
|
||||
KubeadminPassword *string `json:"kubeadminPassword,omitempty"`
|
||||
}
|
||||
|
||||
// OpenShiftClusterList openShiftClusterList represents a list of OpenShift clusters.
|
||||
type OpenShiftClusterList struct {
|
||||
autorest.Response `json:"-"`
|
||||
// Value - The list of OpenShift clusters.
|
||||
Value *[]OpenShiftCluster `json:"value,omitempty"`
|
||||
// NextLink - The link used to get the next page of operations.
|
||||
NextLink *string `json:"nextLink,omitempty"`
|
||||
}
|
||||
|
||||
// OpenShiftClusterListIterator provides access to a complete listing of OpenShiftCluster values.
|
||||
type OpenShiftClusterListIterator struct {
|
||||
i int
|
||||
page OpenShiftClusterListPage
|
||||
}
|
||||
|
||||
// NextWithContext 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 *OpenShiftClusterListIterator) NextWithContext(ctx context.Context) (err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/OpenShiftClusterListIterator.NextWithContext")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if iter.Response().Response.Response != nil {
|
||||
sc = iter.Response().Response.Response.StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
iter.i++
|
||||
if iter.i < len(iter.page.Values()) {
|
||||
return nil
|
||||
}
|
||||
err = iter.page.NextWithContext(ctx)
|
||||
if err != nil {
|
||||
iter.i--
|
||||
return err
|
||||
}
|
||||
iter.i = 0
|
||||
return nil
|
||||
}
|
||||
|
||||
// Next advances to the next value. If there was an error making
|
||||
// the request the iterator does not advance and the error is returned.
|
||||
// Deprecated: Use NextWithContext() instead.
|
||||
func (iter *OpenShiftClusterListIterator) Next() error {
|
||||
return iter.NextWithContext(context.Background())
|
||||
}
|
||||
|
||||
// NotDone returns true if the enumeration should be started or is not yet complete.
|
||||
func (iter OpenShiftClusterListIterator) 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 OpenShiftClusterListIterator) Response() OpenShiftClusterList {
|
||||
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 OpenShiftClusterListIterator) Value() OpenShiftCluster {
|
||||
if !iter.page.NotDone() {
|
||||
return OpenShiftCluster{}
|
||||
}
|
||||
return iter.page.Values()[iter.i]
|
||||
}
|
||||
|
||||
// Creates a new instance of the OpenShiftClusterListIterator type.
|
||||
func NewOpenShiftClusterListIterator(page OpenShiftClusterListPage) OpenShiftClusterListIterator {
|
||||
return OpenShiftClusterListIterator{page: page}
|
||||
}
|
||||
|
||||
// IsEmpty returns true if the ListResult contains no values.
|
||||
func (oscl OpenShiftClusterList) IsEmpty() bool {
|
||||
return oscl.Value == nil || len(*oscl.Value) == 0
|
||||
}
|
||||
|
||||
// hasNextLink returns true if the NextLink is not empty.
|
||||
func (oscl OpenShiftClusterList) hasNextLink() bool {
|
||||
return oscl.NextLink != nil && len(*oscl.NextLink) != 0
|
||||
}
|
||||
|
||||
// openShiftClusterListPreparer prepares a request to retrieve the next set of results.
|
||||
// It returns nil if no more results exist.
|
||||
func (oscl OpenShiftClusterList) openShiftClusterListPreparer(ctx context.Context) (*http.Request, error) {
|
||||
if !oscl.hasNextLink() {
|
||||
return nil, nil
|
||||
}
|
||||
return autorest.Prepare((&http.Request{}).WithContext(ctx),
|
||||
autorest.AsJSON(),
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(to.String(oscl.NextLink)))
|
||||
}
|
||||
|
||||
// OpenShiftClusterListPage contains a page of OpenShiftCluster values.
|
||||
type OpenShiftClusterListPage struct {
|
||||
fn func(context.Context, OpenShiftClusterList) (OpenShiftClusterList, error)
|
||||
oscl OpenShiftClusterList
|
||||
}
|
||||
|
||||
// NextWithContext 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 *OpenShiftClusterListPage) NextWithContext(ctx context.Context) (err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/OpenShiftClusterListPage.NextWithContext")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if page.Response().Response.Response != nil {
|
||||
sc = page.Response().Response.Response.StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
for {
|
||||
next, err := page.fn(ctx, page.oscl)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
page.oscl = next
|
||||
if !next.hasNextLink() || !next.IsEmpty() {
|
||||
break
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// 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.
|
||||
// Deprecated: Use NextWithContext() instead.
|
||||
func (page *OpenShiftClusterListPage) Next() error {
|
||||
return page.NextWithContext(context.Background())
|
||||
}
|
||||
|
||||
// NotDone returns true if the page enumeration should be started or is not yet complete.
|
||||
func (page OpenShiftClusterListPage) NotDone() bool {
|
||||
return !page.oscl.IsEmpty()
|
||||
}
|
||||
|
||||
// Response returns the raw server response from the last page request.
|
||||
func (page OpenShiftClusterListPage) Response() OpenShiftClusterList {
|
||||
return page.oscl
|
||||
}
|
||||
|
||||
// Values returns the slice of values for the current page or nil if there are no values.
|
||||
func (page OpenShiftClusterListPage) Values() []OpenShiftCluster {
|
||||
if page.oscl.IsEmpty() {
|
||||
return nil
|
||||
}
|
||||
return *page.oscl.Value
|
||||
}
|
||||
|
||||
// Creates a new instance of the OpenShiftClusterListPage type.
|
||||
func NewOpenShiftClusterListPage(cur OpenShiftClusterList, getNextPage func(context.Context, OpenShiftClusterList) (OpenShiftClusterList, error)) OpenShiftClusterListPage {
|
||||
return OpenShiftClusterListPage{
|
||||
fn: getNextPage,
|
||||
oscl: cur,
|
||||
}
|
||||
}
|
||||
|
||||
// OpenShiftClusterProperties openShiftClusterProperties represents an OpenShift cluster's properties.
|
||||
type OpenShiftClusterProperties struct {
|
||||
// ProvisioningState - The cluster provisioning state. Possible values include: 'AdminUpdating', 'Creating', 'Deleting', 'Failed', 'Succeeded', 'Updating'
|
||||
ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
|
||||
// ClusterProfile - The cluster profile.
|
||||
ClusterProfile *ClusterProfile `json:"clusterProfile,omitempty"`
|
||||
// ConsoleProfile - The console profile.
|
||||
ConsoleProfile *ConsoleProfile `json:"consoleProfile,omitempty"`
|
||||
// ServicePrincipalProfile - The cluster service principal profile.
|
||||
ServicePrincipalProfile *ServicePrincipalProfile `json:"servicePrincipalProfile,omitempty"`
|
||||
// NetworkProfile - The cluster network profile.
|
||||
NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"`
|
||||
// MasterProfile - The cluster master profile.
|
||||
MasterProfile *MasterProfile `json:"masterProfile,omitempty"`
|
||||
// WorkerProfiles - The cluster worker profiles.
|
||||
WorkerProfiles *[]WorkerProfile `json:"workerProfiles,omitempty"`
|
||||
// ApiserverProfile - The cluster API server profile.
|
||||
ApiserverProfile *APIServerProfile `json:"apiserverProfile,omitempty"`
|
||||
// IngressProfiles - The cluster ingress profiles.
|
||||
IngressProfiles *[]IngressProfile `json:"ingressProfiles,omitempty"`
|
||||
}
|
||||
|
||||
// OpenShiftClustersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
|
||||
// long-running operation.
|
||||
type OpenShiftClustersCreateOrUpdateFuture struct {
|
||||
azure.FutureAPI
|
||||
// Result returns the result of the asynchronous operation.
|
||||
// If the operation has not completed it will return an error.
|
||||
Result func(OpenShiftClustersClient) (OpenShiftCluster, error)
|
||||
}
|
||||
|
||||
// UnmarshalJSON is the custom unmarshaller for CreateFuture.
|
||||
func (future *OpenShiftClustersCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
|
||||
var azFuture azure.Future
|
||||
if err := json.Unmarshal(body, &azFuture); err != nil {
|
||||
return err
|
||||
}
|
||||
future.FutureAPI = &azFuture
|
||||
future.Result = future.result
|
||||
return nil
|
||||
}
|
||||
|
||||
// result is the default implementation for OpenShiftClustersCreateOrUpdateFuture.Result.
|
||||
func (future *OpenShiftClustersCreateOrUpdateFuture) result(client OpenShiftClustersClient) (osc OpenShiftCluster, err error) {
|
||||
var done bool
|
||||
done, err = future.DoneWithContext(context.Background(), client)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "redhatopenshift.OpenShiftClustersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
|
||||
return
|
||||
}
|
||||
if !done {
|
||||
osc.Response.Response = future.Response()
|
||||
err = azure.NewAsyncOpIncompleteError("redhatopenshift.OpenShiftClustersCreateOrUpdateFuture")
|
||||
return
|
||||
}
|
||||
sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
|
||||
if osc.Response.Response, err = future.GetResult(sender); err == nil && osc.Response.Response.StatusCode != http.StatusNoContent {
|
||||
osc, err = client.CreateOrUpdateResponder(osc.Response.Response)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "redhatopenshift.OpenShiftClustersCreateOrUpdateFuture", "Result", osc.Response.Response, "Failure responding to request")
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// OpenShiftClustersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
|
||||
// operation.
|
||||
type OpenShiftClustersDeleteFuture struct {
|
||||
azure.FutureAPI
|
||||
// Result returns the result of the asynchronous operation.
|
||||
// If the operation has not completed it will return an error.
|
||||
Result func(OpenShiftClustersClient) (autorest.Response, error)
|
||||
}
|
||||
|
||||
// UnmarshalJSON is the custom unmarshaller for CreateFuture.
|
||||
func (future *OpenShiftClustersDeleteFuture) UnmarshalJSON(body []byte) error {
|
||||
var azFuture azure.Future
|
||||
if err := json.Unmarshal(body, &azFuture); err != nil {
|
||||
return err
|
||||
}
|
||||
future.FutureAPI = &azFuture
|
||||
future.Result = future.result
|
||||
return nil
|
||||
}
|
||||
|
||||
// result is the default implementation for OpenShiftClustersDeleteFuture.Result.
|
||||
func (future *OpenShiftClustersDeleteFuture) result(client OpenShiftClustersClient) (ar autorest.Response, err error) {
|
||||
var done bool
|
||||
done, err = future.DoneWithContext(context.Background(), client)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "redhatopenshift.OpenShiftClustersDeleteFuture", "Result", future.Response(), "Polling failure")
|
||||
return
|
||||
}
|
||||
if !done {
|
||||
ar.Response = future.Response()
|
||||
err = azure.NewAsyncOpIncompleteError("redhatopenshift.OpenShiftClustersDeleteFuture")
|
||||
return
|
||||
}
|
||||
ar.Response = future.Response()
|
||||
return
|
||||
}
|
||||
|
||||
// OpenShiftClustersUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
|
||||
// operation.
|
||||
type OpenShiftClustersUpdateFuture struct {
|
||||
azure.FutureAPI
|
||||
// Result returns the result of the asynchronous operation.
|
||||
// If the operation has not completed it will return an error.
|
||||
Result func(OpenShiftClustersClient) (OpenShiftCluster, error)
|
||||
}
|
||||
|
||||
// UnmarshalJSON is the custom unmarshaller for CreateFuture.
|
||||
func (future *OpenShiftClustersUpdateFuture) UnmarshalJSON(body []byte) error {
|
||||
var azFuture azure.Future
|
||||
if err := json.Unmarshal(body, &azFuture); err != nil {
|
||||
return err
|
||||
}
|
||||
future.FutureAPI = &azFuture
|
||||
future.Result = future.result
|
||||
return nil
|
||||
}
|
||||
|
||||
// result is the default implementation for OpenShiftClustersUpdateFuture.Result.
|
||||
func (future *OpenShiftClustersUpdateFuture) result(client OpenShiftClustersClient) (osc OpenShiftCluster, err error) {
|
||||
var done bool
|
||||
done, err = future.DoneWithContext(context.Background(), client)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "redhatopenshift.OpenShiftClustersUpdateFuture", "Result", future.Response(), "Polling failure")
|
||||
return
|
||||
}
|
||||
if !done {
|
||||
osc.Response.Response = future.Response()
|
||||
err = azure.NewAsyncOpIncompleteError("redhatopenshift.OpenShiftClustersUpdateFuture")
|
||||
return
|
||||
}
|
||||
sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
|
||||
if osc.Response.Response, err = future.GetResult(sender); err == nil && osc.Response.Response.StatusCode != http.StatusNoContent {
|
||||
osc, err = client.UpdateResponder(osc.Response.Response)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "redhatopenshift.OpenShiftClustersUpdateFuture", "Result", osc.Response.Response, "Failure responding to request")
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// OpenShiftClusterUpdate openShiftCluster represents an Azure Red Hat OpenShift cluster.
|
||||
type OpenShiftClusterUpdate struct {
|
||||
// Tags - The resource tags.
|
||||
Tags map[string]*string `json:"tags"`
|
||||
// OpenShiftClusterProperties - The cluster properties.
|
||||
*OpenShiftClusterProperties `json:"properties,omitempty"`
|
||||
// SystemData - READ-ONLY; The system meta data relating to this resource.
|
||||
SystemData *SystemData `json:"systemData,omitempty"`
|
||||
}
|
||||
|
||||
// MarshalJSON is the custom marshaler for OpenShiftClusterUpdate.
|
||||
func (oscu OpenShiftClusterUpdate) MarshalJSON() ([]byte, error) {
|
||||
objectMap := make(map[string]interface{})
|
||||
if oscu.Tags != nil {
|
||||
objectMap["tags"] = oscu.Tags
|
||||
}
|
||||
if oscu.OpenShiftClusterProperties != nil {
|
||||
objectMap["properties"] = oscu.OpenShiftClusterProperties
|
||||
}
|
||||
return json.Marshal(objectMap)
|
||||
}
|
||||
|
||||
// UnmarshalJSON is the custom unmarshaler for OpenShiftClusterUpdate struct.
|
||||
func (oscu *OpenShiftClusterUpdate) UnmarshalJSON(body []byte) error {
|
||||
var m map[string]*json.RawMessage
|
||||
err := json.Unmarshal(body, &m)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
for k, v := range m {
|
||||
switch k {
|
||||
case "tags":
|
||||
if v != nil {
|
||||
var tags map[string]*string
|
||||
err = json.Unmarshal(*v, &tags)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
oscu.Tags = tags
|
||||
}
|
||||
case "properties":
|
||||
if v != nil {
|
||||
var openShiftClusterProperties OpenShiftClusterProperties
|
||||
err = json.Unmarshal(*v, &openShiftClusterProperties)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
oscu.OpenShiftClusterProperties = &openShiftClusterProperties
|
||||
}
|
||||
case "systemData":
|
||||
if v != nil {
|
||||
var systemData SystemData
|
||||
err = json.Unmarshal(*v, &systemData)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
oscu.SystemData = &systemData
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Operation operation represents an RP operation.
|
||||
type Operation struct {
|
||||
// Name - Operation name: {provider}/{resource}/{operation}.
|
||||
Name *string `json:"name,omitempty"`
|
||||
// Display - The object that describes the operation.
|
||||
Display *Display `json:"display,omitempty"`
|
||||
// Origin - Sources of requests to this operation. Comma separated list with valid values user or system, e.g. "user,system".
|
||||
Origin *string `json:"origin,omitempty"`
|
||||
}
|
||||
|
||||
// OperationList operationList represents an RP operation list.
|
||||
type OperationList struct {
|
||||
autorest.Response `json:"-"`
|
||||
// Value - List of operations supported by the resource provider.
|
||||
Value *[]Operation `json:"value,omitempty"`
|
||||
// NextLink - The link used to get the next page of operations.
|
||||
NextLink *string `json:"nextLink,omitempty"`
|
||||
}
|
||||
|
||||
// OperationListIterator provides access to a complete listing of Operation values.
|
||||
type OperationListIterator struct {
|
||||
i int
|
||||
page OperationListPage
|
||||
}
|
||||
|
||||
// NextWithContext 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 *OperationListIterator) NextWithContext(ctx context.Context) (err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/OperationListIterator.NextWithContext")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if iter.Response().Response.Response != nil {
|
||||
sc = iter.Response().Response.Response.StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
iter.i++
|
||||
if iter.i < len(iter.page.Values()) {
|
||||
return nil
|
||||
}
|
||||
err = iter.page.NextWithContext(ctx)
|
||||
if err != nil {
|
||||
iter.i--
|
||||
return err
|
||||
}
|
||||
iter.i = 0
|
||||
return nil
|
||||
}
|
||||
|
||||
// Next advances to the next value. If there was an error making
|
||||
// the request the iterator does not advance and the error is returned.
|
||||
// Deprecated: Use NextWithContext() instead.
|
||||
func (iter *OperationListIterator) Next() error {
|
||||
return iter.NextWithContext(context.Background())
|
||||
}
|
||||
|
||||
// NotDone returns true if the enumeration should be started or is not yet complete.
|
||||
func (iter OperationListIterator) 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 OperationListIterator) Response() OperationList {
|
||||
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 OperationListIterator) Value() Operation {
|
||||
if !iter.page.NotDone() {
|
||||
return Operation{}
|
||||
}
|
||||
return iter.page.Values()[iter.i]
|
||||
}
|
||||
|
||||
// Creates a new instance of the OperationListIterator type.
|
||||
func NewOperationListIterator(page OperationListPage) OperationListIterator {
|
||||
return OperationListIterator{page: page}
|
||||
}
|
||||
|
||||
// IsEmpty returns true if the ListResult contains no values.
|
||||
func (ol OperationList) IsEmpty() bool {
|
||||
return ol.Value == nil || len(*ol.Value) == 0
|
||||
}
|
||||
|
||||
// hasNextLink returns true if the NextLink is not empty.
|
||||
func (ol OperationList) hasNextLink() bool {
|
||||
return ol.NextLink != nil && len(*ol.NextLink) != 0
|
||||
}
|
||||
|
||||
// operationListPreparer prepares a request to retrieve the next set of results.
|
||||
// It returns nil if no more results exist.
|
||||
func (ol OperationList) operationListPreparer(ctx context.Context) (*http.Request, error) {
|
||||
if !ol.hasNextLink() {
|
||||
return nil, nil
|
||||
}
|
||||
return autorest.Prepare((&http.Request{}).WithContext(ctx),
|
||||
autorest.AsJSON(),
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(to.String(ol.NextLink)))
|
||||
}
|
||||
|
||||
// OperationListPage contains a page of Operation values.
|
||||
type OperationListPage struct {
|
||||
fn func(context.Context, OperationList) (OperationList, error)
|
||||
ol OperationList
|
||||
}
|
||||
|
||||
// NextWithContext 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 *OperationListPage) NextWithContext(ctx context.Context) (err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/OperationListPage.NextWithContext")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if page.Response().Response.Response != nil {
|
||||
sc = page.Response().Response.Response.StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
for {
|
||||
next, err := page.fn(ctx, page.ol)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
page.ol = next
|
||||
if !next.hasNextLink() || !next.IsEmpty() {
|
||||
break
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// 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.
|
||||
// Deprecated: Use NextWithContext() instead.
|
||||
func (page *OperationListPage) Next() error {
|
||||
return page.NextWithContext(context.Background())
|
||||
}
|
||||
|
||||
// NotDone returns true if the page enumeration should be started or is not yet complete.
|
||||
func (page OperationListPage) NotDone() bool {
|
||||
return !page.ol.IsEmpty()
|
||||
}
|
||||
|
||||
// Response returns the raw server response from the last page request.
|
||||
func (page OperationListPage) Response() OperationList {
|
||||
return page.ol
|
||||
}
|
||||
|
||||
// Values returns the slice of values for the current page or nil if there are no values.
|
||||
func (page OperationListPage) Values() []Operation {
|
||||
if page.ol.IsEmpty() {
|
||||
return nil
|
||||
}
|
||||
return *page.ol.Value
|
||||
}
|
||||
|
||||
// Creates a new instance of the OperationListPage type.
|
||||
func NewOperationListPage(cur OperationList, getNextPage func(context.Context, OperationList) (OperationList, error)) OperationListPage {
|
||||
return OperationListPage{
|
||||
fn: getNextPage,
|
||||
ol: cur,
|
||||
}
|
||||
}
|
||||
|
||||
// ProxyResource the resource model definition for an Azure Resource Manager proxy resource. It will have
|
||||
// everything other than required location and tags
|
||||
type ProxyResource struct {
|
||||
// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
|
||||
ID *string `json:"id,omitempty"`
|
||||
// Name - READ-ONLY; The name of the resource
|
||||
Name *string `json:"name,omitempty"`
|
||||
// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
|
||||
Type *string `json:"type,omitempty"`
|
||||
}
|
||||
|
||||
// MarshalJSON is the custom marshaler for ProxyResource.
|
||||
func (pr ProxyResource) MarshalJSON() ([]byte, error) {
|
||||
objectMap := make(map[string]interface{})
|
||||
return json.Marshal(objectMap)
|
||||
}
|
||||
|
||||
// Resource common fields that are returned in the response for all Azure Resource Manager resources
|
||||
type Resource struct {
|
||||
// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
|
||||
ID *string `json:"id,omitempty"`
|
||||
// Name - READ-ONLY; The name of the resource
|
||||
Name *string `json:"name,omitempty"`
|
||||
// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
|
||||
Type *string `json:"type,omitempty"`
|
||||
}
|
||||
|
||||
// MarshalJSON is the custom marshaler for Resource.
|
||||
func (r Resource) MarshalJSON() ([]byte, error) {
|
||||
objectMap := make(map[string]interface{})
|
||||
return json.Marshal(objectMap)
|
||||
}
|
||||
|
||||
// ServicePrincipalProfile servicePrincipalProfile represents a service principal profile.
|
||||
type ServicePrincipalProfile struct {
|
||||
// ClientID - The client ID used for the cluster.
|
||||
ClientID *string `json:"clientId,omitempty"`
|
||||
// ClientSecret - The client secret used for the cluster.
|
||||
ClientSecret *string `json:"clientSecret,omitempty"`
|
||||
}
|
||||
|
||||
// SystemData metadata pertaining to creation and last modification of the resource.
|
||||
type SystemData struct {
|
||||
// CreatedBy - The identity that created the resource.
|
||||
CreatedBy *string `json:"createdBy,omitempty"`
|
||||
// CreatedByType - The type of identity that created the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key'
|
||||
CreatedByType CreatedByType `json:"createdByType,omitempty"`
|
||||
// CreatedAt - The timestamp of resource creation (UTC).
|
||||
CreatedAt *date.Time `json:"createdAt,omitempty"`
|
||||
// LastModifiedBy - The identity that last modified the resource.
|
||||
LastModifiedBy *string `json:"lastModifiedBy,omitempty"`
|
||||
// LastModifiedByType - The type of identity that last modified the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key'
|
||||
LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"`
|
||||
// LastModifiedAt - The type of identity that last modified the resource.
|
||||
LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"`
|
||||
}
|
||||
|
||||
// TrackedResource the resource model definition for an Azure Resource Manager tracked top level resource
|
||||
type TrackedResource struct {
|
||||
// Tags - Resource tags.
|
||||
Tags map[string]*string `json:"tags"`
|
||||
// Location - The geo-location where the resource lives
|
||||
Location *string `json:"location,omitempty"`
|
||||
// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
|
||||
ID *string `json:"id,omitempty"`
|
||||
// Name - READ-ONLY; The name of the resource
|
||||
Name *string `json:"name,omitempty"`
|
||||
// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
|
||||
Type *string `json:"type,omitempty"`
|
||||
}
|
||||
|
||||
// MarshalJSON is the custom marshaler for TrackedResource.
|
||||
func (tr TrackedResource) MarshalJSON() ([]byte, error) {
|
||||
objectMap := make(map[string]interface{})
|
||||
if tr.Tags != nil {
|
||||
objectMap["tags"] = tr.Tags
|
||||
}
|
||||
if tr.Location != nil {
|
||||
objectMap["location"] = tr.Location
|
||||
}
|
||||
return json.Marshal(objectMap)
|
||||
}
|
||||
|
||||
// WorkerProfile workerProfile represents a worker profile.
|
||||
type WorkerProfile struct {
|
||||
// Name - The worker profile name.
|
||||
Name *string `json:"name,omitempty"`
|
||||
// VMSize - The size of the worker VMs.
|
||||
VMSize *string `json:"vmSize,omitempty"`
|
||||
// DiskSizeGB - The disk size of the worker VMs.
|
||||
DiskSizeGB *int32 `json:"diskSizeGB,omitempty"`
|
||||
// SubnetID - The Azure resource ID of the worker subnet.
|
||||
SubnetID *string `json:"subnetId,omitempty"`
|
||||
// Count - The number of worker VMs.
|
||||
Count *int32 `json:"count,omitempty"`
|
||||
// EncryptionAtHost - Whether master virtual machines are encrypted at host. Possible values include: 'Disabled', 'Enabled'
|
||||
EncryptionAtHost EncryptionAtHost `json:"encryptionAtHost,omitempty"`
|
||||
// DiskEncryptionSetID - The resource ID of an associated DiskEncryptionSet, if applicable.
|
||||
DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"`
|
||||
}
|
|
@ -0,0 +1,822 @@
|
|||
package redhatopenshift
|
||||
|
||||
// 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"
|
||||
"net/http"
|
||||
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
"github.com/Azure/go-autorest/autorest/azure"
|
||||
"github.com/Azure/go-autorest/autorest/validation"
|
||||
"github.com/Azure/go-autorest/tracing"
|
||||
)
|
||||
|
||||
// OpenShiftClustersClient is the rest API for Azure Red Hat OpenShift 4
|
||||
type OpenShiftClustersClient struct {
|
||||
BaseClient
|
||||
}
|
||||
|
||||
// NewOpenShiftClustersClient creates an instance of the OpenShiftClustersClient client.
|
||||
func NewOpenShiftClustersClient(subscriptionID string) OpenShiftClustersClient {
|
||||
return NewOpenShiftClustersClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewOpenShiftClustersClientWithBaseURI creates an instance of the OpenShiftClustersClient client using a custom
|
||||
// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure
|
||||
// stack).
|
||||
func NewOpenShiftClustersClientWithBaseURI(baseURI string, subscriptionID string) OpenShiftClustersClient {
|
||||
return OpenShiftClustersClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// CreateOrUpdate the operation returns properties of a OpenShift cluster.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group. The name is case insensitive.
|
||||
// resourceName - the name of the OpenShift cluster resource.
|
||||
// parameters - the OpenShift cluster resource.
|
||||
func (client OpenShiftClustersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, parameters OpenShiftCluster) (result OpenShiftClustersCreateOrUpdateFuture, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/OpenShiftClustersClient.CreateOrUpdate")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
|
||||
sc = result.FutureAPI.Response().StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: client.SubscriptionID,
|
||||
Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
|
||||
{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewError("redhatopenshift.OpenShiftClustersClient", "CreateOrUpdate", err.Error())
|
||||
}
|
||||
|
||||
req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceName, parameters)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "redhatopenshift.OpenShiftClustersClient", "CreateOrUpdate", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.CreateOrUpdateSender(req)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "redhatopenshift.OpenShiftClustersClient", "CreateOrUpdate", result.Response(), "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
|
||||
func (client OpenShiftClustersClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, parameters OpenShiftCluster) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"resourceName": autorest.Encode("path", resourceName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2022-09-04"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
parameters.SystemData = nil
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsContentType("application/json; charset=utf-8"),
|
||||
autorest.AsPut(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openShiftClusters/{resourceName}", pathParameters),
|
||||
autorest.WithJSON(parameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client OpenShiftClustersClient) CreateOrUpdateSender(req *http.Request) (future OpenShiftClustersCreateOrUpdateFuture, err error) {
|
||||
var resp *http.Response
|
||||
future.FutureAPI = &azure.Future{}
|
||||
resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
var azf azure.Future
|
||||
azf, err = azure.NewFutureFromResponse(resp)
|
||||
future.FutureAPI = &azf
|
||||
future.Result = future.result
|
||||
return
|
||||
}
|
||||
|
||||
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client OpenShiftClustersClient) CreateOrUpdateResponder(resp *http.Response) (result OpenShiftCluster, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// Delete the operation returns nothing.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group. The name is case insensitive.
|
||||
// resourceName - the name of the OpenShift cluster resource.
|
||||
func (client OpenShiftClustersClient) Delete(ctx context.Context, resourceGroupName string, resourceName string) (result OpenShiftClustersDeleteFuture, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/OpenShiftClustersClient.Delete")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
|
||||
sc = result.FutureAPI.Response().StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: client.SubscriptionID,
|
||||
Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
|
||||
{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewError("redhatopenshift.OpenShiftClustersClient", "Delete", err.Error())
|
||||
}
|
||||
|
||||
req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "redhatopenshift.OpenShiftClustersClient", "Delete", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.DeleteSender(req)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "redhatopenshift.OpenShiftClustersClient", "Delete", result.Response(), "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// DeletePreparer prepares the Delete request.
|
||||
func (client OpenShiftClustersClient) DeletePreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"resourceName": autorest.Encode("path", resourceName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2022-09-04"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsDelete(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openShiftClusters/{resourceName}", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// DeleteSender sends the Delete request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client OpenShiftClustersClient) DeleteSender(req *http.Request) (future OpenShiftClustersDeleteFuture, err error) {
|
||||
var resp *http.Response
|
||||
future.FutureAPI = &azure.Future{}
|
||||
resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
var azf azure.Future
|
||||
azf, err = azure.NewFutureFromResponse(resp)
|
||||
future.FutureAPI = &azf
|
||||
future.Result = future.result
|
||||
return
|
||||
}
|
||||
|
||||
// DeleteResponder handles the response to the Delete request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client OpenShiftClustersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
|
||||
autorest.ByClosing())
|
||||
result.Response = resp
|
||||
return
|
||||
}
|
||||
|
||||
// Get the operation returns properties of a OpenShift cluster.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group. The name is case insensitive.
|
||||
// resourceName - the name of the OpenShift cluster resource.
|
||||
func (client OpenShiftClustersClient) Get(ctx context.Context, resourceGroupName string, resourceName string) (result OpenShiftCluster, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/OpenShiftClustersClient.Get")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.Response.Response != nil {
|
||||
sc = result.Response.Response.StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: client.SubscriptionID,
|
||||
Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
|
||||
{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewError("redhatopenshift.OpenShiftClustersClient", "Get", err.Error())
|
||||
}
|
||||
|
||||
req, err := client.GetPreparer(ctx, resourceGroupName, resourceName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "redhatopenshift.OpenShiftClustersClient", "Get", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.GetSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "redhatopenshift.OpenShiftClustersClient", "Get", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.GetResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "redhatopenshift.OpenShiftClustersClient", "Get", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// GetPreparer prepares the Get request.
|
||||
func (client OpenShiftClustersClient) GetPreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"resourceName": autorest.Encode("path", resourceName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2022-09-04"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openShiftClusters/{resourceName}", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// GetSender sends the Get request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client OpenShiftClustersClient) GetSender(req *http.Request) (*http.Response, error) {
|
||||
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// GetResponder handles the response to the Get request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client OpenShiftClustersClient) GetResponder(resp *http.Response) (result OpenShiftCluster, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// List the operation returns properties of each OpenShift cluster.
|
||||
func (client OpenShiftClustersClient) List(ctx context.Context) (result OpenShiftClusterListPage, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/OpenShiftClustersClient.List")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.oscl.Response.Response != nil {
|
||||
sc = result.oscl.Response.Response.StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: client.SubscriptionID,
|
||||
Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewError("redhatopenshift.OpenShiftClustersClient", "List", err.Error())
|
||||
}
|
||||
|
||||
result.fn = client.listNextResults
|
||||
req, err := client.ListPreparer(ctx)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "redhatopenshift.OpenShiftClustersClient", "List", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListSender(req)
|
||||
if err != nil {
|
||||
result.oscl.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "redhatopenshift.OpenShiftClustersClient", "List", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result.oscl, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "redhatopenshift.OpenShiftClustersClient", "List", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
if result.oscl.hasNextLink() && result.oscl.IsEmpty() {
|
||||
err = result.NextWithContext(ctx)
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListPreparer prepares the List request.
|
||||
func (client OpenShiftClustersClient) ListPreparer(ctx context.Context) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2022-09-04"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.RedHatOpenShift/openShiftClusters", 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 OpenShiftClustersClient) ListSender(req *http.Request) (*http.Response, error) {
|
||||
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// ListResponder handles the response to the List request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client OpenShiftClustersClient) ListResponder(resp *http.Response) (result OpenShiftClusterList, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
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 OpenShiftClustersClient) listNextResults(ctx context.Context, lastResults OpenShiftClusterList) (result OpenShiftClusterList, err error) {
|
||||
req, err := lastResults.openShiftClusterListPreparer(ctx)
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "redhatopenshift.OpenShiftClustersClient", "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, "redhatopenshift.OpenShiftClustersClient", "listNextResults", resp, "Failure sending next results request")
|
||||
}
|
||||
result, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "redhatopenshift.OpenShiftClustersClient", "listNextResults", resp, "Failure responding to next results request")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// ListComplete enumerates all values, automatically crossing page boundaries as required.
|
||||
func (client OpenShiftClustersClient) ListComplete(ctx context.Context) (result OpenShiftClusterListIterator, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/OpenShiftClustersClient.List")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.Response().Response.Response != nil {
|
||||
sc = result.page.Response().Response.Response.StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
result.page, err = client.List(ctx)
|
||||
return
|
||||
}
|
||||
|
||||
// ListAdminCredentials the operation returns the admin kubeconfig.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group. The name is case insensitive.
|
||||
// resourceName - the name of the OpenShift cluster resource.
|
||||
func (client OpenShiftClustersClient) ListAdminCredentials(ctx context.Context, resourceGroupName string, resourceName string) (result OpenShiftClusterAdminKubeconfig, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/OpenShiftClustersClient.ListAdminCredentials")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.Response.Response != nil {
|
||||
sc = result.Response.Response.StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: client.SubscriptionID,
|
||||
Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
|
||||
{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewError("redhatopenshift.OpenShiftClustersClient", "ListAdminCredentials", err.Error())
|
||||
}
|
||||
|
||||
req, err := client.ListAdminCredentialsPreparer(ctx, resourceGroupName, resourceName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "redhatopenshift.OpenShiftClustersClient", "ListAdminCredentials", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListAdminCredentialsSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "redhatopenshift.OpenShiftClustersClient", "ListAdminCredentials", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.ListAdminCredentialsResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "redhatopenshift.OpenShiftClustersClient", "ListAdminCredentials", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListAdminCredentialsPreparer prepares the ListAdminCredentials request.
|
||||
func (client OpenShiftClustersClient) ListAdminCredentialsPreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"resourceName": autorest.Encode("path", resourceName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2022-09-04"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsPost(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openShiftClusters/{resourceName}/listAdminCredentials", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// ListAdminCredentialsSender sends the ListAdminCredentials request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client OpenShiftClustersClient) ListAdminCredentialsSender(req *http.Request) (*http.Response, error) {
|
||||
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// ListAdminCredentialsResponder handles the response to the ListAdminCredentials request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client OpenShiftClustersClient) ListAdminCredentialsResponder(resp *http.Response) (result OpenShiftClusterAdminKubeconfig, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// ListByResourceGroup the operation returns properties of each OpenShift cluster.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group. The name is case insensitive.
|
||||
func (client OpenShiftClustersClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result OpenShiftClusterListPage, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/OpenShiftClustersClient.ListByResourceGroup")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.oscl.Response.Response != nil {
|
||||
sc = result.oscl.Response.Response.StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: client.SubscriptionID,
|
||||
Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
|
||||
{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewError("redhatopenshift.OpenShiftClustersClient", "ListByResourceGroup", err.Error())
|
||||
}
|
||||
|
||||
result.fn = client.listByResourceGroupNextResults
|
||||
req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "redhatopenshift.OpenShiftClustersClient", "ListByResourceGroup", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListByResourceGroupSender(req)
|
||||
if err != nil {
|
||||
result.oscl.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "redhatopenshift.OpenShiftClustersClient", "ListByResourceGroup", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result.oscl, err = client.ListByResourceGroupResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "redhatopenshift.OpenShiftClustersClient", "ListByResourceGroup", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
if result.oscl.hasNextLink() && result.oscl.IsEmpty() {
|
||||
err = result.NextWithContext(ctx)
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListByResourceGroupPreparer prepares the ListByResourceGroup request.
|
||||
func (client OpenShiftClustersClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2022-09-04"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openShiftClusters", 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 OpenShiftClustersClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) {
|
||||
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client OpenShiftClustersClient) ListByResourceGroupResponder(resp *http.Response) (result OpenShiftClusterList, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
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 OpenShiftClustersClient) listByResourceGroupNextResults(ctx context.Context, lastResults OpenShiftClusterList) (result OpenShiftClusterList, err error) {
|
||||
req, err := lastResults.openShiftClusterListPreparer(ctx)
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "redhatopenshift.OpenShiftClustersClient", "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, "redhatopenshift.OpenShiftClustersClient", "listByResourceGroupNextResults", resp, "Failure sending next results request")
|
||||
}
|
||||
result, err = client.ListByResourceGroupResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "redhatopenshift.OpenShiftClustersClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required.
|
||||
func (client OpenShiftClustersClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result OpenShiftClusterListIterator, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/OpenShiftClustersClient.ListByResourceGroup")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.Response().Response.Response != nil {
|
||||
sc = result.page.Response().Response.Response.StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
result.page, err = client.ListByResourceGroup(ctx, resourceGroupName)
|
||||
return
|
||||
}
|
||||
|
||||
// ListCredentials the operation returns the credentials.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group. The name is case insensitive.
|
||||
// resourceName - the name of the OpenShift cluster resource.
|
||||
func (client OpenShiftClustersClient) ListCredentials(ctx context.Context, resourceGroupName string, resourceName string) (result OpenShiftClusterCredentials, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/OpenShiftClustersClient.ListCredentials")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.Response.Response != nil {
|
||||
sc = result.Response.Response.StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: client.SubscriptionID,
|
||||
Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
|
||||
{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewError("redhatopenshift.OpenShiftClustersClient", "ListCredentials", err.Error())
|
||||
}
|
||||
|
||||
req, err := client.ListCredentialsPreparer(ctx, resourceGroupName, resourceName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "redhatopenshift.OpenShiftClustersClient", "ListCredentials", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListCredentialsSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "redhatopenshift.OpenShiftClustersClient", "ListCredentials", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.ListCredentialsResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "redhatopenshift.OpenShiftClustersClient", "ListCredentials", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListCredentialsPreparer prepares the ListCredentials request.
|
||||
func (client OpenShiftClustersClient) ListCredentialsPreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"resourceName": autorest.Encode("path", resourceName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2022-09-04"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsPost(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openShiftClusters/{resourceName}/listCredentials", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// ListCredentialsSender sends the ListCredentials request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client OpenShiftClustersClient) ListCredentialsSender(req *http.Request) (*http.Response, error) {
|
||||
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// ListCredentialsResponder handles the response to the ListCredentials request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client OpenShiftClustersClient) ListCredentialsResponder(resp *http.Response) (result OpenShiftClusterCredentials, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// Update the operation returns properties of a OpenShift cluster.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group. The name is case insensitive.
|
||||
// resourceName - the name of the OpenShift cluster resource.
|
||||
// parameters - the OpenShift cluster resource.
|
||||
func (client OpenShiftClustersClient) Update(ctx context.Context, resourceGroupName string, resourceName string, parameters OpenShiftClusterUpdate) (result OpenShiftClustersUpdateFuture, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/OpenShiftClustersClient.Update")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
|
||||
sc = result.FutureAPI.Response().StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: client.SubscriptionID,
|
||||
Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
|
||||
{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewError("redhatopenshift.OpenShiftClustersClient", "Update", err.Error())
|
||||
}
|
||||
|
||||
req, err := client.UpdatePreparer(ctx, resourceGroupName, resourceName, parameters)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "redhatopenshift.OpenShiftClustersClient", "Update", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.UpdateSender(req)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "redhatopenshift.OpenShiftClustersClient", "Update", result.Response(), "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// UpdatePreparer prepares the Update request.
|
||||
func (client OpenShiftClustersClient) UpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, parameters OpenShiftClusterUpdate) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"resourceName": autorest.Encode("path", resourceName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2022-09-04"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
parameters.SystemData = nil
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsContentType("application/json; charset=utf-8"),
|
||||
autorest.AsPatch(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openShiftClusters/{resourceName}", pathParameters),
|
||||
autorest.WithJSON(parameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// UpdateSender sends the Update request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client OpenShiftClustersClient) UpdateSender(req *http.Request) (future OpenShiftClustersUpdateFuture, err error) {
|
||||
var resp *http.Response
|
||||
future.FutureAPI = &azure.Future{}
|
||||
resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
var azf azure.Future
|
||||
azf, err = azure.NewFutureFromResponse(resp)
|
||||
future.FutureAPI = &azf
|
||||
future.Result = future.result
|
||||
return
|
||||
}
|
||||
|
||||
// UpdateResponder handles the response to the Update request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client OpenShiftClustersClient) UpdateResponder(resp *http.Response) (result OpenShiftCluster, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
|
@ -0,0 +1,152 @@
|
|||
package redhatopenshift
|
||||
|
||||
// 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"
|
||||
"net/http"
|
||||
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
"github.com/Azure/go-autorest/autorest/azure"
|
||||
"github.com/Azure/go-autorest/tracing"
|
||||
)
|
||||
|
||||
// OperationsClient is the rest API for Azure Red Hat OpenShift 4
|
||||
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 using a custom endpoint. Use this
|
||||
// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
|
||||
func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient {
|
||||
return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// List the operation returns the RP operations.
|
||||
func (client OperationsClient) List(ctx context.Context) (result OperationListPage, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.ol.Response.Response != nil {
|
||||
sc = result.ol.Response.Response.StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
result.fn = client.listNextResults
|
||||
req, err := client.ListPreparer(ctx)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "redhatopenshift.OperationsClient", "List", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListSender(req)
|
||||
if err != nil {
|
||||
result.ol.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "redhatopenshift.OperationsClient", "List", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result.ol, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "redhatopenshift.OperationsClient", "List", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
if result.ol.hasNextLink() && result.ol.IsEmpty() {
|
||||
err = result.NextWithContext(ctx)
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListPreparer prepares the List request.
|
||||
func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) {
|
||||
const APIVersion = "2022-09-04"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPath("/providers/Microsoft.RedHatOpenShift/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 client.Send(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 OperationList, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
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 OperationsClient) listNextResults(ctx context.Context, lastResults OperationList) (result OperationList, err error) {
|
||||
req, err := lastResults.operationListPreparer(ctx)
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "redhatopenshift.OperationsClient", "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, "redhatopenshift.OperationsClient", "listNextResults", resp, "Failure sending next results request")
|
||||
}
|
||||
result, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "redhatopenshift.OperationsClient", "listNextResults", resp, "Failure responding to next results request")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// ListComplete enumerates all values, automatically crossing page boundaries as required.
|
||||
func (client OperationsClient) ListComplete(ctx context.Context) (result OperationListIterator, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.Response().Response.Response != nil {
|
||||
sc = result.page.Response().Response.Response.StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
result.page, err = client.List(ctx)
|
||||
return
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
package redhatopenshiftapi
|
||||
|
||||
// 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/ARO-RP/pkg/client/services/redhatopenshift/mgmt/2022-09-04/redhatopenshift"
|
||||
)
|
||||
|
||||
// OperationsClientAPI contains the set of methods on the OperationsClient type.
|
||||
type OperationsClientAPI interface {
|
||||
List(ctx context.Context) (result redhatopenshift.OperationListPage, err error)
|
||||
ListComplete(ctx context.Context) (result redhatopenshift.OperationListIterator, err error)
|
||||
}
|
||||
|
||||
var _ OperationsClientAPI = (*redhatopenshift.OperationsClient)(nil)
|
||||
|
||||
// OpenShiftClustersClientAPI contains the set of methods on the OpenShiftClustersClient type.
|
||||
type OpenShiftClustersClientAPI interface {
|
||||
CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, parameters redhatopenshift.OpenShiftCluster) (result redhatopenshift.OpenShiftClustersCreateOrUpdateFuture, err error)
|
||||
Delete(ctx context.Context, resourceGroupName string, resourceName string) (result redhatopenshift.OpenShiftClustersDeleteFuture, err error)
|
||||
Get(ctx context.Context, resourceGroupName string, resourceName string) (result redhatopenshift.OpenShiftCluster, err error)
|
||||
List(ctx context.Context) (result redhatopenshift.OpenShiftClusterListPage, err error)
|
||||
ListComplete(ctx context.Context) (result redhatopenshift.OpenShiftClusterListIterator, err error)
|
||||
ListAdminCredentials(ctx context.Context, resourceGroupName string, resourceName string) (result redhatopenshift.OpenShiftClusterAdminKubeconfig, err error)
|
||||
ListByResourceGroup(ctx context.Context, resourceGroupName string) (result redhatopenshift.OpenShiftClusterListPage, err error)
|
||||
ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result redhatopenshift.OpenShiftClusterListIterator, err error)
|
||||
ListCredentials(ctx context.Context, resourceGroupName string, resourceName string) (result redhatopenshift.OpenShiftClusterCredentials, err error)
|
||||
Update(ctx context.Context, resourceGroupName string, resourceName string, parameters redhatopenshift.OpenShiftClusterUpdate) (result redhatopenshift.OpenShiftClustersUpdateFuture, err error)
|
||||
}
|
||||
|
||||
var _ OpenShiftClustersClientAPI = (*redhatopenshift.OpenShiftClustersClient)(nil)
|
|
@ -0,0 +1,28 @@
|
|||
package redhatopenshift
|
||||
|
||||
// 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/" + Version() + " redhatopenshift/2022-09-04"
|
||||
}
|
||||
|
||||
// Version returns the semantic version (see http://semver.org) of the client.
|
||||
func Version() string {
|
||||
return "0.0.0"
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
# coding=utf-8
|
||||
# --------------------------------------------------------------------------
|
||||
# Copyright (c) Microsoft Corporation. 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.
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
from ._azure_red_hat_open_shift_client import AzureRedHatOpenShiftClient
|
||||
__all__ = ['AzureRedHatOpenShiftClient']
|
||||
|
||||
# `._patch.py` is used for handwritten extensions to the generated code
|
||||
# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
|
||||
from ._patch import patch_sdk
|
||||
patch_sdk()
|
|
@ -0,0 +1,113 @@
|
|||
# coding=utf-8
|
||||
# --------------------------------------------------------------------------
|
||||
# Copyright (c) Microsoft Corporation. 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.
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
from copy import deepcopy
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from msrest import Deserializer, Serializer
|
||||
|
||||
from azure.mgmt.core import ARMPipelineClient
|
||||
|
||||
from . import models
|
||||
from ._configuration import AzureRedHatOpenShiftClientConfiguration
|
||||
from .operations import OpenShiftClustersOperations, Operations
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# pylint: disable=unused-import,ungrouped-imports
|
||||
from typing import Any
|
||||
|
||||
from azure.core.credentials import TokenCredential
|
||||
from azure.core.rest import HttpRequest, HttpResponse
|
||||
|
||||
class AzureRedHatOpenShiftClient(object):
|
||||
"""Rest API for Azure Red Hat OpenShift 4.
|
||||
|
||||
:ivar operations: Operations operations
|
||||
:vartype operations: azure.mgmt.redhatopenshift.v2022_09_04.operations.Operations
|
||||
:ivar open_shift_clusters: OpenShiftClustersOperations operations
|
||||
:vartype open_shift_clusters:
|
||||
azure.mgmt.redhatopenshift.v2022_09_04.operations.OpenShiftClustersOperations
|
||||
:param credential: Credential needed for the client to connect to Azure.
|
||||
:type credential: ~azure.core.credentials.TokenCredential
|
||||
:param subscription_id: The ID of the target subscription.
|
||||
:type subscription_id: str
|
||||
:param base_url: Service URL. Default value is 'https://management.azure.com'.
|
||||
:type base_url: str
|
||||
:keyword api_version: Api Version. The default value is "2022-09-04". Note that overriding this
|
||||
default value may result in unsupported behavior.
|
||||
:paramtype api_version: str
|
||||
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
|
||||
Retry-After header is present.
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
credential, # type: "TokenCredential"
|
||||
subscription_id, # type: str
|
||||
base_url="https://management.azure.com", # type: str
|
||||
**kwargs # type: Any
|
||||
):
|
||||
# type: (...) -> None
|
||||
self._config = AzureRedHatOpenShiftClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs)
|
||||
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
|
||||
|
||||
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
|
||||
self._serialize = Serializer(client_models)
|
||||
self._deserialize = Deserializer(client_models)
|
||||
self._serialize.client_side_validation = False
|
||||
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
|
||||
self.open_shift_clusters = OpenShiftClustersOperations(self._client, self._config, self._serialize, self._deserialize)
|
||||
|
||||
|
||||
def _send_request(
|
||||
self,
|
||||
request, # type: HttpRequest
|
||||
**kwargs # type: Any
|
||||
):
|
||||
# type: (...) -> HttpResponse
|
||||
"""Runs the network request through the client's chained policies.
|
||||
|
||||
>>> from azure.core.rest import HttpRequest
|
||||
>>> request = HttpRequest("GET", "https://www.example.org/")
|
||||
<HttpRequest [GET], url: 'https://www.example.org/'>
|
||||
>>> response = client._send_request(request)
|
||||
<HttpResponse: 200 OK>
|
||||
|
||||
For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart
|
||||
|
||||
:param request: The network request you want to make. Required.
|
||||
:type request: ~azure.core.rest.HttpRequest
|
||||
:keyword bool stream: Whether the response payload will be streamed. Defaults to False.
|
||||
:return: The response of your network call. Does not do error handling on your response.
|
||||
:rtype: ~azure.core.rest.HttpResponse
|
||||
"""
|
||||
|
||||
request_copy = deepcopy(request)
|
||||
request_copy.url = self._client.format_url(request_copy.url)
|
||||
return self._client.send_request(request_copy, **kwargs)
|
||||
|
||||
def close(self):
|
||||
# type: () -> None
|
||||
self._client.close()
|
||||
|
||||
def __enter__(self):
|
||||
# type: () -> AzureRedHatOpenShiftClient
|
||||
self._client.__enter__()
|
||||
return self
|
||||
|
||||
def __exit__(self, *exc_details):
|
||||
# type: (Any) -> None
|
||||
self._client.__exit__(*exc_details)
|
|
@ -0,0 +1,83 @@
|
|||
# coding=utf-8
|
||||
# --------------------------------------------------------------------------
|
||||
# Copyright (c) Microsoft Corporation. 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.
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from azure.core.configuration import Configuration
|
||||
from azure.core.pipeline import policies
|
||||
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# pylint: disable=unused-import,ungrouped-imports
|
||||
from typing import Any
|
||||
|
||||
from azure.core.credentials import TokenCredential
|
||||
|
||||
VERSION = "unknown"
|
||||
|
||||
class AzureRedHatOpenShiftClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
|
||||
"""Configuration for AzureRedHatOpenShiftClient.
|
||||
|
||||
Note that all parameters used to create this instance are saved as instance
|
||||
attributes.
|
||||
|
||||
:param credential: Credential needed for the client to connect to Azure.
|
||||
:type credential: ~azure.core.credentials.TokenCredential
|
||||
:param subscription_id: The ID of the target subscription.
|
||||
:type subscription_id: str
|
||||
:keyword api_version: Api Version. The default value is "2022-09-04". Note that overriding this
|
||||
default value may result in unsupported behavior.
|
||||
:paramtype api_version: str
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
credential, # type: "TokenCredential"
|
||||
subscription_id, # type: str
|
||||
**kwargs # type: Any
|
||||
):
|
||||
# type: (...) -> None
|
||||
super(AzureRedHatOpenShiftClientConfiguration, self).__init__(**kwargs)
|
||||
api_version = kwargs.pop('api_version', "2022-09-04") # type: str
|
||||
|
||||
if credential is None:
|
||||
raise ValueError("Parameter 'credential' must not be None.")
|
||||
if subscription_id is None:
|
||||
raise ValueError("Parameter 'subscription_id' must not be None.")
|
||||
|
||||
self.credential = credential
|
||||
self.subscription_id = subscription_id
|
||||
self.api_version = api_version
|
||||
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
|
||||
kwargs.setdefault('sdk_moniker', 'azureredhatopenshiftclient/{}'.format(VERSION))
|
||||
self._configure(**kwargs)
|
||||
|
||||
def _configure(
|
||||
self,
|
||||
**kwargs # type: Any
|
||||
):
|
||||
# type: (...) -> None
|
||||
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
|
||||
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
|
||||
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
|
||||
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
|
||||
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
|
||||
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
|
||||
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
|
||||
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
|
||||
self.authentication_policy = kwargs.get('authentication_policy')
|
||||
if self.credential and not self.authentication_policy:
|
||||
self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)
|
|
@ -0,0 +1,31 @@
|
|||
# coding=utf-8
|
||||
# --------------------------------------------------------------------------
|
||||
#
|
||||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
#
|
||||
# The MIT License (MIT)
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the ""Software""), to
|
||||
# deal in the Software without restriction, including without limitation the
|
||||
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
# sell copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
# IN THE SOFTWARE.
|
||||
#
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
# This file is used for handwritten extensions to the generated code. Example:
|
||||
# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
|
||||
def patch_sdk():
|
||||
pass
|
|
@ -0,0 +1,35 @@
|
|||
# --------------------------------------------------------------------------
|
||||
# Copyright (c) Microsoft Corporation. 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.
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
from azure.core.pipeline.transport import HttpRequest
|
||||
|
||||
def _convert_request(request, files=None):
|
||||
data = request.content if not files else None
|
||||
request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data)
|
||||
if files:
|
||||
request.set_formdata_body(files)
|
||||
return request
|
||||
|
||||
def _format_url_section(template, **kwargs):
|
||||
components = template.split("/")
|
||||
while components:
|
||||
try:
|
||||
return template.format(**kwargs)
|
||||
except KeyError as key:
|
||||
formatted_components = template.split("/")
|
||||
components = [
|
||||
c for c in formatted_components if "{}".format(key.args[0]) not in c
|
||||
]
|
||||
template = "/".join(components)
|
|
@ -0,0 +1,96 @@
|
|||
# coding=utf-8
|
||||
# --------------------------------------------------------------------------
|
||||
# Copyright (c) Microsoft Corporation. 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.
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
try:
|
||||
from ._models_py3 import APIServerProfile
|
||||
from ._models_py3 import CloudErrorBody
|
||||
from ._models_py3 import ClusterProfile
|
||||
from ._models_py3 import ConsoleProfile
|
||||
from ._models_py3 import Display
|
||||
from ._models_py3 import IngressProfile
|
||||
from ._models_py3 import MasterProfile
|
||||
from ._models_py3 import NetworkProfile
|
||||
from ._models_py3 import OpenShiftCluster
|
||||
from ._models_py3 import OpenShiftClusterAdminKubeconfig
|
||||
from ._models_py3 import OpenShiftClusterCredentials
|
||||
from ._models_py3 import OpenShiftClusterList
|
||||
from ._models_py3 import OpenShiftClusterUpdate
|
||||
from ._models_py3 import Operation
|
||||
from ._models_py3 import OperationList
|
||||
from ._models_py3 import Resource
|
||||
from ._models_py3 import ServicePrincipalProfile
|
||||
from ._models_py3 import SystemData
|
||||
from ._models_py3 import TrackedResource
|
||||
from ._models_py3 import WorkerProfile
|
||||
except (SyntaxError, ImportError):
|
||||
from ._models import APIServerProfile # type: ignore
|
||||
from ._models import CloudErrorBody # type: ignore
|
||||
from ._models import ClusterProfile # type: ignore
|
||||
from ._models import ConsoleProfile # type: ignore
|
||||
from ._models import Display # type: ignore
|
||||
from ._models import IngressProfile # type: ignore
|
||||
from ._models import MasterProfile # type: ignore
|
||||
from ._models import NetworkProfile # type: ignore
|
||||
from ._models import OpenShiftCluster # type: ignore
|
||||
from ._models import OpenShiftClusterAdminKubeconfig # type: ignore
|
||||
from ._models import OpenShiftClusterCredentials # type: ignore
|
||||
from ._models import OpenShiftClusterList # type: ignore
|
||||
from ._models import OpenShiftClusterUpdate # type: ignore
|
||||
from ._models import Operation # type: ignore
|
||||
from ._models import OperationList # type: ignore
|
||||
from ._models import Resource # type: ignore
|
||||
from ._models import ServicePrincipalProfile # type: ignore
|
||||
from ._models import SystemData # type: ignore
|
||||
from ._models import TrackedResource # type: ignore
|
||||
from ._models import WorkerProfile # type: ignore
|
||||
|
||||
from ._azure_red_hat_open_shift_client_enums import (
|
||||
CreatedByType,
|
||||
EncryptionAtHost,
|
||||
FipsValidatedModules,
|
||||
ProvisioningState,
|
||||
SoftwareDefinedNetwork,
|
||||
Visibility,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
'APIServerProfile',
|
||||
'CloudErrorBody',
|
||||
'ClusterProfile',
|
||||
'ConsoleProfile',
|
||||
'Display',
|
||||
'IngressProfile',
|
||||
'MasterProfile',
|
||||
'NetworkProfile',
|
||||
'OpenShiftCluster',
|
||||
'OpenShiftClusterAdminKubeconfig',
|
||||
'OpenShiftClusterCredentials',
|
||||
'OpenShiftClusterList',
|
||||
'OpenShiftClusterUpdate',
|
||||
'Operation',
|
||||
'OperationList',
|
||||
'Resource',
|
||||
'ServicePrincipalProfile',
|
||||
'SystemData',
|
||||
'TrackedResource',
|
||||
'WorkerProfile',
|
||||
'CreatedByType',
|
||||
'EncryptionAtHost',
|
||||
'FipsValidatedModules',
|
||||
'ProvisioningState',
|
||||
'SoftwareDefinedNetwork',
|
||||
'Visibility',
|
||||
]
|
|
@ -0,0 +1,68 @@
|
|||
# coding=utf-8
|
||||
# --------------------------------------------------------------------------
|
||||
# Copyright (c) Microsoft Corporation. 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.
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
from enum import Enum
|
||||
from six import with_metaclass
|
||||
from azure.core import CaseInsensitiveEnumMeta
|
||||
|
||||
|
||||
class CreatedByType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
|
||||
"""The type of identity that created the resource.
|
||||
"""
|
||||
|
||||
USER = "User"
|
||||
APPLICATION = "Application"
|
||||
MANAGED_IDENTITY = "ManagedIdentity"
|
||||
KEY = "Key"
|
||||
|
||||
class EncryptionAtHost(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
|
||||
"""EncryptionAtHost represents encryption at host state
|
||||
"""
|
||||
|
||||
DISABLED = "Disabled"
|
||||
ENABLED = "Enabled"
|
||||
|
||||
class FipsValidatedModules(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
|
||||
"""FipsValidatedModules determines if FIPS is used.
|
||||
"""
|
||||
|
||||
DISABLED = "Disabled"
|
||||
ENABLED = "Enabled"
|
||||
|
||||
class ProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
|
||||
"""ProvisioningState represents a provisioning state.
|
||||
"""
|
||||
|
||||
ADMIN_UPDATING = "AdminUpdating"
|
||||
CREATING = "Creating"
|
||||
DELETING = "Deleting"
|
||||
FAILED = "Failed"
|
||||
SUCCEEDED = "Succeeded"
|
||||
UPDATING = "Updating"
|
||||
|
||||
class SoftwareDefinedNetwork(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
|
||||
"""SoftwareDefinedNetwork constants.
|
||||
"""
|
||||
|
||||
OVN_KUBERNETES = "OVNKubernetes"
|
||||
OPEN_SHIFT_SDN = "OpenShiftSDN"
|
||||
|
||||
class Visibility(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
|
||||
"""Visibility represents visibility.
|
||||
"""
|
||||
|
||||
PRIVATE = "Private"
|
||||
PUBLIC = "Public"
|
|
@ -0,0 +1,934 @@
|
|||
# coding=utf-8
|
||||
# --------------------------------------------------------------------------
|
||||
# Copyright (c) Microsoft Corporation. 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 msrest.serialization
|
||||
|
||||
|
||||
class APIServerProfile(msrest.serialization.Model):
|
||||
"""APIServerProfile represents an API server profile.
|
||||
|
||||
:ivar visibility: API server visibility. Possible values include: "Private", "Public".
|
||||
:vartype visibility: str or ~azure.mgmt.redhatopenshift.v2022_09_04.models.Visibility
|
||||
:ivar url: The URL to access the cluster API server.
|
||||
:vartype url: str
|
||||
:ivar ip: The IP of the cluster API server.
|
||||
:vartype ip: str
|
||||
"""
|
||||
|
||||
_attribute_map = {
|
||||
'visibility': {'key': 'visibility', 'type': 'str'},
|
||||
'url': {'key': 'url', 'type': 'str'},
|
||||
'ip': {'key': 'ip', 'type': 'str'},
|
||||
}
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
**kwargs
|
||||
):
|
||||
"""
|
||||
:keyword visibility: API server visibility. Possible values include: "Private", "Public".
|
||||
:paramtype visibility: str or ~azure.mgmt.redhatopenshift.v2022_09_04.models.Visibility
|
||||
:keyword url: The URL to access the cluster API server.
|
||||
:paramtype url: str
|
||||
:keyword ip: The IP of the cluster API server.
|
||||
:paramtype ip: str
|
||||
"""
|
||||
super(APIServerProfile, self).__init__(**kwargs)
|
||||
self.visibility = kwargs.get('visibility', None)
|
||||
self.url = kwargs.get('url', None)
|
||||
self.ip = kwargs.get('ip', None)
|
||||
|
||||
|
||||
class CloudErrorBody(msrest.serialization.Model):
|
||||
"""CloudErrorBody represents the body of a cloud error.
|
||||
|
||||
:ivar code: An identifier for the error. Codes are invariant and are intended to be consumed
|
||||
programmatically.
|
||||
:vartype code: str
|
||||
:ivar message: A message describing the error, intended to be suitable for display in a user
|
||||
interface.
|
||||
:vartype message: str
|
||||
:ivar target: The target of the particular error. For example, the name of the property in
|
||||
error.
|
||||
:vartype target: str
|
||||
:ivar details: A list of additional details about the error.
|
||||
:vartype details: list[~azure.mgmt.redhatopenshift.v2022_09_04.models.CloudErrorBody]
|
||||
"""
|
||||
|
||||
_attribute_map = {
|
||||
'code': {'key': 'code', 'type': 'str'},
|
||||
'message': {'key': 'message', 'type': 'str'},
|
||||
'target': {'key': 'target', 'type': 'str'},
|
||||
'details': {'key': 'details', 'type': '[CloudErrorBody]'},
|
||||
}
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
**kwargs
|
||||
):
|
||||
"""
|
||||
:keyword code: An identifier for the error. Codes are invariant and are intended to be consumed
|
||||
programmatically.
|
||||
:paramtype code: str
|
||||
:keyword message: A message describing the error, intended to be suitable for display in a user
|
||||
interface.
|
||||
:paramtype message: str
|
||||
:keyword target: The target of the particular error. For example, the name of the property in
|
||||
error.
|
||||
:paramtype target: str
|
||||
:keyword details: A list of additional details about the error.
|
||||
:paramtype details: list[~azure.mgmt.redhatopenshift.v2022_09_04.models.CloudErrorBody]
|
||||
"""
|
||||
super(CloudErrorBody, self).__init__(**kwargs)
|
||||
self.code = kwargs.get('code', None)
|
||||
self.message = kwargs.get('message', None)
|
||||
self.target = kwargs.get('target', None)
|
||||
self.details = kwargs.get('details', None)
|
||||
|
||||
|
||||
class ClusterProfile(msrest.serialization.Model):
|
||||
"""ClusterProfile represents a cluster profile.
|
||||
|
||||
:ivar pull_secret: The pull secret for the cluster.
|
||||
:vartype pull_secret: str
|
||||
:ivar domain: The domain for the cluster.
|
||||
:vartype domain: str
|
||||
:ivar version: The version of the cluster.
|
||||
:vartype version: str
|
||||
:ivar resource_group_id: The ID of the cluster resource group.
|
||||
:vartype resource_group_id: str
|
||||
:ivar fips_validated_modules: If FIPS validated crypto modules are used. Possible values
|
||||
include: "Disabled", "Enabled".
|
||||
:vartype fips_validated_modules: str or
|
||||
~azure.mgmt.redhatopenshift.v2022_09_04.models.FipsValidatedModules
|
||||
"""
|
||||
|
||||
_attribute_map = {
|
||||
'pull_secret': {'key': 'pullSecret', 'type': 'str'},
|
||||
'domain': {'key': 'domain', 'type': 'str'},
|
||||
'version': {'key': 'version', 'type': 'str'},
|
||||
'resource_group_id': {'key': 'resourceGroupId', 'type': 'str'},
|
||||
'fips_validated_modules': {'key': 'fipsValidatedModules', 'type': 'str'},
|
||||
}
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
**kwargs
|
||||
):
|
||||
"""
|
||||
:keyword pull_secret: The pull secret for the cluster.
|
||||
:paramtype pull_secret: str
|
||||
:keyword domain: The domain for the cluster.
|
||||
:paramtype domain: str
|
||||
:keyword version: The version of the cluster.
|
||||
:paramtype version: str
|
||||
:keyword resource_group_id: The ID of the cluster resource group.
|
||||
:paramtype resource_group_id: str
|
||||
:keyword fips_validated_modules: If FIPS validated crypto modules are used. Possible values
|
||||
include: "Disabled", "Enabled".
|
||||
:paramtype fips_validated_modules: str or
|
||||
~azure.mgmt.redhatopenshift.v2022_09_04.models.FipsValidatedModules
|
||||
"""
|
||||
super(ClusterProfile, self).__init__(**kwargs)
|
||||
self.pull_secret = kwargs.get('pull_secret', None)
|
||||
self.domain = kwargs.get('domain', None)
|
||||
self.version = kwargs.get('version', None)
|
||||
self.resource_group_id = kwargs.get('resource_group_id', None)
|
||||
self.fips_validated_modules = kwargs.get('fips_validated_modules', None)
|
||||
|
||||
|
||||
class ConsoleProfile(msrest.serialization.Model):
|
||||
"""ConsoleProfile represents a console profile.
|
||||
|
||||
:ivar url: The URL to access the cluster console.
|
||||
:vartype url: str
|
||||
"""
|
||||
|
||||
_attribute_map = {
|
||||
'url': {'key': 'url', 'type': 'str'},
|
||||
}
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
**kwargs
|
||||
):
|
||||
"""
|
||||
:keyword url: The URL to access the cluster console.
|
||||
:paramtype url: str
|
||||
"""
|
||||
super(ConsoleProfile, self).__init__(**kwargs)
|
||||
self.url = kwargs.get('url', None)
|
||||
|
||||
|
||||
class Display(msrest.serialization.Model):
|
||||
"""Display represents the display details of an operation.
|
||||
|
||||
:ivar provider: Friendly name of the resource provider.
|
||||
:vartype provider: str
|
||||
:ivar resource: Resource type on which the operation is performed.
|
||||
:vartype resource: str
|
||||
:ivar operation: Operation type: read, write, delete, listKeys/action, etc.
|
||||
:vartype operation: str
|
||||
:ivar description: Friendly name of the operation.
|
||||
:vartype description: str
|
||||
"""
|
||||
|
||||
_attribute_map = {
|
||||
'provider': {'key': 'provider', 'type': 'str'},
|
||||
'resource': {'key': 'resource', 'type': 'str'},
|
||||
'operation': {'key': 'operation', 'type': 'str'},
|
||||
'description': {'key': 'description', 'type': 'str'},
|
||||
}
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
**kwargs
|
||||
):
|
||||
"""
|
||||
:keyword provider: Friendly name of the resource provider.
|
||||
:paramtype provider: str
|
||||
:keyword resource: Resource type on which the operation is performed.
|
||||
:paramtype resource: str
|
||||
:keyword operation: Operation type: read, write, delete, listKeys/action, etc.
|
||||
:paramtype operation: str
|
||||
:keyword description: Friendly name of the operation.
|
||||
:paramtype description: str
|
||||
"""
|
||||
super(Display, self).__init__(**kwargs)
|
||||
self.provider = kwargs.get('provider', None)
|
||||
self.resource = kwargs.get('resource', None)
|
||||
self.operation = kwargs.get('operation', None)
|
||||
self.description = kwargs.get('description', None)
|
||||
|
||||
|
||||
class IngressProfile(msrest.serialization.Model):
|
||||
"""IngressProfile represents an ingress profile.
|
||||
|
||||
:ivar name: The ingress profile name.
|
||||
:vartype name: str
|
||||
:ivar visibility: Ingress visibility. Possible values include: "Private", "Public".
|
||||
:vartype visibility: str or ~azure.mgmt.redhatopenshift.v2022_09_04.models.Visibility
|
||||
:ivar ip: The IP of the ingress.
|
||||
:vartype ip: str
|
||||
"""
|
||||
|
||||
_attribute_map = {
|
||||
'name': {'key': 'name', 'type': 'str'},
|
||||
'visibility': {'key': 'visibility', 'type': 'str'},
|
||||
'ip': {'key': 'ip', 'type': 'str'},
|
||||
}
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
**kwargs
|
||||
):
|
||||
"""
|
||||
:keyword name: The ingress profile name.
|
||||
:paramtype name: str
|
||||
:keyword visibility: Ingress visibility. Possible values include: "Private", "Public".
|
||||
:paramtype visibility: str or ~azure.mgmt.redhatopenshift.v2022_09_04.models.Visibility
|
||||
:keyword ip: The IP of the ingress.
|
||||
:paramtype ip: str
|
||||
"""
|
||||
super(IngressProfile, self).__init__(**kwargs)
|
||||
self.name = kwargs.get('name', None)
|
||||
self.visibility = kwargs.get('visibility', None)
|
||||
self.ip = kwargs.get('ip', None)
|
||||
|
||||
|
||||
class MasterProfile(msrest.serialization.Model):
|
||||
"""MasterProfile represents a master profile.
|
||||
|
||||
:ivar vm_size: The size of the master VMs.
|
||||
:vartype vm_size: str
|
||||
:ivar subnet_id: The Azure resource ID of the master subnet.
|
||||
:vartype subnet_id: str
|
||||
:ivar encryption_at_host: Whether master virtual machines are encrypted at host. Possible
|
||||
values include: "Disabled", "Enabled".
|
||||
:vartype encryption_at_host: str or
|
||||
~azure.mgmt.redhatopenshift.v2022_09_04.models.EncryptionAtHost
|
||||
:ivar disk_encryption_set_id: The resource ID of an associated DiskEncryptionSet, if
|
||||
applicable.
|
||||
:vartype disk_encryption_set_id: str
|
||||
"""
|
||||
|
||||
_attribute_map = {
|
||||
'vm_size': {'key': 'vmSize', 'type': 'str'},
|
||||
'subnet_id': {'key': 'subnetId', 'type': 'str'},
|
||||
'encryption_at_host': {'key': 'encryptionAtHost', 'type': 'str'},
|
||||
'disk_encryption_set_id': {'key': 'diskEncryptionSetId', 'type': 'str'},
|
||||
}
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
**kwargs
|
||||
):
|
||||
"""
|
||||
:keyword vm_size: The size of the master VMs.
|
||||
:paramtype vm_size: str
|
||||
:keyword subnet_id: The Azure resource ID of the master subnet.
|
||||
:paramtype subnet_id: str
|
||||
:keyword encryption_at_host: Whether master virtual machines are encrypted at host. Possible
|
||||
values include: "Disabled", "Enabled".
|
||||
:paramtype encryption_at_host: str or
|
||||
~azure.mgmt.redhatopenshift.v2022_09_04.models.EncryptionAtHost
|
||||
:keyword disk_encryption_set_id: The resource ID of an associated DiskEncryptionSet, if
|
||||
applicable.
|
||||
:paramtype disk_encryption_set_id: str
|
||||
"""
|
||||
super(MasterProfile, self).__init__(**kwargs)
|
||||
self.vm_size = kwargs.get('vm_size', None)
|
||||
self.subnet_id = kwargs.get('subnet_id', None)
|
||||
self.encryption_at_host = kwargs.get('encryption_at_host', None)
|
||||
self.disk_encryption_set_id = kwargs.get('disk_encryption_set_id', None)
|
||||
|
||||
|
||||
class NetworkProfile(msrest.serialization.Model):
|
||||
"""NetworkProfile represents a network profile.
|
||||
|
||||
:ivar software_defined_network: The Software Defined Network (SDN) type to use when installing
|
||||
the cluster. Possible values include: "OVNKubernetes", "OpenShiftSDN".
|
||||
:vartype software_defined_network: str or
|
||||
~azure.mgmt.redhatopenshift.v2022_09_04.models.SoftwareDefinedNetwork
|
||||
:ivar pod_cidr: The CIDR used for OpenShift/Kubernetes Pods.
|
||||
:vartype pod_cidr: str
|
||||
:ivar service_cidr: The CIDR used for OpenShift/Kubernetes Services.
|
||||
:vartype service_cidr: str
|
||||
"""
|
||||
|
||||
_attribute_map = {
|
||||
'software_defined_network': {'key': 'softwareDefinedNetwork', 'type': 'str'},
|
||||
'pod_cidr': {'key': 'podCidr', 'type': 'str'},
|
||||
'service_cidr': {'key': 'serviceCidr', 'type': 'str'},
|
||||
}
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
**kwargs
|
||||
):
|
||||
"""
|
||||
:keyword software_defined_network: The Software Defined Network (SDN) type to use when
|
||||
installing the cluster. Possible values include: "OVNKubernetes", "OpenShiftSDN".
|
||||
:paramtype software_defined_network: str or
|
||||
~azure.mgmt.redhatopenshift.v2022_09_04.models.SoftwareDefinedNetwork
|
||||
:keyword pod_cidr: The CIDR used for OpenShift/Kubernetes Pods.
|
||||
:paramtype pod_cidr: str
|
||||
:keyword service_cidr: The CIDR used for OpenShift/Kubernetes Services.
|
||||
:paramtype service_cidr: str
|
||||
"""
|
||||
super(NetworkProfile, self).__init__(**kwargs)
|
||||
self.software_defined_network = kwargs.get('software_defined_network', None)
|
||||
self.pod_cidr = kwargs.get('pod_cidr', None)
|
||||
self.service_cidr = kwargs.get('service_cidr', None)
|
||||
|
||||
|
||||
class Resource(msrest.serialization.Model):
|
||||
"""Common fields that are returned in the response for all Azure Resource Manager resources.
|
||||
|
||||
Variables are only populated by the server, and will be ignored when sending a request.
|
||||
|
||||
:ivar id: Fully qualified resource ID for the resource. Ex -
|
||||
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
|
||||
:vartype id: str
|
||||
:ivar name: The name of the resource.
|
||||
:vartype name: str
|
||||
:ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
|
||||
"Microsoft.Storage/storageAccounts".
|
||||
:vartype type: str
|
||||
"""
|
||||
|
||||
_validation = {
|
||||
'id': {'readonly': True},
|
||||
'name': {'readonly': True},
|
||||
'type': {'readonly': True},
|
||||
}
|
||||
|
||||
_attribute_map = {
|
||||
'id': {'key': 'id', 'type': 'str'},
|
||||
'name': {'key': 'name', 'type': 'str'},
|
||||
'type': {'key': 'type', 'type': 'str'},
|
||||
}
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
**kwargs
|
||||
):
|
||||
"""
|
||||
"""
|
||||
super(Resource, self).__init__(**kwargs)
|
||||
self.id = None
|
||||
self.name = None
|
||||
self.type = None
|
||||
|
||||
|
||||
class TrackedResource(Resource):
|
||||
"""The resource model definition for an Azure Resource Manager tracked top level resource.
|
||||
|
||||
Variables are only populated by the server, and will be ignored when sending a request.
|
||||
|
||||
All required parameters must be populated in order to send to Azure.
|
||||
|
||||
:ivar id: Fully qualified resource ID for the resource. Ex -
|
||||
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
|
||||
:vartype id: str
|
||||
:ivar name: The name of the resource.
|
||||
:vartype name: str
|
||||
:ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
|
||||
"Microsoft.Storage/storageAccounts".
|
||||
:vartype type: str
|
||||
:ivar tags: A set of tags. Resource tags.
|
||||
:vartype tags: dict[str, str]
|
||||
:ivar location: Required. The geo-location where the resource lives.
|
||||
:vartype location: str
|
||||
"""
|
||||
|
||||
_validation = {
|
||||
'id': {'readonly': True},
|
||||
'name': {'readonly': True},
|
||||
'type': {'readonly': True},
|
||||
'location': {'required': True},
|
||||
}
|
||||
|
||||
_attribute_map = {
|
||||
'id': {'key': 'id', 'type': 'str'},
|
||||
'name': {'key': 'name', 'type': 'str'},
|
||||
'type': {'key': 'type', 'type': 'str'},
|
||||
'tags': {'key': 'tags', 'type': '{str}'},
|
||||
'location': {'key': 'location', 'type': 'str'},
|
||||
}
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
**kwargs
|
||||
):
|
||||
"""
|
||||
:keyword tags: A set of tags. Resource tags.
|
||||
:paramtype tags: dict[str, str]
|
||||
:keyword location: Required. The geo-location where the resource lives.
|
||||
:paramtype location: str
|
||||
"""
|
||||
super(TrackedResource, self).__init__(**kwargs)
|
||||
self.tags = kwargs.get('tags', None)
|
||||
self.location = kwargs['location']
|
||||
|
||||
|
||||
class OpenShiftCluster(TrackedResource):
|
||||
"""OpenShiftCluster represents an Azure Red Hat OpenShift cluster.
|
||||
|
||||
Variables are only populated by the server, and will be ignored when sending a request.
|
||||
|
||||
All required parameters must be populated in order to send to Azure.
|
||||
|
||||
:ivar id: Fully qualified resource ID for the resource. Ex -
|
||||
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
|
||||
:vartype id: str
|
||||
:ivar name: The name of the resource.
|
||||
:vartype name: str
|
||||
:ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
|
||||
"Microsoft.Storage/storageAccounts".
|
||||
:vartype type: str
|
||||
:ivar tags: A set of tags. Resource tags.
|
||||
:vartype tags: dict[str, str]
|
||||
:ivar location: Required. The geo-location where the resource lives.
|
||||
:vartype location: str
|
||||
:ivar system_data: The system meta data relating to this resource.
|
||||
:vartype system_data: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SystemData
|
||||
:ivar provisioning_state: The cluster provisioning state. Possible values include:
|
||||
"AdminUpdating", "Creating", "Deleting", "Failed", "Succeeded", "Updating".
|
||||
:vartype provisioning_state: str or
|
||||
~azure.mgmt.redhatopenshift.v2022_09_04.models.ProvisioningState
|
||||
:ivar cluster_profile: The cluster profile.
|
||||
:vartype cluster_profile: ~azure.mgmt.redhatopenshift.v2022_09_04.models.ClusterProfile
|
||||
:ivar console_profile: The console profile.
|
||||
:vartype console_profile: ~azure.mgmt.redhatopenshift.v2022_09_04.models.ConsoleProfile
|
||||
:ivar service_principal_profile: The cluster service principal profile.
|
||||
:vartype service_principal_profile:
|
||||
~azure.mgmt.redhatopenshift.v2022_09_04.models.ServicePrincipalProfile
|
||||
:ivar network_profile: The cluster network profile.
|
||||
:vartype network_profile: ~azure.mgmt.redhatopenshift.v2022_09_04.models.NetworkProfile
|
||||
:ivar master_profile: The cluster master profile.
|
||||
:vartype master_profile: ~azure.mgmt.redhatopenshift.v2022_09_04.models.MasterProfile
|
||||
:ivar worker_profiles: The cluster worker profiles.
|
||||
:vartype worker_profiles: list[~azure.mgmt.redhatopenshift.v2022_09_04.models.WorkerProfile]
|
||||
:ivar apiserver_profile: The cluster API server profile.
|
||||
:vartype apiserver_profile: ~azure.mgmt.redhatopenshift.v2022_09_04.models.APIServerProfile
|
||||
:ivar ingress_profiles: The cluster ingress profiles.
|
||||
:vartype ingress_profiles: list[~azure.mgmt.redhatopenshift.v2022_09_04.models.IngressProfile]
|
||||
"""
|
||||
|
||||
_validation = {
|
||||
'id': {'readonly': True},
|
||||
'name': {'readonly': True},
|
||||
'type': {'readonly': True},
|
||||
'location': {'required': True},
|
||||
'system_data': {'readonly': True},
|
||||
}
|
||||
|
||||
_attribute_map = {
|
||||
'id': {'key': 'id', 'type': 'str'},
|
||||
'name': {'key': 'name', 'type': 'str'},
|
||||
'type': {'key': 'type', 'type': 'str'},
|
||||
'tags': {'key': 'tags', 'type': '{str}'},
|
||||
'location': {'key': 'location', 'type': 'str'},
|
||||
'system_data': {'key': 'systemData', 'type': 'SystemData'},
|
||||
'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'},
|
||||
'cluster_profile': {'key': 'properties.clusterProfile', 'type': 'ClusterProfile'},
|
||||
'console_profile': {'key': 'properties.consoleProfile', 'type': 'ConsoleProfile'},
|
||||
'service_principal_profile': {'key': 'properties.servicePrincipalProfile', 'type': 'ServicePrincipalProfile'},
|
||||
'network_profile': {'key': 'properties.networkProfile', 'type': 'NetworkProfile'},
|
||||
'master_profile': {'key': 'properties.masterProfile', 'type': 'MasterProfile'},
|
||||
'worker_profiles': {'key': 'properties.workerProfiles', 'type': '[WorkerProfile]'},
|
||||
'apiserver_profile': {'key': 'properties.apiserverProfile', 'type': 'APIServerProfile'},
|
||||
'ingress_profiles': {'key': 'properties.ingressProfiles', 'type': '[IngressProfile]'},
|
||||
}
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
**kwargs
|
||||
):
|
||||
"""
|
||||
:keyword tags: A set of tags. Resource tags.
|
||||
:paramtype tags: dict[str, str]
|
||||
:keyword location: Required. The geo-location where the resource lives.
|
||||
:paramtype location: str
|
||||
:keyword provisioning_state: The cluster provisioning state. Possible values include:
|
||||
"AdminUpdating", "Creating", "Deleting", "Failed", "Succeeded", "Updating".
|
||||
:paramtype provisioning_state: str or
|
||||
~azure.mgmt.redhatopenshift.v2022_09_04.models.ProvisioningState
|
||||
:keyword cluster_profile: The cluster profile.
|
||||
:paramtype cluster_profile: ~azure.mgmt.redhatopenshift.v2022_09_04.models.ClusterProfile
|
||||
:keyword console_profile: The console profile.
|
||||
:paramtype console_profile: ~azure.mgmt.redhatopenshift.v2022_09_04.models.ConsoleProfile
|
||||
:keyword service_principal_profile: The cluster service principal profile.
|
||||
:paramtype service_principal_profile:
|
||||
~azure.mgmt.redhatopenshift.v2022_09_04.models.ServicePrincipalProfile
|
||||
:keyword network_profile: The cluster network profile.
|
||||
:paramtype network_profile: ~azure.mgmt.redhatopenshift.v2022_09_04.models.NetworkProfile
|
||||
:keyword master_profile: The cluster master profile.
|
||||
:paramtype master_profile: ~azure.mgmt.redhatopenshift.v2022_09_04.models.MasterProfile
|
||||
:keyword worker_profiles: The cluster worker profiles.
|
||||
:paramtype worker_profiles: list[~azure.mgmt.redhatopenshift.v2022_09_04.models.WorkerProfile]
|
||||
:keyword apiserver_profile: The cluster API server profile.
|
||||
:paramtype apiserver_profile: ~azure.mgmt.redhatopenshift.v2022_09_04.models.APIServerProfile
|
||||
:keyword ingress_profiles: The cluster ingress profiles.
|
||||
:paramtype ingress_profiles:
|
||||
list[~azure.mgmt.redhatopenshift.v2022_09_04.models.IngressProfile]
|
||||
"""
|
||||
super(OpenShiftCluster, self).__init__(**kwargs)
|
||||
self.system_data = None
|
||||
self.provisioning_state = kwargs.get('provisioning_state', None)
|
||||
self.cluster_profile = kwargs.get('cluster_profile', None)
|
||||
self.console_profile = kwargs.get('console_profile', None)
|
||||
self.service_principal_profile = kwargs.get('service_principal_profile', None)
|
||||
self.network_profile = kwargs.get('network_profile', None)
|
||||
self.master_profile = kwargs.get('master_profile', None)
|
||||
self.worker_profiles = kwargs.get('worker_profiles', None)
|
||||
self.apiserver_profile = kwargs.get('apiserver_profile', None)
|
||||
self.ingress_profiles = kwargs.get('ingress_profiles', None)
|
||||
|
||||
|
||||
class OpenShiftClusterAdminKubeconfig(msrest.serialization.Model):
|
||||
"""OpenShiftClusterAdminKubeconfig represents an OpenShift cluster's admin kubeconfig.
|
||||
|
||||
:ivar kubeconfig: The base64-encoded kubeconfig file.
|
||||
:vartype kubeconfig: str
|
||||
"""
|
||||
|
||||
_attribute_map = {
|
||||
'kubeconfig': {'key': 'kubeconfig', 'type': 'str'},
|
||||
}
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
**kwargs
|
||||
):
|
||||
"""
|
||||
:keyword kubeconfig: The base64-encoded kubeconfig file.
|
||||
:paramtype kubeconfig: str
|
||||
"""
|
||||
super(OpenShiftClusterAdminKubeconfig, self).__init__(**kwargs)
|
||||
self.kubeconfig = kwargs.get('kubeconfig', None)
|
||||
|
||||
|
||||
class OpenShiftClusterCredentials(msrest.serialization.Model):
|
||||
"""OpenShiftClusterCredentials represents an OpenShift cluster's credentials.
|
||||
|
||||
:ivar kubeadmin_username: The username for the kubeadmin user.
|
||||
:vartype kubeadmin_username: str
|
||||
:ivar kubeadmin_password: The password for the kubeadmin user.
|
||||
:vartype kubeadmin_password: str
|
||||
"""
|
||||
|
||||
_attribute_map = {
|
||||
'kubeadmin_username': {'key': 'kubeadminUsername', 'type': 'str'},
|
||||
'kubeadmin_password': {'key': 'kubeadminPassword', 'type': 'str'},
|
||||
}
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
**kwargs
|
||||
):
|
||||
"""
|
||||
:keyword kubeadmin_username: The username for the kubeadmin user.
|
||||
:paramtype kubeadmin_username: str
|
||||
:keyword kubeadmin_password: The password for the kubeadmin user.
|
||||
:paramtype kubeadmin_password: str
|
||||
"""
|
||||
super(OpenShiftClusterCredentials, self).__init__(**kwargs)
|
||||
self.kubeadmin_username = kwargs.get('kubeadmin_username', None)
|
||||
self.kubeadmin_password = kwargs.get('kubeadmin_password', None)
|
||||
|
||||
|
||||
class OpenShiftClusterList(msrest.serialization.Model):
|
||||
"""OpenShiftClusterList represents a list of OpenShift clusters.
|
||||
|
||||
:ivar value: The list of OpenShift clusters.
|
||||
:vartype value: list[~azure.mgmt.redhatopenshift.v2022_09_04.models.OpenShiftCluster]
|
||||
:ivar next_link: The link used to get the next page of operations.
|
||||
:vartype next_link: str
|
||||
"""
|
||||
|
||||
_attribute_map = {
|
||||
'value': {'key': 'value', 'type': '[OpenShiftCluster]'},
|
||||
'next_link': {'key': 'nextLink', 'type': 'str'},
|
||||
}
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
**kwargs
|
||||
):
|
||||
"""
|
||||
:keyword value: The list of OpenShift clusters.
|
||||
:paramtype value: list[~azure.mgmt.redhatopenshift.v2022_09_04.models.OpenShiftCluster]
|
||||
:keyword next_link: The link used to get the next page of operations.
|
||||
:paramtype next_link: str
|
||||
"""
|
||||
super(OpenShiftClusterList, self).__init__(**kwargs)
|
||||
self.value = kwargs.get('value', None)
|
||||
self.next_link = kwargs.get('next_link', None)
|
||||
|
||||
|
||||
class OpenShiftClusterUpdate(msrest.serialization.Model):
|
||||
"""OpenShiftCluster represents an Azure Red Hat OpenShift cluster.
|
||||
|
||||
Variables are only populated by the server, and will be ignored when sending a request.
|
||||
|
||||
:ivar tags: A set of tags. The resource tags.
|
||||
:vartype tags: dict[str, str]
|
||||
:ivar system_data: The system meta data relating to this resource.
|
||||
:vartype system_data: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SystemData
|
||||
:ivar provisioning_state: The cluster provisioning state. Possible values include:
|
||||
"AdminUpdating", "Creating", "Deleting", "Failed", "Succeeded", "Updating".
|
||||
:vartype provisioning_state: str or
|
||||
~azure.mgmt.redhatopenshift.v2022_09_04.models.ProvisioningState
|
||||
:ivar cluster_profile: The cluster profile.
|
||||
:vartype cluster_profile: ~azure.mgmt.redhatopenshift.v2022_09_04.models.ClusterProfile
|
||||
:ivar console_profile: The console profile.
|
||||
:vartype console_profile: ~azure.mgmt.redhatopenshift.v2022_09_04.models.ConsoleProfile
|
||||
:ivar service_principal_profile: The cluster service principal profile.
|
||||
:vartype service_principal_profile:
|
||||
~azure.mgmt.redhatopenshift.v2022_09_04.models.ServicePrincipalProfile
|
||||
:ivar network_profile: The cluster network profile.
|
||||
:vartype network_profile: ~azure.mgmt.redhatopenshift.v2022_09_04.models.NetworkProfile
|
||||
:ivar master_profile: The cluster master profile.
|
||||
:vartype master_profile: ~azure.mgmt.redhatopenshift.v2022_09_04.models.MasterProfile
|
||||
:ivar worker_profiles: The cluster worker profiles.
|
||||
:vartype worker_profiles: list[~azure.mgmt.redhatopenshift.v2022_09_04.models.WorkerProfile]
|
||||
:ivar apiserver_profile: The cluster API server profile.
|
||||
:vartype apiserver_profile: ~azure.mgmt.redhatopenshift.v2022_09_04.models.APIServerProfile
|
||||
:ivar ingress_profiles: The cluster ingress profiles.
|
||||
:vartype ingress_profiles: list[~azure.mgmt.redhatopenshift.v2022_09_04.models.IngressProfile]
|
||||
"""
|
||||
|
||||
_validation = {
|
||||
'system_data': {'readonly': True},
|
||||
}
|
||||
|
||||
_attribute_map = {
|
||||
'tags': {'key': 'tags', 'type': '{str}'},
|
||||
'system_data': {'key': 'systemData', 'type': 'SystemData'},
|
||||
'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'},
|
||||
'cluster_profile': {'key': 'properties.clusterProfile', 'type': 'ClusterProfile'},
|
||||
'console_profile': {'key': 'properties.consoleProfile', 'type': 'ConsoleProfile'},
|
||||
'service_principal_profile': {'key': 'properties.servicePrincipalProfile', 'type': 'ServicePrincipalProfile'},
|
||||
'network_profile': {'key': 'properties.networkProfile', 'type': 'NetworkProfile'},
|
||||
'master_profile': {'key': 'properties.masterProfile', 'type': 'MasterProfile'},
|
||||
'worker_profiles': {'key': 'properties.workerProfiles', 'type': '[WorkerProfile]'},
|
||||
'apiserver_profile': {'key': 'properties.apiserverProfile', 'type': 'APIServerProfile'},
|
||||
'ingress_profiles': {'key': 'properties.ingressProfiles', 'type': '[IngressProfile]'},
|
||||
}
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
**kwargs
|
||||
):
|
||||
"""
|
||||
:keyword tags: A set of tags. The resource tags.
|
||||
:paramtype tags: dict[str, str]
|
||||
:keyword provisioning_state: The cluster provisioning state. Possible values include:
|
||||
"AdminUpdating", "Creating", "Deleting", "Failed", "Succeeded", "Updating".
|
||||
:paramtype provisioning_state: str or
|
||||
~azure.mgmt.redhatopenshift.v2022_09_04.models.ProvisioningState
|
||||
:keyword cluster_profile: The cluster profile.
|
||||
:paramtype cluster_profile: ~azure.mgmt.redhatopenshift.v2022_09_04.models.ClusterProfile
|
||||
:keyword console_profile: The console profile.
|
||||
:paramtype console_profile: ~azure.mgmt.redhatopenshift.v2022_09_04.models.ConsoleProfile
|
||||
:keyword service_principal_profile: The cluster service principal profile.
|
||||
:paramtype service_principal_profile:
|
||||
~azure.mgmt.redhatopenshift.v2022_09_04.models.ServicePrincipalProfile
|
||||
:keyword network_profile: The cluster network profile.
|
||||
:paramtype network_profile: ~azure.mgmt.redhatopenshift.v2022_09_04.models.NetworkProfile
|
||||
:keyword master_profile: The cluster master profile.
|
||||
:paramtype master_profile: ~azure.mgmt.redhatopenshift.v2022_09_04.models.MasterProfile
|
||||
:keyword worker_profiles: The cluster worker profiles.
|
||||
:paramtype worker_profiles: list[~azure.mgmt.redhatopenshift.v2022_09_04.models.WorkerProfile]
|
||||
:keyword apiserver_profile: The cluster API server profile.
|
||||
:paramtype apiserver_profile: ~azure.mgmt.redhatopenshift.v2022_09_04.models.APIServerProfile
|
||||
:keyword ingress_profiles: The cluster ingress profiles.
|
||||
:paramtype ingress_profiles:
|
||||
list[~azure.mgmt.redhatopenshift.v2022_09_04.models.IngressProfile]
|
||||
"""
|
||||
super(OpenShiftClusterUpdate, self).__init__(**kwargs)
|
||||
self.tags = kwargs.get('tags', None)
|
||||
self.system_data = None
|
||||
self.provisioning_state = kwargs.get('provisioning_state', None)
|
||||
self.cluster_profile = kwargs.get('cluster_profile', None)
|
||||
self.console_profile = kwargs.get('console_profile', None)
|
||||
self.service_principal_profile = kwargs.get('service_principal_profile', None)
|
||||
self.network_profile = kwargs.get('network_profile', None)
|
||||
self.master_profile = kwargs.get('master_profile', None)
|
||||
self.worker_profiles = kwargs.get('worker_profiles', None)
|
||||
self.apiserver_profile = kwargs.get('apiserver_profile', None)
|
||||
self.ingress_profiles = kwargs.get('ingress_profiles', None)
|
||||
|
||||
|
||||
class Operation(msrest.serialization.Model):
|
||||
"""Operation represents an RP operation.
|
||||
|
||||
:ivar name: Operation name: {provider}/{resource}/{operation}.
|
||||
:vartype name: str
|
||||
:ivar display: The object that describes the operation.
|
||||
:vartype display: ~azure.mgmt.redhatopenshift.v2022_09_04.models.Display
|
||||
:ivar origin: Sources of requests to this operation. Comma separated list with valid values
|
||||
user or system, e.g. "user,system".
|
||||
:vartype origin: str
|
||||
"""
|
||||
|
||||
_attribute_map = {
|
||||
'name': {'key': 'name', 'type': 'str'},
|
||||
'display': {'key': 'display', 'type': 'Display'},
|
||||
'origin': {'key': 'origin', 'type': 'str'},
|
||||
}
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
**kwargs
|
||||
):
|
||||
"""
|
||||
:keyword name: Operation name: {provider}/{resource}/{operation}.
|
||||
:paramtype name: str
|
||||
:keyword display: The object that describes the operation.
|
||||
:paramtype display: ~azure.mgmt.redhatopenshift.v2022_09_04.models.Display
|
||||
:keyword origin: Sources of requests to this operation. Comma separated list with valid values
|
||||
user or system, e.g. "user,system".
|
||||
:paramtype origin: str
|
||||
"""
|
||||
super(Operation, self).__init__(**kwargs)
|
||||
self.name = kwargs.get('name', None)
|
||||
self.display = kwargs.get('display', None)
|
||||
self.origin = kwargs.get('origin', None)
|
||||
|
||||
|
||||
class OperationList(msrest.serialization.Model):
|
||||
"""OperationList represents an RP operation list.
|
||||
|
||||
:ivar value: List of operations supported by the resource provider.
|
||||
:vartype value: list[~azure.mgmt.redhatopenshift.v2022_09_04.models.Operation]
|
||||
:ivar next_link: The link used to get the next page of operations.
|
||||
:vartype next_link: str
|
||||
"""
|
||||
|
||||
_attribute_map = {
|
||||
'value': {'key': 'value', 'type': '[Operation]'},
|
||||
'next_link': {'key': 'nextLink', 'type': 'str'},
|
||||
}
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
**kwargs
|
||||
):
|
||||
"""
|
||||
:keyword value: List of operations supported by the resource provider.
|
||||
:paramtype value: list[~azure.mgmt.redhatopenshift.v2022_09_04.models.Operation]
|
||||
:keyword next_link: The link used to get the next page of operations.
|
||||
:paramtype next_link: str
|
||||
"""
|
||||
super(OperationList, self).__init__(**kwargs)
|
||||
self.value = kwargs.get('value', None)
|
||||
self.next_link = kwargs.get('next_link', None)
|
||||
|
||||
|
||||
class ServicePrincipalProfile(msrest.serialization.Model):
|
||||
"""ServicePrincipalProfile represents a service principal profile.
|
||||
|
||||
:ivar client_id: The client ID used for the cluster.
|
||||
:vartype client_id: str
|
||||
:ivar client_secret: The client secret used for the cluster.
|
||||
:vartype client_secret: str
|
||||
"""
|
||||
|
||||
_attribute_map = {
|
||||
'client_id': {'key': 'clientId', 'type': 'str'},
|
||||
'client_secret': {'key': 'clientSecret', 'type': 'str'},
|
||||
}
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
**kwargs
|
||||
):
|
||||
"""
|
||||
:keyword client_id: The client ID used for the cluster.
|
||||
:paramtype client_id: str
|
||||
:keyword client_secret: The client secret used for the cluster.
|
||||
:paramtype client_secret: str
|
||||
"""
|
||||
super(ServicePrincipalProfile, self).__init__(**kwargs)
|
||||
self.client_id = kwargs.get('client_id', None)
|
||||
self.client_secret = kwargs.get('client_secret', None)
|
||||
|
||||
|
||||
class SystemData(msrest.serialization.Model):
|
||||
"""Metadata pertaining to creation and last modification of the resource.
|
||||
|
||||
:ivar created_by: The identity that created the resource.
|
||||
:vartype created_by: str
|
||||
:ivar created_by_type: The type of identity that created the resource. Possible values include:
|
||||
"User", "Application", "ManagedIdentity", "Key".
|
||||
:vartype created_by_type: str or ~azure.mgmt.redhatopenshift.v2022_09_04.models.CreatedByType
|
||||
:ivar created_at: The timestamp of resource creation (UTC).
|
||||
:vartype created_at: ~datetime.datetime
|
||||
:ivar last_modified_by: The identity that last modified the resource.
|
||||
:vartype last_modified_by: str
|
||||
:ivar last_modified_by_type: The type of identity that last modified the resource. Possible
|
||||
values include: "User", "Application", "ManagedIdentity", "Key".
|
||||
:vartype last_modified_by_type: str or
|
||||
~azure.mgmt.redhatopenshift.v2022_09_04.models.CreatedByType
|
||||
:ivar last_modified_at: The type of identity that last modified the resource.
|
||||
:vartype last_modified_at: ~datetime.datetime
|
||||
"""
|
||||
|
||||
_attribute_map = {
|
||||
'created_by': {'key': 'createdBy', 'type': 'str'},
|
||||
'created_by_type': {'key': 'createdByType', 'type': 'str'},
|
||||
'created_at': {'key': 'createdAt', 'type': 'iso-8601'},
|
||||
'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'},
|
||||
'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'},
|
||||
'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'},
|
||||
}
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
**kwargs
|
||||
):
|
||||
"""
|
||||
:keyword created_by: The identity that created the resource.
|
||||
:paramtype created_by: str
|
||||
:keyword created_by_type: The type of identity that created the resource. Possible values
|
||||
include: "User", "Application", "ManagedIdentity", "Key".
|
||||
:paramtype created_by_type: str or ~azure.mgmt.redhatopenshift.v2022_09_04.models.CreatedByType
|
||||
:keyword created_at: The timestamp of resource creation (UTC).
|
||||
:paramtype created_at: ~datetime.datetime
|
||||
:keyword last_modified_by: The identity that last modified the resource.
|
||||
:paramtype last_modified_by: str
|
||||
:keyword last_modified_by_type: The type of identity that last modified the resource. Possible
|
||||
values include: "User", "Application", "ManagedIdentity", "Key".
|
||||
:paramtype last_modified_by_type: str or
|
||||
~azure.mgmt.redhatopenshift.v2022_09_04.models.CreatedByType
|
||||
:keyword last_modified_at: The type of identity that last modified the resource.
|
||||
:paramtype last_modified_at: ~datetime.datetime
|
||||
"""
|
||||
super(SystemData, self).__init__(**kwargs)
|
||||
self.created_by = kwargs.get('created_by', None)
|
||||
self.created_by_type = kwargs.get('created_by_type', None)
|
||||
self.created_at = kwargs.get('created_at', None)
|
||||
self.last_modified_by = kwargs.get('last_modified_by', None)
|
||||
self.last_modified_by_type = kwargs.get('last_modified_by_type', None)
|
||||
self.last_modified_at = kwargs.get('last_modified_at', None)
|
||||
|
||||
|
||||
class WorkerProfile(msrest.serialization.Model):
|
||||
"""WorkerProfile represents a worker profile.
|
||||
|
||||
:ivar name: The worker profile name.
|
||||
:vartype name: str
|
||||
:ivar vm_size: The size of the worker VMs.
|
||||
:vartype vm_size: str
|
||||
:ivar disk_size_gb: The disk size of the worker VMs.
|
||||
:vartype disk_size_gb: int
|
||||
:ivar subnet_id: The Azure resource ID of the worker subnet.
|
||||
:vartype subnet_id: str
|
||||
:ivar count: The number of worker VMs.
|
||||
:vartype count: int
|
||||
:ivar encryption_at_host: Whether master virtual machines are encrypted at host. Possible
|
||||
values include: "Disabled", "Enabled".
|
||||
:vartype encryption_at_host: str or
|
||||
~azure.mgmt.redhatopenshift.v2022_09_04.models.EncryptionAtHost
|
||||
:ivar disk_encryption_set_id: The resource ID of an associated DiskEncryptionSet, if
|
||||
applicable.
|
||||
:vartype disk_encryption_set_id: str
|
||||
"""
|
||||
|
||||
_attribute_map = {
|
||||
'name': {'key': 'name', 'type': 'str'},
|
||||
'vm_size': {'key': 'vmSize', 'type': 'str'},
|
||||
'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'},
|
||||
'subnet_id': {'key': 'subnetId', 'type': 'str'},
|
||||
'count': {'key': 'count', 'type': 'int'},
|
||||
'encryption_at_host': {'key': 'encryptionAtHost', 'type': 'str'},
|
||||
'disk_encryption_set_id': {'key': 'diskEncryptionSetId', 'type': 'str'},
|
||||
}
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
**kwargs
|
||||
):
|
||||
"""
|
||||
:keyword name: The worker profile name.
|
||||
:paramtype name: str
|
||||
:keyword vm_size: The size of the worker VMs.
|
||||
:paramtype vm_size: str
|
||||
:keyword disk_size_gb: The disk size of the worker VMs.
|
||||
:paramtype disk_size_gb: int
|
||||
:keyword subnet_id: The Azure resource ID of the worker subnet.
|
||||
:paramtype subnet_id: str
|
||||
:keyword count: The number of worker VMs.
|
||||
:paramtype count: int
|
||||
:keyword encryption_at_host: Whether master virtual machines are encrypted at host. Possible
|
||||
values include: "Disabled", "Enabled".
|
||||
:paramtype encryption_at_host: str or
|
||||
~azure.mgmt.redhatopenshift.v2022_09_04.models.EncryptionAtHost
|
||||
:keyword disk_encryption_set_id: The resource ID of an associated DiskEncryptionSet, if
|
||||
applicable.
|
||||
:paramtype disk_encryption_set_id: str
|
||||
"""
|
||||
super(WorkerProfile, self).__init__(**kwargs)
|
||||
self.name = kwargs.get('name', None)
|
||||
self.vm_size = kwargs.get('vm_size', None)
|
||||
self.disk_size_gb = kwargs.get('disk_size_gb', None)
|
||||
self.subnet_id = kwargs.get('subnet_id', None)
|
||||
self.count = kwargs.get('count', None)
|
||||
self.encryption_at_host = kwargs.get('encryption_at_host', None)
|
||||
self.disk_encryption_set_id = kwargs.get('disk_encryption_set_id', None)
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,23 @@
|
|||
# coding=utf-8
|
||||
# --------------------------------------------------------------------------
|
||||
# Copyright (c) Microsoft Corporation. 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.
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
from ._operations import Operations
|
||||
from ._open_shift_clusters_operations import OpenShiftClustersOperations
|
||||
|
||||
__all__ = [
|
||||
'Operations',
|
||||
'OpenShiftClustersOperations',
|
||||
]
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,162 @@
|
|||
# pylint: disable=too-many-lines
|
||||
# coding=utf-8
|
||||
# --------------------------------------------------------------------------
|
||||
# Copyright (c) Microsoft Corporation. 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.
|
||||
# --------------------------------------------------------------------------
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from msrest import Serializer
|
||||
|
||||
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
|
||||
from azure.core.paging import ItemPaged
|
||||
from azure.core.pipeline import PipelineResponse
|
||||
from azure.core.pipeline.transport import HttpResponse
|
||||
from azure.core.rest import HttpRequest
|
||||
from azure.core.tracing.decorator import distributed_trace
|
||||
from azure.mgmt.core.exceptions import ARMErrorFormat
|
||||
|
||||
from .. import models as _models
|
||||
from .._vendor import _convert_request
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# pylint: disable=unused-import,ungrouped-imports
|
||||
from typing import Any, Callable, Dict, Iterable, Optional, TypeVar
|
||||
T = TypeVar('T')
|
||||
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
|
||||
|
||||
_SERIALIZER = Serializer()
|
||||
_SERIALIZER.client_side_validation = False
|
||||
# fmt: off
|
||||
|
||||
def build_list_request(
|
||||
**kwargs # type: Any
|
||||
):
|
||||
# type: (...) -> HttpRequest
|
||||
api_version = kwargs.pop('api_version', "2022-09-04") # type: str
|
||||
|
||||
accept = "application/json"
|
||||
# Construct URL
|
||||
_url = kwargs.pop("template_url", "/providers/Microsoft.RedHatOpenShift/operations")
|
||||
|
||||
# Construct parameters
|
||||
_query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
|
||||
_query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
|
||||
|
||||
# Construct headers
|
||||
_header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
|
||||
_header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
|
||||
|
||||
return HttpRequest(
|
||||
method="GET",
|
||||
url=_url,
|
||||
params=_query_parameters,
|
||||
headers=_header_parameters,
|
||||
**kwargs
|
||||
)
|
||||
|
||||
# fmt: on
|
||||
class Operations(object):
|
||||
"""Operations operations.
|
||||
|
||||
You should not instantiate this class directly. Instead, you should create a Client instance that
|
||||
instantiates it for you and attaches it as an attribute.
|
||||
|
||||
:ivar models: Alias to model classes used in this operation group.
|
||||
:type models: ~azure.mgmt.redhatopenshift.v2022_09_04.models
|
||||
:param client: Client for service requests.
|
||||
:param config: Configuration of service client.
|
||||
:param serializer: An object model serializer.
|
||||
:param deserializer: An object model deserializer.
|
||||
"""
|
||||
|
||||
models = _models
|
||||
|
||||
def __init__(self, client, config, serializer, deserializer):
|
||||
self._client = client
|
||||
self._serialize = serializer
|
||||
self._deserialize = deserializer
|
||||
self._config = config
|
||||
|
||||
@distributed_trace
|
||||
def list(
|
||||
self,
|
||||
**kwargs # type: Any
|
||||
):
|
||||
# type: (...) -> Iterable["_models.OperationList"]
|
||||
"""Lists all of the available RP operations.
|
||||
|
||||
The operation returns the RP operations.
|
||||
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: An iterator like instance of either OperationList or the result of cls(response)
|
||||
:rtype:
|
||||
~azure.core.paging.ItemPaged[~azure.mgmt.redhatopenshift.v2022_09_04.models.OperationList]
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
api_version = kwargs.pop('api_version', "2022-09-04") # type: str
|
||||
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationList"]
|
||||
error_map = {
|
||||
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
|
||||
}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
def prepare_request(next_link=None):
|
||||
if not next_link:
|
||||
|
||||
request = build_list_request(
|
||||
api_version=api_version,
|
||||
template_url=self.list.metadata['url'],
|
||||
)
|
||||
request = _convert_request(request)
|
||||
request.url = self._client.format_url(request.url)
|
||||
|
||||
else:
|
||||
|
||||
request = build_list_request(
|
||||
api_version=api_version,
|
||||
template_url=next_link,
|
||||
)
|
||||
request = _convert_request(request)
|
||||
request.url = self._client.format_url(request.url)
|
||||
request.method = "GET"
|
||||
return request
|
||||
|
||||
def extract_data(pipeline_response):
|
||||
deserialized = self._deserialize("OperationList", pipeline_response)
|
||||
list_of_elem = deserialized.value
|
||||
if cls:
|
||||
list_of_elem = cls(list_of_elem)
|
||||
return deserialized.next_link or None, iter(list_of_elem)
|
||||
|
||||
def get_next(next_link=None):
|
||||
request = prepare_request(next_link)
|
||||
|
||||
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
|
||||
request,
|
||||
stream=False,
|
||||
**kwargs
|
||||
)
|
||||
response = pipeline_response.http_response
|
||||
|
||||
if response.status_code not in [200]:
|
||||
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
||||
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
|
||||
|
||||
return pipeline_response
|
||||
|
||||
|
||||
return ItemPaged(
|
||||
get_next, extract_data
|
||||
)
|
||||
list.metadata = {'url': "/providers/Microsoft.RedHatOpenShift/operations"} # type: ignore
|
|
@ -0,0 +1 @@
|
|||
# Marker file for PEP 561.
|
Загрузка…
Ссылка в новой задаче