pkg/client/services/redhatopenshift/mgmt/2023-07-01-preview/redhatopenshift/models.go (840 lines of code) (raw):

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/2023-07-01-preview/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"` // SystemData - READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData `json:"systemData,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"` } // EffectiveOutboundIP effectiveOutboundIP represents an effective outbound IP resource of the cluster // public load balancer. type EffectiveOutboundIP struct { // ID - The fully qualified Azure resource id of an IP address resource. ID *string `json:"id,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"` } // LoadBalancerProfile loadBalancerProfile represents the profile of the cluster public load balancer. type LoadBalancerProfile struct { // ManagedOutboundIps - The desired managed outbound IPs for the cluster public load balancer. ManagedOutboundIps *ManagedOutboundIPs `json:"managedOutboundIps,omitempty"` // EffectiveOutboundIps - READ-ONLY; The list of effective outbound IP addresses of the public load balancer. EffectiveOutboundIps *[]EffectiveOutboundIP `json:"effectiveOutboundIps,omitempty"` // OutboundIps - The desired outbound IP resources for the cluster load balancer. OutboundIps *[]OutboundIP `json:"outboundIps,omitempty"` // OutboundIPPrefixes - The desired outbound IP Prefix resources for the cluster load balancer. OutboundIPPrefixes *[]OutboundIPPrefix `json:"outboundIpPrefixes,omitempty"` // AllocatedOutboundPorts - The desired number of allocated SNAT ports per VM. Allowed values are in the range of 0 to 64000 (inclusive). The default value is 1024. AllocatedOutboundPorts *int32 `json:"allocatedOutboundPorts,omitempty"` } // MarshalJSON is the custom marshaler for LoadBalancerProfile. func (lbp LoadBalancerProfile) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) if lbp.ManagedOutboundIps != nil { objectMap["managedOutboundIps"] = lbp.ManagedOutboundIps } if lbp.OutboundIps != nil { objectMap["outboundIps"] = lbp.OutboundIps } if lbp.OutboundIPPrefixes != nil { objectMap["outboundIpPrefixes"] = lbp.OutboundIPPrefixes } if lbp.AllocatedOutboundPorts != nil { objectMap["allocatedOutboundPorts"] = lbp.AllocatedOutboundPorts } return json.Marshal(objectMap) } // ManagedOutboundIPs managedOutboundIPs represents the desired managed outbound IPs for the cluster public // load balancer. type ManagedOutboundIPs struct { // Count - Count represents the desired number of IPv4 outbound IPs created and managed by Azure for the cluster public load balancer. Allowed values are in the range of 1 - 20. The default value is 1. Count *int32 `json:"count,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 { // 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"` // OutboundType - The OutboundType used for egress traffic. Possible values include: 'Loadbalancer', 'UserDefinedRouting' OutboundType OutboundType `json:"outboundType,omitempty"` // LoadBalancerProfile - The cluster load balancer profile. LoadBalancerProfile *LoadBalancerProfile `json:"loadBalancerProfile,omitempty"` } // OpenShiftCluster openShiftCluster represents an Azure Red Hat OpenShift cluster. type OpenShiftCluster struct { autorest.Response `json:"-"` // OpenShiftClusterProperties - The cluster properties. *OpenShiftClusterProperties `json:"properties,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"` // SystemData - READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData `json:"systemData,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 "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 } case "systemData": if v != nil { var systemData SystemData err = json.Unmarshal(*v, &systemData) if err != nil { return err } osc.SystemData = &systemData } } } 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', 'Cancelled', '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"` } // 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 } } } return nil } // OpenShiftVersion openShiftVersion represents an OpenShift version that can be installed. type OpenShiftVersion struct { // OpenShiftVersionProperties - The properties for the OpenShiftVersion resource. *OpenShiftVersionProperties `json:"properties,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"` // SystemData - READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData `json:"systemData,omitempty"` } // MarshalJSON is the custom marshaler for OpenShiftVersion. func (osv OpenShiftVersion) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) if osv.OpenShiftVersionProperties != nil { objectMap["properties"] = osv.OpenShiftVersionProperties } return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for OpenShiftVersion struct. func (osv *OpenShiftVersion) 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 openShiftVersionProperties OpenShiftVersionProperties err = json.Unmarshal(*v, &openShiftVersionProperties) if err != nil { return err } osv.OpenShiftVersionProperties = &openShiftVersionProperties } case "id": if v != nil { var ID string err = json.Unmarshal(*v, &ID) if err != nil { return err } osv.ID = &ID } case "name": if v != nil { var name string err = json.Unmarshal(*v, &name) if err != nil { return err } osv.Name = &name } case "type": if v != nil { var typeVar string err = json.Unmarshal(*v, &typeVar) if err != nil { return err } osv.Type = &typeVar } case "systemData": if v != nil { var systemData SystemData err = json.Unmarshal(*v, &systemData) if err != nil { return err } osv.SystemData = &systemData } } } return nil } // OpenShiftVersionList openShiftVersionList represents a List of available versions. type OpenShiftVersionList struct { autorest.Response `json:"-"` // Value - The List of available versions. Value *[]OpenShiftVersion `json:"value,omitempty"` // NextLink - Next Link to next operation. NextLink *string `json:"nextLink,omitempty"` } // OpenShiftVersionListIterator provides access to a complete listing of OpenShiftVersion values. type OpenShiftVersionListIterator struct { i int page OpenShiftVersionListPage } // 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 *OpenShiftVersionListIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/OpenShiftVersionListIterator.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 *OpenShiftVersionListIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. func (iter OpenShiftVersionListIterator) 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 OpenShiftVersionListIterator) Response() OpenShiftVersionList { 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 OpenShiftVersionListIterator) Value() OpenShiftVersion { if !iter.page.NotDone() { return OpenShiftVersion{} } return iter.page.Values()[iter.i] } // Creates a new instance of the OpenShiftVersionListIterator type. func NewOpenShiftVersionListIterator(page OpenShiftVersionListPage) OpenShiftVersionListIterator { return OpenShiftVersionListIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. func (osvl OpenShiftVersionList) IsEmpty() bool { return osvl.Value == nil || len(*osvl.Value) == 0 } // hasNextLink returns true if the NextLink is not empty. func (osvl OpenShiftVersionList) hasNextLink() bool { return osvl.NextLink != nil && len(*osvl.NextLink) != 0 } // openShiftVersionListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (osvl OpenShiftVersionList) openShiftVersionListPreparer(ctx context.Context) (*http.Request, error) { if !osvl.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), autorest.WithBaseURL(to.String(osvl.NextLink))) } // OpenShiftVersionListPage contains a page of OpenShiftVersion values. type OpenShiftVersionListPage struct { fn func(context.Context, OpenShiftVersionList) (OpenShiftVersionList, error) osvl OpenShiftVersionList } // 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 *OpenShiftVersionListPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/OpenShiftVersionListPage.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.osvl) if err != nil { return err } page.osvl = 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 *OpenShiftVersionListPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. func (page OpenShiftVersionListPage) NotDone() bool { return !page.osvl.IsEmpty() } // Response returns the raw server response from the last page request. func (page OpenShiftVersionListPage) Response() OpenShiftVersionList { return page.osvl } // Values returns the slice of values for the current page or nil if there are no values. func (page OpenShiftVersionListPage) Values() []OpenShiftVersion { if page.osvl.IsEmpty() { return nil } return *page.osvl.Value } // Creates a new instance of the OpenShiftVersionListPage type. func NewOpenShiftVersionListPage(cur OpenShiftVersionList, getNextPage func(context.Context, OpenShiftVersionList) (OpenShiftVersionList, error)) OpenShiftVersionListPage { return OpenShiftVersionListPage{ fn: getNextPage, osvl: cur, } } // OpenShiftVersionProperties openShiftVersionProperties represents the properties of an OpenShiftVersion. type OpenShiftVersionProperties struct { // Version - Version represents the version to create the cluster at. Version *string `json:"version,omitempty"` } // 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, } } // OutboundIP outboundIP represents a desired outbound IP resource for the cluster load balancer. type OutboundIP struct { // ID - The fully qualified Azure resource id of an IP address resource. ID *string `json:"id,omitempty"` } // OutboundIPPrefix outboundIPPrefix represents a desired outbound IP Prefix resource for the cluster load // balancer. type OutboundIPPrefix struct { // ID - The fully qualified Azure resource id of an IP address resource. ID *string `json:"id,omitempty"` } // ProxyResource the resource model definition for a Azure Resource Manager proxy resource. It will not // have tags and a location 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"` // SystemData - READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData `json:"systemData,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"` // SystemData - READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData `json:"systemData,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 timestamp of resource last modification (UTC) LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"` } // TrackedResource the resource model definition for an Azure Resource Manager tracked top level resource // which has 'tags' and a 'location' 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"` // SystemData - READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData `json:"systemData,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"` }