diff --git a/.sha256sum b/.sha256sum index b3b18318d..d82cdd4a0 100644 --- a/.sha256sum +++ b/.sha256sum @@ -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 -70e23386b8277aea07a1babd61fb2c1252cff46ad032f700b02074fb46a58c4c swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/redhatopenshift.json +009e7ade338aa2803cb5ef94e3d6057b7093af7ed9b194e51b86e4eb71b4ac05 swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/redhatopenshift.json diff --git a/pkg/client/services/redhatopenshift/mgmt/2022-09-04/redhatopenshift/models.go b/pkg/client/services/redhatopenshift/mgmt/2022-09-04/redhatopenshift/models.go index f5762283c..080b54c62 100644 --- a/pkg/client/services/redhatopenshift/mgmt/2022-09-04/redhatopenshift/models.go +++ b/pkg/client/services/redhatopenshift/mgmt/2022-09-04/redhatopenshift/models.go @@ -122,12 +122,6 @@ type IngressProfile struct { IP *string `json:"ip,omitempty"` } -// ListString ... -type ListString struct { - autorest.Response `json:"-"` - Value *[]string `json:"value,omitempty"` -} - // MachinePool machinePool represents a MachinePool type MachinePool struct { autorest.Response `json:"-"` @@ -754,8 +748,6 @@ type OpenShiftClusterProperties struct { ApiserverProfile *APIServerProfile `json:"apiserverProfile,omitempty"` // IngressProfiles - The cluster ingress profiles. IngressProfiles *[]IngressProfile `json:"ingressProfiles,omitempty"` - // InstallVersion - The cluster install version. - InstallVersion *string `json:"installVersion,omitempty"` } // OpenShiftClustersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a @@ -945,6 +937,44 @@ func (oscu *OpenShiftClusterUpdate) UnmarshalJSON(body []byte) error { return nil } +// OpenShiftVersion openShiftVersion represents an OpenShift version that can be installed. +type OpenShiftVersion struct { + // Properties - The properties for the OpenShiftVersion resource. + Properties *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.Properties != nil { + objectMap["properties"] = osv.Properties + } + return json.Marshal(objectMap) +} + +// 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"` +} + +// 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}. diff --git a/pkg/client/services/redhatopenshift/mgmt/2022-09-04/redhatopenshift/installversions.go b/pkg/client/services/redhatopenshift/mgmt/2022-09-04/redhatopenshift/openshiftversions.go similarity index 63% rename from pkg/client/services/redhatopenshift/mgmt/2022-09-04/redhatopenshift/installversions.go rename to pkg/client/services/redhatopenshift/mgmt/2022-09-04/redhatopenshift/openshiftversions.go index 93d5dfd94..6780035d3 100644 --- a/pkg/client/services/redhatopenshift/mgmt/2022-09-04/redhatopenshift/installversions.go +++ b/pkg/client/services/redhatopenshift/mgmt/2022-09-04/redhatopenshift/openshiftversions.go @@ -27,28 +27,29 @@ import ( "github.com/Azure/go-autorest/tracing" ) -// InstallVersionsClient is the rest API for Azure Red Hat OpenShift 4 -type InstallVersionsClient struct { +// OpenShiftVersionsClient is the rest API for Azure Red Hat OpenShift 4 +type OpenShiftVersionsClient struct { BaseClient } -// NewInstallVersionsClient creates an instance of the InstallVersionsClient client. -func NewInstallVersionsClient(subscriptionID string) InstallVersionsClient { - return NewInstallVersionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +// NewOpenShiftVersionsClient creates an instance of the OpenShiftVersionsClient client. +func NewOpenShiftVersionsClient(subscriptionID string) OpenShiftVersionsClient { + return NewOpenShiftVersionsClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewInstallVersionsClientWithBaseURI creates an instance of the InstallVersionsClient 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 NewInstallVersionsClientWithBaseURI(baseURI string, subscriptionID string) InstallVersionsClient { - return InstallVersionsClient{NewWithBaseURI(baseURI, subscriptionID)} +// NewOpenShiftVersionsClientWithBaseURI creates an instance of the OpenShiftVersionsClient 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 NewOpenShiftVersionsClientWithBaseURI(baseURI string, subscriptionID string) OpenShiftVersionsClient { + return OpenShiftVersionsClient{NewWithBaseURI(baseURI, subscriptionID)} } // List the operation returns the installable OpenShift versions as strings. // Parameters: // location - the name of Azure region. -func (client InstallVersionsClient) List(ctx context.Context, location string) (result ListString, err error) { +func (client OpenShiftVersionsClient) List(ctx context.Context, location string) (result OpenShiftVersionList, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InstallVersionsClient.List") + ctx = tracing.StartSpan(ctx, fqdn+"/OpenShiftVersionsClient.List") defer func() { sc := -1 if result.Response.Response != nil { @@ -62,25 +63,25 @@ func (client InstallVersionsClient) List(ctx context.Context, location string) ( Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: location, Constraints: []validation.Constraint{{Target: "location", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("redhatopenshift.InstallVersionsClient", "List", err.Error()) + return result, validation.NewError("redhatopenshift.OpenShiftVersionsClient", "List", err.Error()) } req, err := client.ListPreparer(ctx, location) if err != nil { - err = autorest.NewErrorWithError(err, "redhatopenshift.InstallVersionsClient", "List", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "redhatopenshift.OpenShiftVersionsClient", "List", nil, "Failure preparing request") return } resp, err := client.ListSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "redhatopenshift.InstallVersionsClient", "List", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "redhatopenshift.OpenShiftVersionsClient", "List", resp, "Failure sending request") return } result, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "redhatopenshift.InstallVersionsClient", "List", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "redhatopenshift.OpenShiftVersionsClient", "List", resp, "Failure responding to request") return } @@ -88,7 +89,7 @@ func (client InstallVersionsClient) List(ctx context.Context, location string) ( } // ListPreparer prepares the List request. -func (client InstallVersionsClient) ListPreparer(ctx context.Context, location string) (*http.Request, error) { +func (client OpenShiftVersionsClient) ListPreparer(ctx context.Context, location string) (*http.Request, error) { pathParameters := map[string]interface{}{ "location": autorest.Encode("path", location), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -109,17 +110,17 @@ func (client InstallVersionsClient) ListPreparer(ctx context.Context, location s // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. -func (client InstallVersionsClient) ListSender(req *http.Request) (*http.Response, error) { +func (client OpenShiftVersionsClient) 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 InstallVersionsClient) ListResponder(resp *http.Response) (result ListString, err error) { +func (client OpenShiftVersionsClient) ListResponder(resp *http.Response) (result OpenShiftVersionList, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return diff --git a/pkg/client/services/redhatopenshift/mgmt/2022-09-04/redhatopenshift/redhatopenshiftapi/interfaces.go b/pkg/client/services/redhatopenshift/mgmt/2022-09-04/redhatopenshift/redhatopenshiftapi/interfaces.go index 8190d4fce..0c1aa0be1 100644 --- a/pkg/client/services/redhatopenshift/mgmt/2022-09-04/redhatopenshift/redhatopenshiftapi/interfaces.go +++ b/pkg/client/services/redhatopenshift/mgmt/2022-09-04/redhatopenshift/redhatopenshiftapi/interfaces.go @@ -33,12 +33,12 @@ type OperationsClientAPI interface { var _ OperationsClientAPI = (*redhatopenshift.OperationsClient)(nil) -// InstallVersionsClientAPI contains the set of methods on the InstallVersionsClient type. -type InstallVersionsClientAPI interface { - List(ctx context.Context, location string) (result redhatopenshift.ListString, err error) +// OpenShiftVersionsClientAPI contains the set of methods on the OpenShiftVersionsClient type. +type OpenShiftVersionsClientAPI interface { + List(ctx context.Context, location string) (result redhatopenshift.OpenShiftVersionList, err error) } -var _ InstallVersionsClientAPI = (*redhatopenshift.InstallVersionsClient)(nil) +var _ OpenShiftVersionsClientAPI = (*redhatopenshift.OpenShiftVersionsClient)(nil) // OpenShiftClustersClientAPI contains the set of methods on the OpenShiftClustersClient type. type OpenShiftClustersClientAPI interface { diff --git a/pkg/cluster/install_version.go b/pkg/cluster/install_version.go index 92b83233f..263e7da7a 100644 --- a/pkg/cluster/install_version.go +++ b/pkg/cluster/install_version.go @@ -23,7 +23,7 @@ func (m *manager) openShiftVersionFromVersion(ctx context.Context) (*api.OpenShi activeOpenShiftVersions := make([]*api.OpenShiftVersion, 0) for _, doc := range docs.OpenShiftVersionDocuments { - if doc.OpenShiftVersion.Enabled { + if doc.OpenShiftVersion.Properties.Enabled { activeOpenShiftVersions = append(activeOpenShiftVersions, doc.OpenShiftVersion) } } @@ -48,17 +48,18 @@ func (m *manager) openShiftVersionFromVersion(ctx context.Context) (*api.OpenShi } return &api.OpenShiftVersion{ - Version: version.InstallStream.Version.String(), - OpenShiftPullspec: openshiftPullSpec, - InstallerPullspec: installerPullSpec, - Enabled: true, - }, nil + Properties: api.OpenShiftVersionProperties{ + Version: version.InstallStream.Version.String(), + OpenShiftPullspec: openshiftPullSpec, + InstallerPullspec: installerPullSpec, + Enabled: true, + }}, nil } for _, active := range activeOpenShiftVersions { - if requestedInstallVersion == active.Version { + if requestedInstallVersion == active.Properties.Version { if m.installViaHive { - active.OpenShiftPullspec = strings.Replace(active.OpenShiftPullspec, "quay.io", m.env.ACRDomain(), 1) + active.Properties.OpenShiftPullspec = strings.Replace(active.Properties.OpenShiftPullspec, "quay.io", m.env.ACRDomain(), 1) } return active, nil } diff --git a/pkg/cluster/install_version_test.go b/pkg/cluster/install_version_test.go index a39f11516..f4737ae0e 100644 --- a/pkg/cluster/install_version_test.go +++ b/pkg/cluster/install_version_test.go @@ -50,9 +50,11 @@ func TestGetOpenShiftVersionFromVersion(t *testing.T) { }, wantErrString: "", want: &api.OpenShiftVersion{ - Version: version.InstallStream.Version.String(), - OpenShiftPullspec: version.InstallStream.PullSpec, - InstallerPullspec: fmt.Sprintf("%s/aro-installer:release-%d.%d", testACRDomain, version.InstallStream.Version.V[0], version.InstallStream.Version.V[1]), + Properties: api.OpenShiftVersionProperties{ + Version: version.InstallStream.Version.String(), + OpenShiftPullspec: version.InstallStream.PullSpec, + InstallerPullspec: fmt.Sprintf("%s/aro-installer:release-%d.%d", testACRDomain, version.InstallStream.Version.V[0], version.InstallStream.Version.V[1]), + }, }, }, { @@ -61,13 +63,17 @@ func TestGetOpenShiftVersionFromVersion(t *testing.T) { f.AddOpenShiftVersionDocuments( &api.OpenShiftVersionDocument{ OpenShiftVersion: &api.OpenShiftVersion{ - Version: "4.10.20", - Enabled: true, + Properties: api.OpenShiftVersionProperties{ + Version: "4.10.20", + Enabled: true, + }, }, }, &api.OpenShiftVersionDocument{ OpenShiftVersion: &api.OpenShiftVersion{ - Version: "4.10.27", - Enabled: true, + Properties: api.OpenShiftVersionProperties{ + Version: "4.10.27", + Enabled: true, + }, }, }, ) @@ -123,9 +129,9 @@ func TestGetOpenShiftVersionFromVersion(t *testing.T) { } if tt.want != nil { - assert.Equal(t, tt.want.Version, version.Version, "Version does not match") - assert.Equal(t, tt.want.OpenShiftPullspec, version.OpenShiftPullspec, "OpenShiftPullspec does not match") - assert.Equal(t, tt.want.InstallerPullspec, version.InstallerPullspec, "InstallerPullspec does not match") + assert.Equal(t, tt.want.Properties.Version, version.Properties.Version, "Version does not match") + assert.Equal(t, tt.want.Properties.OpenShiftPullspec, version.Properties.OpenShiftPullspec, "OpenShiftPullspec does not match") + assert.Equal(t, tt.want.Properties.InstallerPullspec, version.Properties.InstallerPullspec, "InstallerPullspec does not match") } }) } diff --git a/python/client/azure/mgmt/redhatopenshift/v2022_09_04/_azure_red_hat_open_shift_client.py b/python/client/azure/mgmt/redhatopenshift/v2022_09_04/_azure_red_hat_open_shift_client.py index 03ee33d08..fc91bcbf6 100644 --- a/python/client/azure/mgmt/redhatopenshift/v2022_09_04/_azure_red_hat_open_shift_client.py +++ b/python/client/azure/mgmt/redhatopenshift/v2022_09_04/_azure_red_hat_open_shift_client.py @@ -23,7 +23,7 @@ from azure.mgmt.core import ARMPipelineClient from . import models from ._configuration import AzureRedHatOpenShiftClientConfiguration -from .operations import InstallVersionsOperations, MachinePoolsOperations, OpenShiftClustersOperations, Operations, SecretsOperations, SyncIdentityProvidersOperations, SyncSetsOperations +from .operations import MachinePoolsOperations, OpenShiftClustersOperations, OpenShiftVersionsOperations, Operations, SecretsOperations, SyncIdentityProvidersOperations, SyncSetsOperations if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,9 +37,9 @@ class AzureRedHatOpenShiftClient(object): # pylint: disable=too-many-instance :ivar operations: Operations operations :vartype operations: azure.mgmt.redhatopenshift.v2022_09_04.operations.Operations - :ivar install_versions: InstallVersionsOperations operations - :vartype install_versions: - azure.mgmt.redhatopenshift.v2022_09_04.operations.InstallVersionsOperations + :ivar open_shift_versions: OpenShiftVersionsOperations operations + :vartype open_shift_versions: + azure.mgmt.redhatopenshift.v2022_09_04.operations.OpenShiftVersionsOperations :ivar open_shift_clusters: OpenShiftClustersOperations operations :vartype open_shift_clusters: azure.mgmt.redhatopenshift.v2022_09_04.operations.OpenShiftClustersOperations @@ -82,7 +82,7 @@ class AzureRedHatOpenShiftClient(object): # pylint: disable=too-many-instance self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.install_versions = InstallVersionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.open_shift_versions = OpenShiftVersionsOperations(self._client, self._config, self._serialize, self._deserialize) self.open_shift_clusters = OpenShiftClustersOperations(self._client, self._config, self._serialize, self._deserialize) self.machine_pools = MachinePoolsOperations(self._client, self._config, self._serialize, self._deserialize) self.secrets = SecretsOperations(self._client, self._config, self._serialize, self._deserialize) diff --git a/python/client/azure/mgmt/redhatopenshift/v2022_09_04/models/__init__.py b/python/client/azure/mgmt/redhatopenshift/v2022_09_04/models/__init__.py index 5263ff679..4270ac1b4 100644 --- a/python/client/azure/mgmt/redhatopenshift/v2022_09_04/models/__init__.py +++ b/python/client/azure/mgmt/redhatopenshift/v2022_09_04/models/__init__.py @@ -31,6 +31,9 @@ try: from ._models_py3 import OpenShiftClusterCredentials from ._models_py3 import OpenShiftClusterList from ._models_py3 import OpenShiftClusterUpdate + from ._models_py3 import OpenShiftVersion + from ._models_py3 import OpenShiftVersionList + from ._models_py3 import OpenShiftVersionProperties from ._models_py3 import Operation from ._models_py3 import OperationList from ._models_py3 import ProxyResource @@ -65,6 +68,9 @@ except (SyntaxError, ImportError): from ._models import OpenShiftClusterCredentials # type: ignore from ._models import OpenShiftClusterList # type: ignore from ._models import OpenShiftClusterUpdate # type: ignore + from ._models import OpenShiftVersion # type: ignore + from ._models import OpenShiftVersionList # type: ignore + from ._models import OpenShiftVersionProperties # type: ignore from ._models import Operation # type: ignore from ._models import OperationList # type: ignore from ._models import ProxyResource # type: ignore @@ -108,6 +114,9 @@ __all__ = [ 'OpenShiftClusterCredentials', 'OpenShiftClusterList', 'OpenShiftClusterUpdate', + 'OpenShiftVersion', + 'OpenShiftVersionList', + 'OpenShiftVersionProperties', 'Operation', 'OperationList', 'ProxyResource', diff --git a/python/client/azure/mgmt/redhatopenshift/v2022_09_04/models/_models.py b/python/client/azure/mgmt/redhatopenshift/v2022_09_04/models/_models.py index 71b5724f6..fd580ade3 100644 --- a/python/client/azure/mgmt/redhatopenshift/v2022_09_04/models/_models.py +++ b/python/client/azure/mgmt/redhatopenshift/v2022_09_04/models/_models.py @@ -619,8 +619,6 @@ class OpenShiftCluster(TrackedResource): :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] - :ivar install_version: The cluster install version. - :vartype install_version: str """ _validation = { @@ -647,7 +645,6 @@ class OpenShiftCluster(TrackedResource): 'worker_profiles': {'key': 'properties.workerProfiles', 'type': '[WorkerProfile]'}, 'apiserver_profile': {'key': 'properties.apiserverProfile', 'type': 'APIServerProfile'}, 'ingress_profiles': {'key': 'properties.ingressProfiles', 'type': '[IngressProfile]'}, - 'install_version': {'key': 'properties.installVersion', 'type': 'str'}, } def __init__( @@ -681,8 +678,6 @@ class OpenShiftCluster(TrackedResource): :keyword ingress_profiles: The cluster ingress profiles. :paramtype ingress_profiles: list[~azure.mgmt.redhatopenshift.v2022_09_04.models.IngressProfile] - :keyword install_version: The cluster install version. - :paramtype install_version: str """ super(OpenShiftCluster, self).__init__(**kwargs) self.provisioning_state = kwargs.get('provisioning_state', None) @@ -694,7 +689,6 @@ class OpenShiftCluster(TrackedResource): self.worker_profiles = kwargs.get('worker_profiles', None) self.apiserver_profile = kwargs.get('apiserver_profile', None) self.ingress_profiles = kwargs.get('ingress_profiles', None) - self.install_version = kwargs.get('install_version', None) class OpenShiftClusterAdminKubeconfig(msrest.serialization.Model): @@ -808,8 +802,6 @@ class OpenShiftClusterUpdate(msrest.serialization.Model): :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] - :ivar install_version: The cluster install version. - :vartype install_version: str """ _validation = { @@ -828,7 +820,6 @@ class OpenShiftClusterUpdate(msrest.serialization.Model): 'worker_profiles': {'key': 'properties.workerProfiles', 'type': '[WorkerProfile]'}, 'apiserver_profile': {'key': 'properties.apiserverProfile', 'type': 'APIServerProfile'}, 'ingress_profiles': {'key': 'properties.ingressProfiles', 'type': '[IngressProfile]'}, - 'install_version': {'key': 'properties.installVersion', 'type': 'str'}, } def __init__( @@ -860,8 +851,6 @@ class OpenShiftClusterUpdate(msrest.serialization.Model): :keyword ingress_profiles: The cluster ingress profiles. :paramtype ingress_profiles: list[~azure.mgmt.redhatopenshift.v2022_09_04.models.IngressProfile] - :keyword install_version: The cluster install version. - :paramtype install_version: str """ super(OpenShiftClusterUpdate, self).__init__(**kwargs) self.tags = kwargs.get('tags', None) @@ -875,7 +864,106 @@ class OpenShiftClusterUpdate(msrest.serialization.Model): self.worker_profiles = kwargs.get('worker_profiles', None) self.apiserver_profile = kwargs.get('apiserver_profile', None) self.ingress_profiles = kwargs.get('ingress_profiles', None) - self.install_version = kwargs.get('install_version', None) + + +class OpenShiftVersion(ProxyResource): + """OpenShiftVersion represents an OpenShift version that can be installed. + + 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 + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SystemData + :ivar properties: The properties for the OpenShiftVersion resource. + :vartype properties: ~azure.mgmt.redhatopenshift.v2022_09_04.models.OpenShiftVersionProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'properties': {'key': 'properties', 'type': 'OpenShiftVersionProperties'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword properties: The properties for the OpenShiftVersion resource. + :paramtype properties: + ~azure.mgmt.redhatopenshift.v2022_09_04.models.OpenShiftVersionProperties + """ + super(OpenShiftVersion, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class OpenShiftVersionList(msrest.serialization.Model): + """OpenShiftVersionList represents a List of available versions. + + :ivar value: The List of available versions. + :vartype value: list[~azure.mgmt.redhatopenshift.v2022_09_04.models.OpenShiftVersion] + :ivar next_link: Next Link to next operation. + :vartype next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[OpenShiftVersion]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword value: The List of available versions. + :paramtype value: list[~azure.mgmt.redhatopenshift.v2022_09_04.models.OpenShiftVersion] + :keyword next_link: Next Link to next operation. + :paramtype next_link: str + """ + super(OpenShiftVersionList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class OpenShiftVersionProperties(msrest.serialization.Model): + """OpenShiftVersionProperties represents the properties of an OpenShiftVersion. + + :ivar version: Version represents the version to create the cluster at. + :vartype version: str + """ + + _attribute_map = { + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword version: Version represents the version to create the cluster at. + :paramtype version: str + """ + super(OpenShiftVersionProperties, self).__init__(**kwargs) + self.version = kwargs.get('version', None) class Operation(msrest.serialization.Model): diff --git a/python/client/azure/mgmt/redhatopenshift/v2022_09_04/models/_models_py3.py b/python/client/azure/mgmt/redhatopenshift/v2022_09_04/models/_models_py3.py index 1c06dedd3..b9b6aacd8 100644 --- a/python/client/azure/mgmt/redhatopenshift/v2022_09_04/models/_models_py3.py +++ b/python/client/azure/mgmt/redhatopenshift/v2022_09_04/models/_models_py3.py @@ -668,8 +668,6 @@ class OpenShiftCluster(TrackedResource): :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] - :ivar install_version: The cluster install version. - :vartype install_version: str """ _validation = { @@ -696,7 +694,6 @@ class OpenShiftCluster(TrackedResource): 'worker_profiles': {'key': 'properties.workerProfiles', 'type': '[WorkerProfile]'}, 'apiserver_profile': {'key': 'properties.apiserverProfile', 'type': 'APIServerProfile'}, 'ingress_profiles': {'key': 'properties.ingressProfiles', 'type': '[IngressProfile]'}, - 'install_version': {'key': 'properties.installVersion', 'type': 'str'}, } def __init__( @@ -713,7 +710,6 @@ class OpenShiftCluster(TrackedResource): worker_profiles: Optional[List["WorkerProfile"]] = None, apiserver_profile: Optional["APIServerProfile"] = None, ingress_profiles: Optional[List["IngressProfile"]] = None, - install_version: Optional[str] = None, **kwargs ): """ @@ -743,8 +739,6 @@ class OpenShiftCluster(TrackedResource): :keyword ingress_profiles: The cluster ingress profiles. :paramtype ingress_profiles: list[~azure.mgmt.redhatopenshift.v2022_09_04.models.IngressProfile] - :keyword install_version: The cluster install version. - :paramtype install_version: str """ super(OpenShiftCluster, self).__init__(tags=tags, location=location, **kwargs) self.provisioning_state = provisioning_state @@ -756,7 +750,6 @@ class OpenShiftCluster(TrackedResource): self.worker_profiles = worker_profiles self.apiserver_profile = apiserver_profile self.ingress_profiles = ingress_profiles - self.install_version = install_version class OpenShiftClusterAdminKubeconfig(msrest.serialization.Model): @@ -878,8 +871,6 @@ class OpenShiftClusterUpdate(msrest.serialization.Model): :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] - :ivar install_version: The cluster install version. - :vartype install_version: str """ _validation = { @@ -898,7 +889,6 @@ class OpenShiftClusterUpdate(msrest.serialization.Model): 'worker_profiles': {'key': 'properties.workerProfiles', 'type': '[WorkerProfile]'}, 'apiserver_profile': {'key': 'properties.apiserverProfile', 'type': 'APIServerProfile'}, 'ingress_profiles': {'key': 'properties.ingressProfiles', 'type': '[IngressProfile]'}, - 'install_version': {'key': 'properties.installVersion', 'type': 'str'}, } def __init__( @@ -914,7 +904,6 @@ class OpenShiftClusterUpdate(msrest.serialization.Model): worker_profiles: Optional[List["WorkerProfile"]] = None, apiserver_profile: Optional["APIServerProfile"] = None, ingress_profiles: Optional[List["IngressProfile"]] = None, - install_version: Optional[str] = None, **kwargs ): """ @@ -942,8 +931,6 @@ class OpenShiftClusterUpdate(msrest.serialization.Model): :keyword ingress_profiles: The cluster ingress profiles. :paramtype ingress_profiles: list[~azure.mgmt.redhatopenshift.v2022_09_04.models.IngressProfile] - :keyword install_version: The cluster install version. - :paramtype install_version: str """ super(OpenShiftClusterUpdate, self).__init__(**kwargs) self.tags = tags @@ -957,7 +944,113 @@ class OpenShiftClusterUpdate(msrest.serialization.Model): self.worker_profiles = worker_profiles self.apiserver_profile = apiserver_profile self.ingress_profiles = ingress_profiles - self.install_version = install_version + + +class OpenShiftVersion(ProxyResource): + """OpenShiftVersion represents an OpenShift version that can be installed. + + 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 + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SystemData + :ivar properties: The properties for the OpenShiftVersion resource. + :vartype properties: ~azure.mgmt.redhatopenshift.v2022_09_04.models.OpenShiftVersionProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'properties': {'key': 'properties', 'type': 'OpenShiftVersionProperties'}, + } + + def __init__( + self, + *, + properties: Optional["OpenShiftVersionProperties"] = None, + **kwargs + ): + """ + :keyword properties: The properties for the OpenShiftVersion resource. + :paramtype properties: + ~azure.mgmt.redhatopenshift.v2022_09_04.models.OpenShiftVersionProperties + """ + super(OpenShiftVersion, self).__init__(**kwargs) + self.properties = properties + + +class OpenShiftVersionList(msrest.serialization.Model): + """OpenShiftVersionList represents a List of available versions. + + :ivar value: The List of available versions. + :vartype value: list[~azure.mgmt.redhatopenshift.v2022_09_04.models.OpenShiftVersion] + :ivar next_link: Next Link to next operation. + :vartype next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[OpenShiftVersion]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["OpenShiftVersion"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + """ + :keyword value: The List of available versions. + :paramtype value: list[~azure.mgmt.redhatopenshift.v2022_09_04.models.OpenShiftVersion] + :keyword next_link: Next Link to next operation. + :paramtype next_link: str + """ + super(OpenShiftVersionList, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class OpenShiftVersionProperties(msrest.serialization.Model): + """OpenShiftVersionProperties represents the properties of an OpenShiftVersion. + + :ivar version: Version represents the version to create the cluster at. + :vartype version: str + """ + + _attribute_map = { + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__( + self, + *, + version: Optional[str] = None, + **kwargs + ): + """ + :keyword version: Version represents the version to create the cluster at. + :paramtype version: str + """ + super(OpenShiftVersionProperties, self).__init__(**kwargs) + self.version = version class Operation(msrest.serialization.Model): diff --git a/python/client/azure/mgmt/redhatopenshift/v2022_09_04/operations/__init__.py b/python/client/azure/mgmt/redhatopenshift/v2022_09_04/operations/__init__.py index a70265e21..3227f81cb 100644 --- a/python/client/azure/mgmt/redhatopenshift/v2022_09_04/operations/__init__.py +++ b/python/client/azure/mgmt/redhatopenshift/v2022_09_04/operations/__init__.py @@ -15,7 +15,7 @@ # -------------------------------------------------------------------------- from ._operations import Operations -from ._install_versions_operations import InstallVersionsOperations +from ._open_shift_versions_operations import OpenShiftVersionsOperations from ._open_shift_clusters_operations import OpenShiftClustersOperations from ._machine_pools_operations import MachinePoolsOperations from ._secrets_operations import SecretsOperations @@ -24,7 +24,7 @@ from ._sync_sets_operations import SyncSetsOperations __all__ = [ 'Operations', - 'InstallVersionsOperations', + 'OpenShiftVersionsOperations', 'OpenShiftClustersOperations', 'MachinePoolsOperations', 'SecretsOperations', diff --git a/python/client/azure/mgmt/redhatopenshift/v2022_09_04/operations/_install_versions_operations.py b/python/client/azure/mgmt/redhatopenshift/v2022_09_04/operations/_open_shift_versions_operations.py similarity index 91% rename from python/client/azure/mgmt/redhatopenshift/v2022_09_04/operations/_install_versions_operations.py rename to python/client/azure/mgmt/redhatopenshift/v2022_09_04/operations/_open_shift_versions_operations.py index 6136a0e3c..d51d26dc7 100644 --- a/python/client/azure/mgmt/redhatopenshift/v2022_09_04/operations/_install_versions_operations.py +++ b/python/client/azure/mgmt/redhatopenshift/v2022_09_04/operations/_open_shift_versions_operations.py @@ -30,7 +30,7 @@ from .._vendor import _convert_request, _format_url_section if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, List, Optional, TypeVar + from typing import Any, Callable, Dict, Optional, TypeVar T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -73,8 +73,8 @@ def build_list_request( ) # fmt: on -class InstallVersionsOperations(object): - """InstallVersionsOperations operations. +class OpenShiftVersionsOperations(object): + """OpenShiftVersionsOperations 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. @@ -101,7 +101,7 @@ class InstallVersionsOperations(object): location, # type: str **kwargs # type: Any ): - # type: (...) -> List[str] + # type: (...) -> "_models.OpenShiftVersionList" """Lists all OpenShift versions available to install in the specified location. The operation returns the installable OpenShift versions as strings. @@ -109,11 +109,11 @@ class InstallVersionsOperations(object): :param location: The name of Azure region. :type location: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: list of str, or the result of cls(response) - :rtype: list[str] + :return: OpenShiftVersionList, or the result of cls(response) + :rtype: ~azure.mgmt.redhatopenshift.v2022_09_04.models.OpenShiftVersionList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List[str]] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OpenShiftVersionList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -142,7 +142,7 @@ class InstallVersionsOperations(object): map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize('[str]', pipeline_response) + deserialized = self._deserialize('OpenShiftVersionList', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) diff --git a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/InstallVersions_List.json b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/OpenShiftVersions_List.json similarity index 52% rename from swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/InstallVersions_List.json rename to swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/OpenShiftVersions_List.json index 2ab1831af..758a4c7e8 100644 --- a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/InstallVersions_List.json +++ b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/OpenShiftVersions_List.json @@ -6,9 +6,15 @@ }, "responses": { "200": { - "body": [ - "4.10.20" - ] + "body": { + "value": [ + { + "properties": { + "version": "4.10.20" + } + } + ] + } } } } diff --git a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/redhatopenshift.json b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/redhatopenshift.json index 2075fac21..af32fdcc1 100644 --- a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/redhatopenshift.json +++ b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/redhatopenshift.json @@ -56,11 +56,11 @@ "/subscriptions/{subscriptionId}/providers/Microsoft.RedHatOpenShift/locations/{location}/listinstallversions": { "get": { "tags": [ - "InstallVersions" + "OpenShiftVersions" ], "summary": "Lists all OpenShift versions available to install in the specified location.", "description": "The operation returns the installable OpenShift versions as strings.", - "operationId": "InstallVersions_List", + "operationId": "OpenShiftVersions_List", "parameters": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" @@ -76,7 +76,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/InstallVersions" + "$ref": "#/definitions/OpenShiftVersionList" } }, "default": { @@ -88,7 +88,7 @@ }, "x-ms-examples": { "Lists all OpenShift versions available to install in the specified location.": { - "$ref": "./examples/InstallVersions_List.json" + "$ref": "./examples/OpenShiftVersions_List.json" } } } @@ -1801,18 +1801,6 @@ } } }, - "InstallVersion": { - "description": "InstallVersion is the OpenShift installation version string.", - "type": "string" - }, - "InstallVersions": { - "description": "InstallVersions represents a List of OpenShift installable versions.", - "type": "array", - "items": { - "$ref": "#/definitions/InstallVersion" - }, - "x-ms-identifiers": [] - }, "MachinePool": { "description": "MachinePool represents a MachinePool", "type": "object", @@ -2025,10 +2013,6 @@ "$ref": "#/definitions/IngressProfile" }, "x-ms-identifiers": [] - }, - "installVersion": { - "description": "The cluster install version.", - "type": "string" } } }, @@ -2052,6 +2036,61 @@ } } }, + "OpenShiftVersion": { + "description": "OpenShiftVersion represents an OpenShift version that can be installed.", + "type": "object", + "allOf": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ProxyResource" + } + ], + "properties": { + "id": { + "description": "The ID for the resource.", + "type": "string" + }, + "name": { + "description": "Name of the resource.", + "type": "string" + }, + "type": { + "description": "The resource type.", + "type": "string" + }, + "properties": { + "$ref": "#/definitions/OpenShiftVersionProperties", + "description": "The properties for the OpenShiftVersion resource." + } + } + }, + "OpenShiftVersionList": { + "description": "OpenShiftVersionList represents a List of available versions.", + "type": "object", + "properties": { + "value": { + "description": "The List of available versions.", + "type": "array", + "items": { + "$ref": "#/definitions/OpenShiftVersion" + }, + "x-ms-identifiers": [] + }, + "nextLink": { + "description": "Next Link to next operation.", + "type": "string" + } + } + }, + "OpenShiftVersionProperties": { + "description": "OpenShiftVersionProperties represents the properties of an OpenShiftVersion.", + "type": "object", + "properties": { + "version": { + "description": "Version represents the version to create the cluster at.", + "type": "string" + } + } + }, "Operation": { "description": "Operation represents an RP operation.", "type": "object",