diff --git a/.sha256sum b/.sha256sum index 555db6cf4..b3b18318d 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 -31a28660207aba242d722899fde23455cdd85c9839d8eb3d8ea69db1f5da423d swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/redhatopenshift.json +70e23386b8277aea07a1babd61fb2c1252cff46ad032f700b02074fb46a58c4c swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/redhatopenshift.json diff --git a/docs/deploy-development-rp.md b/docs/deploy-development-rp.md index 17a837cf6..e8daaaadc 100644 --- a/docs/deploy-development-rp.md +++ b/docs/deploy-development-rp.md @@ -222,8 +222,7 @@ * You can find example payloads in the projects `./hack/ocm` folder. ```bash - curl -X PUT -k "https://localhost:8443/subscriptions/fe16a035-e540-4ab7-80d9-373fa9a3d6ae/resourceGroups/$RESOURCEGROUP/providers/Microsoft.RedHatOpenShift/openShiftClusters/$CLUSTER/syncsets/mySyncSet?api-version=2022-09-04" --header "Content-Type: application/json" -d @./hack/ocm/syncset.json - ``` + curl -X PUT -k "https://localhost:8443/subscriptions/$AZURE_SUBSCRIPTION_ID/resourceGroups/$RESOURCEGROUP/providers/Microsoft.RedHatOpenShift/openShiftClusters/$CLUSTER/syncsets/mySyncSet?api-version=2022-09-04" --header "Content-Type: application/json" -d @./hack/ocm/syncset.b64 ## Debugging OpenShift Cluster diff --git a/hack/ocm/machinepool.b64 b/hack/ocm/machinepool.b64 new file mode 100644 index 000000000..6c0527fa6 --- /dev/null +++ b/hack/ocm/machinepool.b64 @@ -0,0 +1 @@ +ewogICAgImFwaVZlcnNpb24iOiAiaGl2ZS5vcGVuc2hpZnQuaW8vdjEiLAogICAgImtpbmQiOiAiTWFjaGluZVBvb2wiLAogICAgIm1ldGFkYXRhIjogewogICAgICAgICJuYW1lIjogInRlc3QtY2x1c3Rlci13b3JrZXIiLAogICAgICAgICJuYW1lc3BhY2UiOiAiYXJvLWY2MGFlOGEyLWJjYTEtNDk4Ny05MDU2LVhYWFhYWFhYWFhYWCIKICAgIH0sCiAgICAic3BlYyI6IHsKICAgICAgICAiY2x1c3RlckRlcGxveW1lbnRSZWYiOiB7CiAgICAgICAgICAgICJuYW1lIjogInRlc3QtY2x1c3RlciIKICAgICAgICB9LAogICAgICAgICJuYW1lIjogIndvcmtlciIsCiAgICAgICAgInBsYXRmb3JtIjogewogICAgICAgICAgICAiYXdzIjogewogICAgICAgICAgICAgICAgInJvb3RWb2x1bWUiOiB7CiAgICAgICAgICAgICAgICAgICAgImlvcHMiOiAwLAogICAgICAgICAgICAgICAgICAgICJzaXplIjogMzAwLAogICAgICAgICAgICAgICAgICAgICJ0eXBlIjogImdwMyIKICAgICAgICAgICAgICAgIH0sCiAgICAgICAgICAgICAgICAidHlwZSI6ICJtNS54bGFyZ2UiLAogICAgICAgICAgICAgICAgInpvbmVzIjogWwogICAgICAgICAgICAgICAgICAgICJ1cy1lYXN0LTFhIgogICAgICAgICAgICAgICAgXQogICAgICAgICAgICB9CiAgICAgICAgfSwKICAgICAgICAicmVwbGljYXMiOiAyCiAgICB9LAogICAgInN0YXR1cyI6IHsKICAgICAgICAiY29uZGl0aW9ucyI6IFsKICAgICAgICBdCiAgICB9Cn0K \ No newline at end of file diff --git a/hack/ocm/machinepool.json b/hack/ocm/machinepool.json index 4809e96dc..479538795 100644 --- a/hack/ocm/machinepool.json +++ b/hack/ocm/machinepool.json @@ -2,19 +2,12 @@ "apiVersion": "hive.openshift.io/v1", "kind": "MachinePool", "metadata": { - "creationTimestamp": "2022-08-16T14:17:10Z", - "generation": 1, - "labels": { - "api.openshift.com/id": "1u4lhakk4ar41bi3vgn0b7v9hk93dg4m" - }, - "name": "oadler-full-worker", - "namespace": "uhc-staging-1u4lhakk4ar41bi3vgn0b7v9hk93dg4m", - "resourceVersion": "1205855122", - "uid": "28a4de99-dc5f-4a9a-9f50-94a7dd47c712" + "name": "test-cluster-worker", + "namespace": "aro-f60ae8a2-bca1-4987-9056-XXXXXXXXXXXX" }, "spec": { "clusterDeploymentRef": { - "name": "oadler-full" + "name": "test-cluster" }, "name": "worker", "platform": { diff --git a/hack/ocm/secret.b64 b/hack/ocm/secret.b64 new file mode 100644 index 000000000..84bbc4942 --- /dev/null +++ b/hack/ocm/secret.b64 @@ -0,0 +1 @@ +YXBpVmVyc2lvbjogdjEKZGF0YToKICB1c2VybmFtZTogWVdSdGFXND0KICBwYXNzd29yZDogTVdZeVpERmxNbVUyTjJSbQpraW5kOiBTZWNyZXQKbWV0YWRhdGE6CiAgYW5ub3RhdGlvbnM6CiAgICBrdWJlY3RsLmt1YmVybmV0ZXMuaW8vbGFzdC1hcHBsaWVkLWNvbmZpZ3VyYXRpb246IHsgLi4uIH0KICBjcmVhdGlvblRpbWVzdGFtcDogMjAyMC0wMS0yMlQxODo0MTo1NloKICBuYW1lOiBteXNlY3JldAogIG5hbWVzcGFjZTogZGVmYXVsdAogIHJlc291cmNlVmVyc2lvbjogMTY0NjE5CiAgdWlkOiBjZmVlMDJkNi1jMTM3LTExZTUtOGQ3My00MjAxMGFmMDAwMDIKdHlwZTogT3BhcXVlCg== \ No newline at end of file diff --git a/hack/ocm/syncidentityprovider.b64 b/hack/ocm/syncidentityprovider.b64 new file mode 100644 index 000000000..4ee186c96 --- /dev/null +++ b/hack/ocm/syncidentityprovider.b64 @@ -0,0 +1 @@ +ewogICAgImFwaVZlcnNpb24iOiAiaGl2ZS5vcGVuc2hpZnQuaW8vdjEiLAogICAgImtpbmQiOiAiU3luY0lkZW50aXR5UHJvdmlkZXIiLAogICAgIm1ldGFkYXRhIjogewogICAgICAgICJuYW1lIjogInRlc3QtY2x1c3RlciIsCiAgICAgICAgIm5hbWVzcGFjZSI6ICJhcm8tZjYwYWU4YTItYmNhMS00OTg3LTkwNTYtWFhYWFhYWFhYWFhYIgogICAgfSwKICAgICJzcGVjIjogewogICAgICAgICJjbHVzdGVyRGVwbG95bWVudFJlZnMiOiBbCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICJuYW1lIjogInRlc3QtY2x1c3RlciIKICAgICAgICAgICAgfQogICAgICAgIF0sCiAgICAgICAgImlkZW50aXR5UHJvdmlkZXJzIjogWwogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAiaHRwYXNzd2QiOiB7CiAgICAgICAgICAgICAgICAgICAgImZpbGVEYXRhIjogewogICAgICAgICAgICAgICAgICAgICAgICAibmFtZSI6ICJodHBhc3N3ZC1zZWNyZXQiCiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfSwKICAgICAgICAgICAgICAgICJtYXBwaW5nTWV0aG9kIjogImNsYWltIiwKICAgICAgICAgICAgICAgICJuYW1lIjogIkhUUGFzc3dkIiwKICAgICAgICAgICAgICAgICJ0eXBlIjogIkhUUGFzc3dkIgogICAgICAgICAgICB9CiAgICAgICAgXQogICAgfSwKICAgICJzdGF0dXMiOiB7fQp9Cg== \ No newline at end of file diff --git a/hack/ocm/syncidentityprovider.json b/hack/ocm/syncidentityprovider.json index c4248375e..81b2566fc 100644 --- a/hack/ocm/syncidentityprovider.json +++ b/hack/ocm/syncidentityprovider.json @@ -2,21 +2,13 @@ "apiVersion": "hive.openshift.io/v1", "kind": "SyncIdentityProvider", "metadata": { - "creationTimestamp": "2022-08-25T19:15:28Z", - "generation": 4, - "labels": { - "api.openshift.com/id": "1ua35jp6or0hbv455nm2h3d0hhdkdbj2", - "api.openshift.com/name": "abyrne-hcp2" - }, - "name": "abyrne-hcp2", - "namespace": "uhc-staging-1ua35jp6or0hbv455nm2h3d0hhdkdbj2", - "resourceVersion": "1221948462", - "uid": "ae015d32-8ff3-441c-9770-123bbc69853d" + "name": "test-cluster", + "namespace": "aro-f60ae8a2-bca1-4987-9056-XXXXXXXXXXXX" }, "spec": { "clusterDeploymentRefs": [ { - "name": "abyrne-hcp2" + "name": "test-cluster" } ], "identityProviders": [ diff --git a/hack/ocm/syncset.b64 b/hack/ocm/syncset.b64 index dbe91f306..a853ee182 100644 --- a/hack/ocm/syncset.b64 +++ b/hack/ocm/syncset.b64 @@ -1 +1 @@ -eyAKICAiYXBpVmVyc2lvbiI6ICJoaXZlLm9wZW5zaGlmdC5pby92MSIsCiAgImtpbmQiOiAiU3luY1NldCIsCiAgIm1ldGFkYXRhIjogewogICAgIm5hbWUiOiAic2FtcGxlIiwKICAgICJuYW1lc3BhY2UiOiAiYXJvLWY2MGFlOGEyLWJjYTEtNDk4Ny05MDU2LWYyZjZhMTgzN2NhYSIKICB9LAogICJzcGVjIjogewogICAgImNsdXN0ZXJEZXBsb3ltZW50UmVmcyI6IFtdLAogICAgInJlc291cmNlcyI6IFsKICAgICAgewogICAgICAgICJhcGlWZXJzaW9uIjogInYxIiwKICAgICAgICAia2luZCI6ICJDb25maWdNYXAiLAogICAgICAgICJtZXRhZGF0YSI6IHsKICAgICAgICAgICJuYW1lIjogIm15Y29uZmlnbWFwIgogICAgICAgIH0KICAgICAgfQogICAgXQogIH0KfQo= \ No newline at end of file +eyAKICAiYXBpVmVyc2lvbiI6ICJoaXZlLm9wZW5zaGlmdC5pby92MSIsCiAgImtpbmQiOiAiU3luY1NldCIsCiAgIm1ldGFkYXRhIjogewogICAgIm5hbWUiOiAidGVzdC1zeW5jc2V0IiwKICAgICJuYW1lc3BhY2UiOiAiYXJvLWY2MGFlOGEyLWJjYTEtNDk4Ny05MDU2LVhYWFhYWFhYWFhYWCIKICB9LAogICJzcGVjIjogewogICAgImNsdXN0ZXJEZXBsb3ltZW50UmVmcyI6IFsKICAgICAgICB7CiAgICAgICAgICAgICJuYW1lIjogInRlc3QtY2x1c3RlciIKICAgICAgICB9CiAgICBdLAogICAgInJlc291cmNlcyI6IFsKICAgICAgewogICAgICAgICJhcGlWZXJzaW9uIjogInYxIiwKICAgICAgICAia2luZCI6ICJDb25maWdNYXAiLAogICAgICAgICJtZXRhZGF0YSI6IHsKICAgICAgICAgICJuYW1lIjogIm15Y29uZmlnbWFwIgogICAgICAgIH0KICAgICAgfQogICAgXQogIH0KfQo= \ No newline at end of file diff --git a/hack/ocm/syncset.json b/hack/ocm/syncset.json index fd982941c..f98070a8a 100644 --- a/hack/ocm/syncset.json +++ b/hack/ocm/syncset.json @@ -2,11 +2,15 @@ "apiVersion": "hive.openshift.io/v1", "kind": "SyncSet", "metadata": { - "name": "sample", - "namespace": "aro-f60ae8a2-bca1-4987-9056-f2f6a1837caa" + "name": "test-syncset", + "namespace": "aro-f60ae8a2-bca1-4987-9056-XXXXXXXXXXXX" }, "spec": { - "clusterDeploymentRefs": [], + "clusterDeploymentRefs": [ + { + "name": "test-cluster" + } + ], "resources": [ { "apiVersion": "v1", diff --git a/pkg/api/clustermanager.go b/pkg/api/clustermanager.go index 809ce7c80..80ce4fda7 100644 --- a/pkg/api/clustermanager.go +++ b/pkg/api/clustermanager.go @@ -5,7 +5,7 @@ package api // SyncSetList represents a list of SyncSets for a given cluster. type SyncSetList struct { - Syncsets []*SyncSet `json:"value"` + SyncSets []*SyncSet `json:"value"` // The link used to get the next page of operations. NextLink string `json:"nextLink,omitempty"` } @@ -23,40 +23,46 @@ type ClusterManagerConfiguration struct { // ID is the unique identifier for the cluster manager configuration ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` - ClusterResourceId string `json:"clusterResourceId,omitempty"` - Deleting bool `json:"deleting,omitempty"` // https://docs.microsoft.com/en-us/azure/cosmos-db/change-feed-design-patterns#deletes + ClusterResourceID string `json:"clusterResourceId,omitempty"` Properties ClusterManagerConfigurationProperties `json:"properties,omitempty"` - // SystemData metadata from ARM, more info in pkg/api/openshiftcluster.go - SystemData *SystemData `json:"systemData,omitempty"` + SystemData *SystemData `json:"systemData,omitempty"` } +// ClusterManagerConfigurationProperties houses the payloads the frontend receives for all OCM resources +// we store them as a byte slice in cosmos type ClusterManagerConfigurationProperties struct { Resources []byte `json:"resources,omitempty"` } // SyncSet represents a SyncSet for an Azure Red Hat OpenShift Cluster. type SyncSet struct { - MissingFields + // Required resource properties in ARM + ID string `json:"id,omitempty" mutable:"case"` + Name string `json:"name,omitempty" mutable:"case"` + Type string `json:"type,omitempty" mutable:"case"` - // ID, Name and Type are cased as the user provided them at create time. - // ID, Name, Type and Location are immutable. - ID string `json:"id,omitempty"` - Name string `json:"name,omitempty"` - Type string `json:"type,omitempty"` + // SystemData metadata relating to this resource. + SystemData *SystemData `json:"systemData,omitempty"` - // The Syncsets properties + // The SyncSets properties Properties SyncSetProperties `json:"properties,omitempty"` } // SyncSetProperties represents the properties of a SyncSet type SyncSetProperties struct { - // The parent Azure Red Hat OpenShift resourceID. - ClusterResourceId string `json:"clusterResourceId,omitempty"` - // Resources represents the SyncSets configuration. Resources string `json:"resources,omitempty"` } +// MachinePoolList represents a list of MachinePools +type MachinePoolList struct { + // The list of MachinePools. + MachinePools []*MachinePool `json:"value"` + + // The link used to get the next page of operations. + NextLink string `json:"nextLink,omitempty"` +} + // MachinePool represents a MachinePool type MachinePool struct { // The Resource ID. @@ -65,18 +71,28 @@ type MachinePool struct { // The resource name. Name string `json:"name,omitempty"` - // The MachinePool properties. + // The resource type. + Type string `json:"type,omitempty" mutable:"case"` + + // SystemData metadata relating to this resource. + SystemData *SystemData `json:"systemData,omitempty"` + + // The MachinePool Properties Properties MachinePoolProperties `json:"properties,omitempty"` } // MachinePoolProperties represents the properties of a MachinePool type MachinePoolProperties struct { + Resources string `json:"resources,omitempty"` +} - // The parent cluster resourceID. - ClusterResourceId string `json:"clusterResourceId,omitempty"` +// SyncIdentityProviderList represents a list of SyncIdentityProvider +type SyncIdentityProviderList struct { + // The list of SyncIdentityProvider. + SyncIdentityProviders []*SyncIdentityProvider `json:"value"` - // Resources represents the machinepools configuration. - Resources []byte `json:"resources,omitempty"` + // The link used to get the next page of operations. + NextLink string `json:"nextLink,omitempty"` } // SyncIdentityProvider represents a SyncIdentityProvider @@ -87,26 +103,51 @@ type SyncIdentityProvider struct { // The resource name. Name string `json:"name,omitempty"` - // The parent cluster resourceID. - ClusterResourceId string `json:"clusterResourceId,omitempty"` + // The resource type. + Type string `json:"type,omitempty" mutable:"case"` - // The SyncIdentityProvider properties. + // SystemData metadata relating to this resource. + SystemData *SystemData `json:"systemData,omitempty"` + + // The SyncIdentityProvider Properties Properties SyncIdentityProviderProperties `json:"properties,omitempty"` } -// SyncSetProperties represents the properties of a SyncSet +// SyncIdentityProviderProperties represents the properties of a SyncIdentityProvider type SyncIdentityProviderProperties struct { - MissingFields - Resources []byte `json:"resources,omitempty"` + // The SyncIdentityProvider Resources. + Resources string `json:"resources,omitempty"` } -// // HiveSecret represents a hive secret. -// type HiveSecret struct { +// SecretList represents a list of Secrets +type SecretList struct { + // The list of Secrets. + Secrets []*Secret `json:"value"` -// } + // The link used to get the next page of operations. + NextLink string `json:"nextLink,omitempty"` +} -// // SyncSetProperties represents the properties of a SyncSet -// type HiveSecretProperties struct { -// MissingFields -// Resources []byte `json:"resources,omitempty"` -// } +// Secret represents a secret. +type Secret struct { + // The Resource ID. + ID string `json:"id,omitempty"` + + // The resource name. + Name string `json:"name,omitempty"` + + // The resource type. + Type string `json:"type,omitempty" mutable:"case"` + + // SystemData metadata relating to this resource. + SystemData *SystemData `json:"systemData,omitempty"` + + // The Secret Properties + Properties SecretProperties `json:"properties,omitempty"` +} + +// SecretProperties represents the properties of a Secret +type SecretProperties struct { + // The Secrets Resources. + SecretResources SecureString `json:"secretResources,omitempty"` +} diff --git a/pkg/api/clustermanagerdocument.go b/pkg/api/clustermanagerdocument.go index 887670435..dc5ef4bfc 100644 --- a/pkg/api/clustermanagerdocument.go +++ b/pkg/api/clustermanagerdocument.go @@ -40,6 +40,7 @@ type ClusterManagerConfigurationDocument struct { SyncIdentityProvider *SyncIdentityProvider `json:"syncIdentityProvider,omitempty"` SyncSet *SyncSet `json:"syncSet,omitempty"` MachinePool *MachinePool `json:"machinePool,omitempty"` + Secret *Secret `json:"secret,omitempty"` CorrelationData *CorrelationData `json:"correlationData,omitempty" deep:"-"` } diff --git a/pkg/api/clustermanagerdocument_example.go b/pkg/api/clustermanagerdocument_example.go index 6edbf9674..84f42eb3a 100644 --- a/pkg/api/clustermanagerdocument_example.go +++ b/pkg/api/clustermanagerdocument_example.go @@ -3,37 +3,6 @@ package api // Copyright (c) Microsoft Corporation. // Licensed under the Apache License 2.0. -const mpPayload string = ` -{ - "apiVersion": "hive.openshift.io/v1", - "kind": "MachinePool", - "metadata": { - "creationTimestamp": "2022-08-16T14:17:10Z", - "generation": 1, - "labels": { - "api.openshift.com/id": "1u4lhakk4ar41bi3vgn0b7v9hk93dg4m" - }, - "name": "oadler-full-worker", - "namespace": "uhc-staging-1u4lhakk4ar41bi3vgn0b7v9hk93dg4m", - "resourceVersion": "1205855122", - "uid": "28a4de99-dc5f-4a9a-9f50-94a7dd47c712" - }, - "spec": { - "clusterDeploymentRef": { - "name": "oadler-full" - }, - "name": "worker", - "platform": {} - }, - "replicas": 2 - }, - "status": { - "conditions": [ - ] - } -} -` - // ExampleClusterManagerConfigurationDocumentSyncSet returns a ClusterManagerConfigurationDocument // with an example syncset payload model. The resources field comes from the ./hack/ocm folder. func ExampleClusterManagerConfigurationDocumentSyncSet() *ClusterManagerConfigurationDocument { @@ -45,9 +14,9 @@ func ExampleClusterManagerConfigurationDocumentSyncSet() *ClusterManagerConfigur SyncSet: &SyncSet{ Name: "mySyncSet", ID: "/subscriptions/subscriptionId/resourceGroups/resourceGroup/providers/Microsoft.RedHatOpenShift/OpenShiftClusters/resourceName/syncSets/mySyncSet", + Type: "Microsoft.RedHatOpenShift/OpenShiftClusters/SyncSets", Properties: SyncSetProperties{ - ClusterResourceId: "/subscriptions/subscriptionid/resourcegroups/resourcegroup/providers/microsoft.redhatopenshift/openshiftclusters/resourcename", - Resources: "eyAKICAiYXBpVmVyc2lvbiI6ICJoaXZlLm9wZW5zaGlmdC5pby92MSIsCiAgImtpbmQiOiAiU3luY1NldCIsCiAgIm1ldGFkYXRhIjogewogICAgIm5hbWUiOiAic2FtcGxlIiwKICAgICJuYW1lc3BhY2UiOiAiYXJvLWY2MGFlOGEyLWJjYTEtNDk4Ny05MDU2LWYyZjZhMTgzN2NhYSIKICB9LAogICJzcGVjIjogewogICAgImNsdXN0ZXJEZXBsb3ltZW50UmVmcyI6IFtdLAogICAgInJlc291cmNlcyI6IFsKICAgICAgewogICAgICAgICJhcGlWZXJzaW9uIjogInYxIiwKICAgICAgICAia2luZCI6ICJDb25maWdNYXAiLAogICAgICAgICJtZXRhZGF0YSI6IHsKICAgICAgICAgICJuYW1lIjogIm15Y29uZmlnbWFwIgogICAgICAgIH0KICAgICAgfQogICAgXQogIH0KfQo=", + Resources: "eyAKICAiYXBpVmVyc2lvbiI6ICJoaXZlLm9wZW5zaGlmdC5pby92MSIsCiAgImtpbmQiOiAiU3luY1NldCIsCiAgIm1ldGFkYXRhIjogewogICAgIm5hbWUiOiAic2FtcGxlIiwKICAgICJuYW1lc3BhY2UiOiAiYXJvLWY2MGFlOGEyLWJjYTEtNDk4Ny05MDU2LWYyZjZhMTgzN2NhYSIKICB9LAogICJzcGVjIjogewogICAgImNsdXN0ZXJEZXBsb3ltZW50UmVmcyI6IFtdLAogICAgInJlc291cmNlcyI6IFsKICAgICAgewogICAgICAgICJhcGlWZXJzaW9uIjogInYxIiwKICAgICAgICAia2luZCI6ICJDb25maWdNYXAiLAogICAgICAgICJtZXRhZGF0YSI6IHsKICAgICAgICAgICJuYW1lIjogIm15Y29uZmlnbWFwIgogICAgICAgIH0KICAgICAgfQogICAgXQogIH0KfQo=", }, }, CorrelationData: &CorrelationData{}, @@ -63,9 +32,45 @@ func ExampleClusterManagerConfigurationDocumentMachinePool() *ClusterManagerConf MachinePool: &MachinePool{ Name: "myMachinePool", ID: "/subscriptions/subscriptionId/resourceGroups/resourceGroup/providers/Microsoft.RedHatOpenShift/OpenShiftClusters/resourceName/machinePools/myMachinePool", + Type: "Microsoft.RedHatOpenShift/OpenShiftClusters/MachinePools", Properties: MachinePoolProperties{ - ClusterResourceId: "/subscriptions/subscriptionid/resourcegroups/resourcegroup/providers/microsoft.redhatopenshift/openshiftclusters/resourcename", - Resources: []byte(mpPayload), + Resources: "ewogICAgImFwaVZlcnNpb24iOiAiaGl2ZS5vcGVuc2hpZnQuaW8vdjEiLAogICAgImtpbmQiOiAiTWFjaGluZVBvb2wiLAogICAgIm1ldGFkYXRhIjogewogICAgICAgICJuYW1lIjogInRlc3QtY2x1c3Rlci13b3JrZXIiLAogICAgICAgICJuYW1lc3BhY2UiOiAiYXJvLWY2MGFlOGEyLWJjYTEtNDk4Ny05MDU2LVhYWFhYWFhYWFhYWCIKICAgIH0sCiAgICAic3BlYyI6IHsKICAgICAgICAiY2x1c3RlckRlcGxveW1lbnRSZWYiOiB7CiAgICAgICAgICAgICJuYW1lIjogInRlc3QtY2x1c3RlciIKICAgICAgICB9LAogICAgICAgICJuYW1lIjogIndvcmtlciIsCiAgICAgICAgInBsYXRmb3JtIjogewogICAgICAgICAgICAiYXdzIjogewogICAgICAgICAgICAgICAgInJvb3RWb2x1bWUiOiB7CiAgICAgICAgICAgICAgICAgICAgImlvcHMiOiAwLAogICAgICAgICAgICAgICAgICAgICJzaXplIjogMzAwLAogICAgICAgICAgICAgICAgICAgICJ0eXBlIjogImdwMyIKICAgICAgICAgICAgICAgIH0sCiAgICAgICAgICAgICAgICAidHlwZSI6ICJtNS54bGFyZ2UiLAogICAgICAgICAgICAgICAgInpvbmVzIjogWwogICAgICAgICAgICAgICAgICAgICJ1cy1lYXN0LTFhIgogICAgICAgICAgICAgICAgXQogICAgICAgICAgICB9CiAgICAgICAgfSwKICAgICAgICAicmVwbGljYXMiOiAyCiAgICB9LAogICAgInN0YXR1cyI6IHsKICAgICAgICAiY29uZGl0aW9ucyI6IFsKICAgICAgICBdCiAgICB9Cn0K", + }, + }, + CorrelationData: &CorrelationData{}, + } +} + +func ExampleClusterManagerConfigurationDocumentSyncIdentityProvider() *ClusterManagerConfigurationDocument { + return &ClusterManagerConfigurationDocument{ + ID: "00000000-0000-0000-0000-000000000000", + Key: "/subscriptions/subscriptionid/resourcegroups/resourcegroup/providers/microsoft.redhatopenshift/openshiftclusters/resourcename/syncidentityprovider/mySyncIdentityProvider", + ResourceID: "", + PartitionKey: "", + SyncIdentityProvider: &SyncIdentityProvider{ + Name: "mySyncIdentityProvider", + Type: "Microsoft.RedHatOpenShift/OpenShiftClusters/SyncIdentityProviders", + ID: "/subscriptions/subscriptionId/resourceGroups/resourceGroup/providers/Microsoft.RedHatOpenShift/OpenShiftClusters/resourceName/syncidentityprovider/mySyncIdentityProvider", + Properties: SyncIdentityProviderProperties{ + Resources: "ewogICAgImFwaVZlcnNpb24iOiAiaGl2ZS5vcGVuc2hpZnQuaW8vdjEiLAogICAgImtpbmQiOiAiU3luY0lkZW50aXR5UHJvdmlkZXIiLAogICAgIm1ldGFkYXRhIjogewogICAgICAgICJuYW1lIjogInRlc3QtY2x1c3RlciIsCiAgICAgICAgIm5hbWVzcGFjZSI6ICJhcm8tZjYwYWU4YTItYmNhMS00OTg3LTkwNTYtWFhYWFhYWFhYWFhYIgogICAgfSwKICAgICJzcGVjIjogewogICAgICAgICJjbHVzdGVyRGVwbG95bWVudFJlZnMiOiBbCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICJuYW1lIjogInRlc3QtY2x1c3RlciIKICAgICAgICAgICAgfQogICAgICAgIF0sCiAgICAgICAgImlkZW50aXR5UHJvdmlkZXJzIjogWwogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAiaHRwYXNzd2QiOiB7CiAgICAgICAgICAgICAgICAgICAgImZpbGVEYXRhIjogewogICAgICAgICAgICAgICAgICAgICAgICAibmFtZSI6ICJodHBhc3N3ZC1zZWNyZXQiCiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfSwKICAgICAgICAgICAgICAgICJtYXBwaW5nTWV0aG9kIjogImNsYWltIiwKICAgICAgICAgICAgICAgICJuYW1lIjogIkhUUGFzc3dkIiwKICAgICAgICAgICAgICAgICJ0eXBlIjogIkhUUGFzc3dkIgogICAgICAgICAgICB9CiAgICAgICAgXQogICAgfSwKICAgICJzdGF0dXMiOiB7fQp9Cg==", + }, + }, + CorrelationData: &CorrelationData{}, + } +} + +func ExampleClusterManagerConfigurationDocumentSecret() *ClusterManagerConfigurationDocument { + return &ClusterManagerConfigurationDocument{ + ID: "00000000-0000-0000-0000-000000000000", + Key: "/subscriptions/subscriptionid/resourcegroups/resourcegroup/providers/microsoft.redhatopenshift/openshiftclusters/resourcename/machinepools/mySyncIdentityProvider", + ResourceID: "", + PartitionKey: "", + Secret: &Secret{ + Name: "mySecret", + Type: "Microsoft.RedHatOpenShift/OpenShiftClusters/Secrets", + ID: "/subscriptions/subscriptionId/resourceGroups/resourceGroup/providers/Microsoft.RedHatOpenShift/OpenShiftClusters/resourceName/secret/mySecret", + Properties: SecretProperties{ + SecretResources: SecureString("YXBpVmVyc2lvbjogdjEKZGF0YToKICB1c2VybmFtZTogWVdSdGFXND0KICBwYXNzd29yZDogTVdZeVpERmxNbVUyTjJSbQpraW5kOiBTZWNyZXQKbWV0YWRhdGE6CiAgYW5ub3RhdGlvbnM6CiAgICBrdWJlY3RsLmt1YmVybmV0ZXMuaW8vbGFzdC1hcHBsaWVkLWNvbmZpZ3VyYXRpb246IHsgLi4uIH0KICBjcmVhdGlvblRpbWVzdGFtcDogMjAyMC0wMS0yMlQxODo0MTo1NloKICBuYW1lOiBteXNlY3JldAogIG5hbWVzcGFjZTogZGVmYXVsdAogIHJlc291cmNlVmVyc2lvbjogMTY0NjE5CiAgdWlkOiBjZmVlMDJkNi1jMTM3LTExZTUtOGQ3My00MjAxMGFmMDAwMDIKdHlwZTogT3BhcXVlCg=="), }, }, CorrelationData: &CorrelationData{}, diff --git a/pkg/api/operation.go b/pkg/api/operation.go index ab0261f22..86ef94fc2 100644 --- a/pkg/api/operation.go +++ b/pkg/api/operation.go @@ -153,7 +153,63 @@ var OperationSyncSetsDelete = Operation{ Display: Display{ Provider: "Azure Red Hat OpenShift", Resource: "syncSets", - Operation: "Delete OpenShift cluster syncset delete", + Operation: "Delete OpenShift cluster sync set", + }, + Origin: "user,system", +} + +var OperationMachinePoolsRead = Operation{ + Name: "Microsoft.RedHatOpenShift/openShiftClusters/machinePools/read", + Display: Display{ + Provider: "Azure Red Hat OpenShift", + Resource: "machinePools", + Operation: "Read OpenShift cluster machine pool", + }, + Origin: "user,system", +} +var OperationMachinePoolsWrite = Operation{ + Name: "Microsoft.RedHatOpenShift/openShiftClusters/machinePools/write", + Display: Display{ + Provider: "Azure Red Hat OpenShift", + Resource: "machinePools", + Operation: "Write OpenShift cluster machine pool", + }, + Origin: "user,system", +} +var OperationMachinePoolsDelete = Operation{ + Name: "Microsoft.RedHatOpenShift/openShiftClusters/machinePools/delete", + Display: Display{ + Provider: "Azure Red Hat OpenShift", + Resource: "machinePools", + Operation: "Delete OpenShift cluster machine pool", + }, + Origin: "user,system", +} + +var OperationSyncIdentityProvidersRead = Operation{ + Name: "Microsoft.RedHatOpenShift/openShiftClusters/syncIdentityProviders/read", + Display: Display{ + Provider: "Azure Red Hat OpenShift", + Resource: "syncIdentityProviders", + Operation: "Read OpenShift cluster sync identity provider", + }, + Origin: "user,system", +} +var OperationSyncIdentityProvidersWrite = Operation{ + Name: "Microsoft.RedHatOpenShift/openShiftClusters/syncIdentityProviders/write", + Display: Display{ + Provider: "Azure Red Hat OpenShift", + Resource: "syncIdentityProviders", + Operation: "Write OpenShift cluster sync identity provider", + }, + Origin: "user,system", +} +var OperationSyncIdentityProvidersDelete = Operation{ + Name: "Microsoft.RedHatOpenShift/openShiftClusters/syncIdentityProviders/delete", + Display: Display{ + Provider: "Azure Red Hat OpenShift", + Resource: "syncIdentityProviders", + Operation: "Delete OpenShift cluster sync identity provider", }, Origin: "user,system", } diff --git a/pkg/api/register.go b/pkg/api/register.go index c511a72dc..76db993b0 100644 --- a/pkg/api/register.go +++ b/pkg/api/register.go @@ -45,6 +45,7 @@ type OpenShiftVersionStaticValidator interface { // Version is a set of endpoints implemented by each API version type Version struct { + ClusterManagerConfigurationConverter ClusterManagerConfigurationConverter OpenShiftClusterConverter OpenShiftClusterConverter OpenShiftClusterStaticValidator OpenShiftClusterStaticValidator OpenShiftClusterCredentialsConverter OpenShiftClusterCredentialsConverter diff --git a/pkg/api/v20220904/clustermanager.go b/pkg/api/v20220904/clustermanager.go index d527e2227..33dd80d80 100644 --- a/pkg/api/v20220904/clustermanager.go +++ b/pkg/api/v20220904/clustermanager.go @@ -19,12 +19,21 @@ type ClusterManagerConfigurationList struct { type ClusterManagerConfiguration struct { // ID is the unique identifier for the cluster manager configuration - ID string `json:"id,omitempty"` - Name string `json:"name,omitempty"` - ClusterResourceId string `json:"clusterResourceId,omitempty"` - Deleting bool `json:"deleting,omitempty"` // https://docs.microsoft.com/en-us/azure/cosmos-db/change-feed-design-patterns#deletes - Properties ClusterManagerConfigurationProperties `json:"properties,omitempty"` - // SystemData metadata from ARM, more info in pkg/api/openshiftcluster.go + ID string `json:"id,omitempty"` + + // The resource name + Name string `json:"name,omitempty"` + + // The parent cluster resourceId + ClusterResourceId string `json:"clusterResourceId,omitempty"` + + // If this object is marked to be deleted + Deleting bool `json:"deleting,omitempty"` // https://docs.microsoft.com/en-us/azure/cosmos-db/change-feed-design-patterns#deletes + + // The ClusterManagerConfigurations properties + Properties ClusterManagerConfigurationProperties `json:"properties,omitempty"` + + // SystemData metadata from ARM SystemData *SystemData `json:"systemData,omitempty"` } @@ -34,8 +43,6 @@ type ClusterManagerConfigurationProperties struct { // SyncSetList represents a list of SyncSets type SyncSetList struct { - proxyResource bool - // The list of syncsets. SyncSets []*SyncSet `json:"value"` @@ -48,7 +55,7 @@ type SyncSet struct { // This is a flag used during the swagger generation typewalker to // signal that it should be marked as a proxy resource and // not a tracked ARM resource. - // proxyResource bool + proxyResource bool // The resource ID. ID string `json:"id,omitempty" mutable:"case"` @@ -59,8 +66,8 @@ type SyncSet struct { // The resource type. Type string `json:"type,omitempty" mutable:"case"` - // // SystemData metadata relating to this resource. - // SystemData *SystemData `json:"systemData,omitempty"` + // SystemData metadata relating to this resource. + SystemData *SystemData `json:"systemData,omitempty"` // The Syncsets properties Properties SyncSetProperties `json:"properties,omitempty"` @@ -68,53 +75,118 @@ type SyncSet struct { // SyncSetProperties represents the properties of a SyncSet type SyncSetProperties struct { - // The parent Azure Red Hat OpenShift resourceID. - ClusterResourceId string `json:"clusterResourceId,omitempty"` - // Resources represents the SyncSets configuration. Resources string `json:"resources,omitempty"` } +// MachinePoolList represents a list of MachinePools +type MachinePoolList struct { + // The list of Machine Pools. + MachinePools []*MachinePool `json:"value"` + + // The link used to get the next page of operations. + NextLink string `json:"nextLink,omitempty"` +} + // MachinePool represents a MachinePool type MachinePool struct { + // This is a flag used during the swagger generation typewalker to + // signal that it should be marked as a proxy resource and + // not a tracked ARM resource. + proxyResource bool + // The Resource ID. ID string `json:"id,omitempty"` // The resource name. Name string `json:"name,omitempty"` - // The parent cluster resourceID. - ClusterResourceId string `json:"clusterResourceId,omitempty"` + // The resource type. + Type string `json:"type,omitempty" mutable:"case"` // SystemData metadata relating to this resource. SystemData *SystemData `json:"systemData,omitempty"` + // The MachinePool Properties Properties MachinePoolProperties `json:"properties,omitempty"` } // MachinePoolProperties represents the properties of a MachinePool type MachinePoolProperties struct { - Resources interface{} `json:"resources,omitempty"` + Resources string `json:"resources,omitempty"` +} + +// SyncSetList represents a list of SyncSets +type SyncIdentityProviderList struct { + // The list of sync identity providers + SyncIdentityProviders []*SyncIdentityProvider `json:"value"` + + // The link used to get the next page of operations. + NextLink string `json:"nextLink,omitempty"` } // SyncIdentityProvider represents a SyncIdentityProvider type SyncIdentityProvider struct { + // This is a flag used during the swagger generation typewalker to + // signal that it should be marked as a proxy resource and + // not a tracked ARM resource. + proxyResource bool + // The Resource ID. ID string `json:"id,omitempty"` // The resource name. Name string `json:"name,omitempty"` - // The parent cluster resourceID. - ClusterResourceId string `json:"clusterResourceId,omitempty"` + // The resource type. + Type string `json:"type,omitempty" mutable:"case"` // SystemData metadata relating to this resource. SystemData *SystemData `json:"systemData,omitempty"` + // The SyncIdentityProvider Properties Properties SyncIdentityProviderProperties `json:"properties,omitempty"` } // SyncSetProperties represents the properties of a SyncSet type SyncIdentityProviderProperties struct { - Resources interface{} `json:"resources,omitempty"` + Resources string `json:"resources,omitempty"` +} + +// SecretList represents a list of Secrets +type SecretList struct { + // The list of secrets. + Secrets []*Secret `json:"value"` + + // The link used to get the next page of operations. + NextLink string `json:"nextLink,omitempty"` +} + +// Secret represents a secret. +type Secret struct { + // This is a flag used during the swagger generation typewalker to + // signal that it should be marked as a proxy resource and + // not a tracked ARM resource. + proxyResource bool + + // The Resource ID. + ID string `json:"id,omitempty"` + + // The resource name. + Name string `json:"name,omitempty"` + + // The resource type. + Type string `json:"type,omitempty" mutable:"case"` + + // SystemData metadata relating to this resource. + SystemData *SystemData `json:"systemData,omitempty"` + + // The Secret Properties + Properties SecretProperties `json:"properties,omitempty"` +} + +// SecretProperties represents the properties of a Secret +type SecretProperties struct { + // The Secrets Resources. + SecretResources string `json:"secretResources,omitempty"` } diff --git a/pkg/api/v20220904/clustermanager_convert.go b/pkg/api/v20220904/clustermanager_convert.go index 39c3a5b9f..b4dc2288c 100644 --- a/pkg/api/v20220904/clustermanager_convert.go +++ b/pkg/api/v20220904/clustermanager_convert.go @@ -11,7 +11,7 @@ import ( type clusterManagerConfigurationConverter struct{} -func (c *clusterManagerConfigurationConverter) ToExternal(ocm *api.ClusterManagerConfiguration) (interface{}, error) { +func (c clusterManagerConfigurationConverter) ToExternal(ocm *api.ClusterManagerConfiguration) (interface{}, error) { out := new(ClusterManagerConfiguration) out.ID = ocm.ID var data interface{} @@ -23,28 +23,54 @@ func (c *clusterManagerConfigurationConverter) ToExternal(ocm *api.ClusterManage return out, nil } -func (c *clusterManagerConfigurationConverter) SyncSetToExternal(ocm *api.SyncSet) (interface{}, error) { +func (c clusterManagerConfigurationConverter) SyncSetToExternal(ocm *api.SyncSet) (interface{}, error) { out := new(SyncSet) + out.proxyResource = true out.ID = ocm.ID out.Name = ocm.Name out.Type = ocm.Type - out.Properties = SyncSetProperties{ - ClusterResourceId: ocm.Properties.ClusterResourceId, - Resources: ocm.Properties.Resources, - } - + out.Properties.Resources = ocm.Properties.Resources return out, nil } -func (c *clusterManagerConfigurationConverter) ToInternal(_ocm interface{}, out *api.ClusterManagerConfiguration) error { +func (c clusterManagerConfigurationConverter) MachinePoolToExternal(ocm *api.MachinePool) (interface{}, error) { + out := new(MachinePool) + out.proxyResource = true + out.ID = ocm.ID + out.Name = ocm.Name + out.Type = ocm.Type + out.Properties.Resources = ocm.Properties.Resources + return out, nil +} + +func (c clusterManagerConfigurationConverter) SyncIdentityProviderToExternal(ocm *api.SyncIdentityProvider) (interface{}, error) { + out := new(SyncIdentityProvider) + out.proxyResource = true + out.ID = ocm.ID + out.Name = ocm.Name + out.Type = ocm.Type + out.Properties.Resources = ocm.Properties.Resources + return out, nil +} + +func (c clusterManagerConfigurationConverter) SecretToExternal(ocm *api.Secret) (interface{}, error) { + out := new(Secret) + out.proxyResource = true + out.ID = ocm.ID + out.Name = ocm.Name + out.Type = ocm.Type + out.Properties.SecretResources = "" + return out, nil +} + +func (c clusterManagerConfigurationConverter) ToInternal(_ocm interface{}, out *api.ClusterManagerConfiguration) error { ocm := _ocm.(*api.ClusterManagerConfiguration) out.ID = ocm.ID - return nil } // ToExternalList returns a slice of external representations of the internal objects -func (c *clusterManagerConfigurationConverter) ToExternalList(ocms []*api.ClusterManagerConfiguration, nextLink string) (interface{}, error) { +func (c clusterManagerConfigurationConverter) ToExternalList(ocms []*api.ClusterManagerConfiguration, nextLink string) (interface{}, error) { l := &ClusterManagerConfigurationList{ ClusterManagerConfigurations: make([]*ClusterManagerConfiguration, 0, len(ocms)), NextLink: nextLink, diff --git a/pkg/api/v20220904/clustermanager_example.go b/pkg/api/v20220904/clustermanager_example.go index 095dde733..faab8cba6 100644 --- a/pkg/api/v20220904/clustermanager_example.go +++ b/pkg/api/v20220904/clustermanager_example.go @@ -9,7 +9,9 @@ import ( func exampleSyncSet() *SyncSet { doc := api.ExampleClusterManagerConfigurationDocumentSyncSet() - // ext, err := (&clusterManagerConfigurationConverter{}).ToExternal(doc.ClusterManagerConfiguration) + doc.SyncSet.ID = "" + doc.SyncSet.Type = "" + doc.SyncSet.Name = "" ext, err := (&clusterManagerConfigurationConverter{}).SyncSetToExternal(doc.SyncSet) if err != nil { panic(err) @@ -22,7 +24,7 @@ func ExampleSyncSetPutParameter() interface{} { } func ExampleSyncSetPatchParameter() interface{} { - return ExampleSyncSetPutParameter() + return exampleSyncSet() } func ExampleSyncSetResponse() interface{} { @@ -31,9 +33,104 @@ func ExampleSyncSetResponse() interface{} { func ExampleSyncSetListResponse() interface{} { return &SyncSetList{ - proxyResource: true, SyncSets: []*SyncSet{ ExampleSyncSetResponse().(*SyncSet), }, } } + +func exampleMachinePool() *MachinePool { + doc := api.ExampleClusterManagerConfigurationDocumentMachinePool() + doc.MachinePool.ID = "" + doc.MachinePool.Type = "" + doc.MachinePool.Name = "" + ext, err := (&clusterManagerConfigurationConverter{}).MachinePoolToExternal(doc.MachinePool) + if err != nil { + panic(err) + } + return ext.(*MachinePool) +} + +func ExampleMachinePoolPutParameter() interface{} { + return exampleMachinePool() +} + +func ExampleMachinePoolPatchParameter() interface{} { + return exampleMachinePool() +} + +func ExampleMachinePoolResponse() interface{} { + return exampleMachinePool() +} + +func ExampleMachinePoolListResponse() interface{} { + return &MachinePoolList{ + MachinePools: []*MachinePool{ + ExampleMachinePoolResponse().(*MachinePool), + }, + } +} + +func exampleSyncIdentityProvider() *SyncIdentityProvider { + doc := api.ExampleClusterManagerConfigurationDocumentSyncIdentityProvider() + doc.SyncIdentityProvider.ID = "" + doc.SyncIdentityProvider.Type = "" + doc.SyncIdentityProvider.Name = "" + ext, err := (&clusterManagerConfigurationConverter{}).SyncIdentityProviderToExternal(doc.SyncIdentityProvider) + if err != nil { + panic(err) + } + return ext.(*SyncIdentityProvider) +} + +func ExampleSyncIdentityProviderPutParameter() interface{} { + return exampleSyncIdentityProvider() +} + +func ExampleSyncIdentityProviderPatchParameter() interface{} { + return exampleSyncIdentityProvider() +} + +func ExampleSyncIdentityProviderResponse() interface{} { + return exampleSyncIdentityProvider() +} + +func ExampleSyncIdentityProviderListResponse() interface{} { + return &SyncIdentityProviderList{ + SyncIdentityProviders: []*SyncIdentityProvider{ + ExampleSyncIdentityProviderResponse().(*SyncIdentityProvider), + }, + } +} + +func exampleSecret() *Secret { + doc := api.ExampleClusterManagerConfigurationDocumentSecret() + doc.Secret.ID = "" + doc.Secret.Type = "" + doc.Secret.Name = "" + ext, err := (&clusterManagerConfigurationConverter{}).SecretToExternal(doc.Secret) + if err != nil { + panic(err) + } + return ext.(*Secret) +} + +func ExampleSecretPutParameter() interface{} { + return exampleSecret() +} + +func ExampleSecretPatchParameter() interface{} { + return exampleSecret() +} + +func ExampleSecretResponse() interface{} { + return exampleSecret() +} + +func ExampleSecretListResponse() interface{} { + return &SecretList{ + Secrets: []*Secret{ + ExampleSecretResponse().(*Secret), + }, + } +} diff --git a/pkg/api/v20220904/clustermanager_validatestatic.go b/pkg/api/v20220904/clustermanager_validatestatic.go deleted file mode 100644 index 5195a240d..000000000 --- a/pkg/api/v20220904/clustermanager_validatestatic.go +++ /dev/null @@ -1,8 +0,0 @@ -package v20220904 - -// Copyright (c) Microsoft Corporation. -// Licensed under the Apache License 2.0. - -// TODO Implement the static validator -// type SyncSetStaticValidator struct { -// } diff --git a/pkg/api/v20220904/register.go b/pkg/api/v20220904/register.go index 5d9982208..da71d29b9 100644 --- a/pkg/api/v20220904/register.go +++ b/pkg/api/v20220904/register.go @@ -36,6 +36,12 @@ func init() { api.OperationSyncSetsRead, api.OperationSyncSetsWrite, api.OperationSyncSetsDelete, + api.OperationMachinePoolsRead, + api.OperationMachinePoolsWrite, + api.OperationMachinePoolsDelete, + api.OperationSyncIdentityProvidersRead, + api.OperationSyncIdentityProvidersWrite, + api.OperationSyncIdentityProvidersDelete, }, }, } diff --git a/pkg/client/services/redhatopenshift/mgmt/2022-09-04/redhatopenshift/machinepools.go b/pkg/client/services/redhatopenshift/mgmt/2022-09-04/redhatopenshift/machinepools.go new file mode 100644 index 000000000..f512d53af --- /dev/null +++ b/pkg/client/services/redhatopenshift/mgmt/2022-09-04/redhatopenshift/machinepools.go @@ -0,0 +1,525 @@ +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" +) + +// MachinePoolsClient is the rest API for Azure Red Hat OpenShift 4 +type MachinePoolsClient struct { + BaseClient +} + +// NewMachinePoolsClient creates an instance of the MachinePoolsClient client. +func NewMachinePoolsClient(subscriptionID string) MachinePoolsClient { + return NewMachinePoolsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewMachinePoolsClientWithBaseURI creates an instance of the MachinePoolsClient 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 NewMachinePoolsClientWithBaseURI(baseURI string, subscriptionID string) MachinePoolsClient { + return MachinePoolsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate the operation returns properties of a MachinePool. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// resourceName - the name of the OpenShift cluster resource. +// childResourceName - the name of the MachinePool resource. +// parameters - the MachinePool resource. +func (client MachinePoolsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, childResourceName string, parameters MachinePool) (result MachinePool, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MachinePoolsClient.CreateOrUpdate") + 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}}}}); err != nil { + return result, validation.NewError("redhatopenshift.MachinePoolsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceName, childResourceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "redhatopenshift.MachinePoolsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "redhatopenshift.MachinePoolsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "redhatopenshift.MachinePoolsClient", "CreateOrUpdate", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client MachinePoolsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, childResourceName string, parameters MachinePool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "childResourceName": autorest.Encode("path", childResourceName), + "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.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/machinePool/{childResourceName}", 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 MachinePoolsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client MachinePoolsClient) CreateOrUpdateResponder(resp *http.Response) (result MachinePool, 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. +// childResourceName - the name of the MachinePool resource. +func (client MachinePoolsClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, childResourceName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MachinePoolsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.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}}}}); err != nil { + return result, validation.NewError("redhatopenshift.MachinePoolsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName, childResourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "redhatopenshift.MachinePoolsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "redhatopenshift.MachinePoolsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "redhatopenshift.MachinePoolsClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client MachinePoolsClient) DeletePreparer(ctx context.Context, resourceGroupName string, resourceName string, childResourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "childResourceName": autorest.Encode("path", childResourceName), + "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}/machinePool/{childResourceName}", 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 MachinePoolsClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client MachinePoolsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get the operation returns properties of a MachinePool. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// resourceName - the name of the OpenShift cluster resource. +// childResourceName - the name of the MachinePool resource. +func (client MachinePoolsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, childResourceName string) (result MachinePool, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MachinePoolsClient.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}}}}); err != nil { + return result, validation.NewError("redhatopenshift.MachinePoolsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, resourceName, childResourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "redhatopenshift.MachinePoolsClient", "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.MachinePoolsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "redhatopenshift.MachinePoolsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client MachinePoolsClient) GetPreparer(ctx context.Context, resourceGroupName string, resourceName string, childResourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "childResourceName": autorest.Encode("path", childResourceName), + "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}/machinePool/{childResourceName}", 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 MachinePoolsClient) 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 MachinePoolsClient) GetResponder(resp *http.Response) (result MachinePool, 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 MachinePool. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// resourceName - the name of the OpenShift cluster resource. +func (client MachinePoolsClient) List(ctx context.Context, resourceGroupName string, resourceName string) (result MachinePoolListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MachinePoolsClient.List") + defer func() { + sc := -1 + if result.mpl.Response.Response != nil { + sc = result.mpl.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}}}}); err != nil { + return result, validation.NewError("redhatopenshift.MachinePoolsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "redhatopenshift.MachinePoolsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.mpl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "redhatopenshift.MachinePoolsClient", "List", resp, "Failure sending request") + return + } + + result.mpl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "redhatopenshift.MachinePoolsClient", "List", resp, "Failure responding to request") + return + } + if result.mpl.hasNextLink() && result.mpl.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client MachinePoolsClient) ListPreparer(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/openShiftCluster/{resourceName}/machinePools", 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 MachinePoolsClient) 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 MachinePoolsClient) ListResponder(resp *http.Response) (result MachinePoolList, 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 MachinePoolsClient) listNextResults(ctx context.Context, lastResults MachinePoolList) (result MachinePoolList, err error) { + req, err := lastResults.machinePoolListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "redhatopenshift.MachinePoolsClient", "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.MachinePoolsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "redhatopenshift.MachinePoolsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client MachinePoolsClient) ListComplete(ctx context.Context, resourceGroupName string, resourceName string) (result MachinePoolListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MachinePoolsClient.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, resourceGroupName, resourceName) + return +} + +// Update the operation returns properties of a MachinePool. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// resourceName - the name of the OpenShift cluster resource. +// childResourceName - the name of the MachinePool resource. +// parameters - the MachinePool resource. +func (client MachinePoolsClient) Update(ctx context.Context, resourceGroupName string, resourceName string, childResourceName string, parameters MachinePoolUpdate) (result MachinePool, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MachinePoolsClient.Update") + 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}}}}); err != nil { + return result, validation.NewError("redhatopenshift.MachinePoolsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, resourceName, childResourceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "redhatopenshift.MachinePoolsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "redhatopenshift.MachinePoolsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "redhatopenshift.MachinePoolsClient", "Update", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client MachinePoolsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, childResourceName string, parameters MachinePoolUpdate) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "childResourceName": autorest.Encode("path", childResourceName), + "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}/machinePool/{childResourceName}", 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 MachinePoolsClient) UpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client MachinePoolsClient) UpdateResponder(resp *http.Response) (result MachinePool, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} 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 542e39f1d..f5762283c 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 @@ -128,6 +128,304 @@ type ListString struct { Value *[]string `json:"value,omitempty"` } +// MachinePool machinePool represents a MachinePool +type MachinePool struct { + autorest.Response `json:"-"` + // MachinePoolProperties - The MachinePool Properties + *MachinePoolProperties `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 MachinePool. +func (mp MachinePool) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mp.MachinePoolProperties != nil { + objectMap["properties"] = mp.MachinePoolProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for MachinePool struct. +func (mp *MachinePool) 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 machinePoolProperties MachinePoolProperties + err = json.Unmarshal(*v, &machinePoolProperties) + if err != nil { + return err + } + mp.MachinePoolProperties = &machinePoolProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mp.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mp.Type = &typeVar + } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + mp.SystemData = &systemData + } + } + } + + return nil +} + +// MachinePoolList machinePoolList represents a list of MachinePools +type MachinePoolList struct { + autorest.Response `json:"-"` + // Value - The list of Machine Pools. + Value *[]MachinePool `json:"value,omitempty"` + // NextLink - The link used to get the next page of operations. + NextLink *string `json:"nextLink,omitempty"` +} + +// MachinePoolListIterator provides access to a complete listing of MachinePool values. +type MachinePoolListIterator struct { + i int + page MachinePoolListPage +} + +// 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 *MachinePoolListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MachinePoolListIterator.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 *MachinePoolListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter MachinePoolListIterator) 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 MachinePoolListIterator) Response() MachinePoolList { + 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 MachinePoolListIterator) Value() MachinePool { + if !iter.page.NotDone() { + return MachinePool{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the MachinePoolListIterator type. +func NewMachinePoolListIterator(page MachinePoolListPage) MachinePoolListIterator { + return MachinePoolListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (mpl MachinePoolList) IsEmpty() bool { + return mpl.Value == nil || len(*mpl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (mpl MachinePoolList) hasNextLink() bool { + return mpl.NextLink != nil && len(*mpl.NextLink) != 0 +} + +// machinePoolListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (mpl MachinePoolList) machinePoolListPreparer(ctx context.Context) (*http.Request, error) { + if !mpl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(mpl.NextLink))) +} + +// MachinePoolListPage contains a page of MachinePool values. +type MachinePoolListPage struct { + fn func(context.Context, MachinePoolList) (MachinePoolList, error) + mpl MachinePoolList +} + +// 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 *MachinePoolListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MachinePoolListPage.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.mpl) + if err != nil { + return err + } + page.mpl = 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 *MachinePoolListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page MachinePoolListPage) NotDone() bool { + return !page.mpl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page MachinePoolListPage) Response() MachinePoolList { + return page.mpl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page MachinePoolListPage) Values() []MachinePool { + if page.mpl.IsEmpty() { + return nil + } + return *page.mpl.Value +} + +// Creates a new instance of the MachinePoolListPage type. +func NewMachinePoolListPage(cur MachinePoolList, getNextPage func(context.Context, MachinePoolList) (MachinePoolList, error)) MachinePoolListPage { + return MachinePoolListPage{ + fn: getNextPage, + mpl: cur, + } +} + +// MachinePoolProperties machinePoolProperties represents the properties of a MachinePool +type MachinePoolProperties struct { + Resources *string `json:"resources,omitempty"` +} + +// MachinePoolUpdate machinePool represents a MachinePool +type MachinePoolUpdate struct { + // MachinePoolProperties - The MachinePool Properties + *MachinePoolProperties `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 MachinePoolUpdate. +func (mpu MachinePoolUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mpu.MachinePoolProperties != nil { + objectMap["properties"] = mpu.MachinePoolProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for MachinePoolUpdate struct. +func (mpu *MachinePoolUpdate) 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 machinePoolProperties MachinePoolProperties + err = json.Unmarshal(*v, &machinePoolProperties) + if err != nil { + return err + } + mpu.MachinePoolProperties = &machinePoolProperties + } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + mpu.SystemData = &systemData + } + } + } + + return nil +} + // MasterProfile masterProfile represents a master profile. type MasterProfile struct { // VMSize - The size of the master VMs. @@ -853,6 +1151,305 @@ func (r Resource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// Secret secret represents a secret. +type Secret struct { + autorest.Response `json:"-"` + // SecretProperties - The Secret Properties + *SecretProperties `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 Secret. +func (s Secret) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if s.SecretProperties != nil { + objectMap["properties"] = s.SecretProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Secret struct. +func (s *Secret) 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 secretProperties SecretProperties + err = json.Unmarshal(*v, &secretProperties) + if err != nil { + return err + } + s.SecretProperties = &secretProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + s.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + s.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + s.Type = &typeVar + } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + s.SystemData = &systemData + } + } + } + + return nil +} + +// SecretList secretList represents a list of Secrets +type SecretList struct { + autorest.Response `json:"-"` + // Value - The list of secrets. + Value *[]Secret `json:"value,omitempty"` + // NextLink - The link used to get the next page of operations. + NextLink *string `json:"nextLink,omitempty"` +} + +// SecretListIterator provides access to a complete listing of Secret values. +type SecretListIterator struct { + i int + page SecretListPage +} + +// 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 *SecretListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecretListIterator.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 *SecretListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SecretListIterator) 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 SecretListIterator) Response() SecretList { + 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 SecretListIterator) Value() Secret { + if !iter.page.NotDone() { + return Secret{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the SecretListIterator type. +func NewSecretListIterator(page SecretListPage) SecretListIterator { + return SecretListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (sl SecretList) IsEmpty() bool { + return sl.Value == nil || len(*sl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (sl SecretList) hasNextLink() bool { + return sl.NextLink != nil && len(*sl.NextLink) != 0 +} + +// secretListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (sl SecretList) secretListPreparer(ctx context.Context) (*http.Request, error) { + if !sl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(sl.NextLink))) +} + +// SecretListPage contains a page of Secret values. +type SecretListPage struct { + fn func(context.Context, SecretList) (SecretList, error) + sl SecretList +} + +// 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 *SecretListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecretListPage.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.sl) + if err != nil { + return err + } + page.sl = 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 *SecretListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SecretListPage) NotDone() bool { + return !page.sl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SecretListPage) Response() SecretList { + return page.sl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SecretListPage) Values() []Secret { + if page.sl.IsEmpty() { + return nil + } + return *page.sl.Value +} + +// Creates a new instance of the SecretListPage type. +func NewSecretListPage(cur SecretList, getNextPage func(context.Context, SecretList) (SecretList, error)) SecretListPage { + return SecretListPage{ + fn: getNextPage, + sl: cur, + } +} + +// SecretProperties secretProperties represents the properties of a Secret +type SecretProperties struct { + // SecretResources - The Secrets Resources. + SecretResources *string `json:"secretResources,omitempty"` +} + +// SecretUpdate secret represents a secret. +type SecretUpdate struct { + // SecretProperties - The Secret Properties + *SecretProperties `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 SecretUpdate. +func (su SecretUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if su.SecretProperties != nil { + objectMap["properties"] = su.SecretProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SecretUpdate struct. +func (su *SecretUpdate) 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 secretProperties SecretProperties + err = json.Unmarshal(*v, &secretProperties) + if err != nil { + return err + } + su.SecretProperties = &secretProperties + } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + su.SystemData = &systemData + } + } + } + + return nil +} + // ServicePrincipalProfile servicePrincipalProfile represents a service principal profile. type ServicePrincipalProfile struct { // ClientID - The client ID used for the cluster. @@ -861,12 +1458,316 @@ type ServicePrincipalProfile struct { ClientSecret *string `json:"clientSecret,omitempty"` } +// SyncIdentityProvider syncIdentityProvider represents a SyncIdentityProvider +type SyncIdentityProvider struct { + autorest.Response `json:"-"` + // SyncIdentityProviderProperties - The SyncIdentityProvider Properties + *SyncIdentityProviderProperties `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 SyncIdentityProvider. +func (sip SyncIdentityProvider) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sip.SyncIdentityProviderProperties != nil { + objectMap["properties"] = sip.SyncIdentityProviderProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SyncIdentityProvider struct. +func (sip *SyncIdentityProvider) 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 syncIdentityProviderProperties SyncIdentityProviderProperties + err = json.Unmarshal(*v, &syncIdentityProviderProperties) + if err != nil { + return err + } + sip.SyncIdentityProviderProperties = &syncIdentityProviderProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sip.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sip.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sip.Type = &typeVar + } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + sip.SystemData = &systemData + } + } + } + + return nil +} + +// SyncIdentityProviderList syncSetList represents a list of SyncSets +type SyncIdentityProviderList struct { + autorest.Response `json:"-"` + // Value - The list of sync identity providers + Value *[]SyncIdentityProvider `json:"value,omitempty"` + // NextLink - The link used to get the next page of operations. + NextLink *string `json:"nextLink,omitempty"` +} + +// SyncIdentityProviderListIterator provides access to a complete listing of SyncIdentityProvider values. +type SyncIdentityProviderListIterator struct { + i int + page SyncIdentityProviderListPage +} + +// 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 *SyncIdentityProviderListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SyncIdentityProviderListIterator.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 *SyncIdentityProviderListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SyncIdentityProviderListIterator) 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 SyncIdentityProviderListIterator) Response() SyncIdentityProviderList { + 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 SyncIdentityProviderListIterator) Value() SyncIdentityProvider { + if !iter.page.NotDone() { + return SyncIdentityProvider{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the SyncIdentityProviderListIterator type. +func NewSyncIdentityProviderListIterator(page SyncIdentityProviderListPage) SyncIdentityProviderListIterator { + return SyncIdentityProviderListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (sipl SyncIdentityProviderList) IsEmpty() bool { + return sipl.Value == nil || len(*sipl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (sipl SyncIdentityProviderList) hasNextLink() bool { + return sipl.NextLink != nil && len(*sipl.NextLink) != 0 +} + +// syncIdentityProviderListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (sipl SyncIdentityProviderList) syncIdentityProviderListPreparer(ctx context.Context) (*http.Request, error) { + if !sipl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(sipl.NextLink))) +} + +// SyncIdentityProviderListPage contains a page of SyncIdentityProvider values. +type SyncIdentityProviderListPage struct { + fn func(context.Context, SyncIdentityProviderList) (SyncIdentityProviderList, error) + sipl SyncIdentityProviderList +} + +// 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 *SyncIdentityProviderListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SyncIdentityProviderListPage.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.sipl) + if err != nil { + return err + } + page.sipl = 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 *SyncIdentityProviderListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SyncIdentityProviderListPage) NotDone() bool { + return !page.sipl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SyncIdentityProviderListPage) Response() SyncIdentityProviderList { + return page.sipl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SyncIdentityProviderListPage) Values() []SyncIdentityProvider { + if page.sipl.IsEmpty() { + return nil + } + return *page.sipl.Value +} + +// Creates a new instance of the SyncIdentityProviderListPage type. +func NewSyncIdentityProviderListPage(cur SyncIdentityProviderList, getNextPage func(context.Context, SyncIdentityProviderList) (SyncIdentityProviderList, error)) SyncIdentityProviderListPage { + return SyncIdentityProviderListPage{ + fn: getNextPage, + sipl: cur, + } +} + +// SyncIdentityProviderProperties syncSetProperties represents the properties of a SyncSet +type SyncIdentityProviderProperties struct { + Resources *string `json:"resources,omitempty"` +} + +// SyncIdentityProviderUpdate syncIdentityProvider represents a SyncIdentityProvider +type SyncIdentityProviderUpdate struct { + // SyncIdentityProviderProperties - The SyncIdentityProvider Properties + *SyncIdentityProviderProperties `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 SyncIdentityProviderUpdate. +func (sipu SyncIdentityProviderUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sipu.SyncIdentityProviderProperties != nil { + objectMap["properties"] = sipu.SyncIdentityProviderProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SyncIdentityProviderUpdate struct. +func (sipu *SyncIdentityProviderUpdate) 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 syncIdentityProviderProperties SyncIdentityProviderProperties + err = json.Unmarshal(*v, &syncIdentityProviderProperties) + if err != nil { + return err + } + sipu.SyncIdentityProviderProperties = &syncIdentityProviderProperties + } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + sipu.SystemData = &systemData + } + } + } + + return nil +} + // SyncSet syncSet represents a SyncSet for an Azure Red Hat OpenShift Cluster. type SyncSet struct { autorest.Response `json:"-"` // SyncSetProperties - The Syncsets properties *SyncSetProperties `json:"properties,omitempty"` - // SystemData - READ-ONLY; The system meta data relating to this resource. + // 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"` } @@ -897,6 +1798,33 @@ func (ss *SyncSet) UnmarshalJSON(body []byte) error { } ss.SyncSetProperties = &syncSetProperties } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ss.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ss.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ss.Type = &typeVar + } case "systemData": if v != nil { var systemData SystemData @@ -919,26 +1847,6 @@ type SyncSetList struct { Value *[]SyncSet `json:"value,omitempty"` // NextLink - The link used to get the next page of operations. NextLink *string `json:"nextLink,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 SyncSetList. -func (ssl SyncSetList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ssl.Value != nil { - objectMap["value"] = ssl.Value - } - if ssl.NextLink != nil { - objectMap["nextLink"] = ssl.NextLink - } - return json.Marshal(objectMap) } // SyncSetListIterator provides access to a complete listing of SyncSet values. @@ -1093,8 +2001,6 @@ func NewSyncSetListPage(cur SyncSetList, getNextPage func(context.Context, SyncS // SyncSetProperties syncSetProperties represents the properties of a SyncSet type SyncSetProperties struct { - // ClusterResourceID - The parent Azure Red Hat OpenShift resourceID. - ClusterResourceID *string `json:"clusterResourceId,omitempty"` // Resources - Resources represents the SyncSets configuration. Resources *string `json:"resources,omitempty"` } 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 a8fe2b54e..8190d4fce 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 @@ -56,14 +56,50 @@ type OpenShiftClustersClientAPI interface { var _ OpenShiftClustersClientAPI = (*redhatopenshift.OpenShiftClustersClient)(nil) +// MachinePoolsClientAPI contains the set of methods on the MachinePoolsClient type. +type MachinePoolsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, childResourceName string, parameters redhatopenshift.MachinePool) (result redhatopenshift.MachinePool, err error) + Delete(ctx context.Context, resourceGroupName string, resourceName string, childResourceName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, resourceName string, childResourceName string) (result redhatopenshift.MachinePool, err error) + List(ctx context.Context, resourceGroupName string, resourceName string) (result redhatopenshift.MachinePoolListPage, err error) + ListComplete(ctx context.Context, resourceGroupName string, resourceName string) (result redhatopenshift.MachinePoolListIterator, err error) + Update(ctx context.Context, resourceGroupName string, resourceName string, childResourceName string, parameters redhatopenshift.MachinePoolUpdate) (result redhatopenshift.MachinePool, err error) +} + +var _ MachinePoolsClientAPI = (*redhatopenshift.MachinePoolsClient)(nil) + +// SecretsClientAPI contains the set of methods on the SecretsClient type. +type SecretsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, childResourceName string, parameters redhatopenshift.Secret) (result redhatopenshift.Secret, err error) + Delete(ctx context.Context, resourceGroupName string, resourceName string, childResourceName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, resourceName string, childResourceName string) (result redhatopenshift.Secret, err error) + List(ctx context.Context, resourceGroupName string, resourceName string) (result redhatopenshift.SecretListPage, err error) + ListComplete(ctx context.Context, resourceGroupName string, resourceName string) (result redhatopenshift.SecretListIterator, err error) + Update(ctx context.Context, resourceGroupName string, resourceName string, childResourceName string, parameters redhatopenshift.SecretUpdate) (result redhatopenshift.Secret, err error) +} + +var _ SecretsClientAPI = (*redhatopenshift.SecretsClient)(nil) + +// SyncIdentityProvidersClientAPI contains the set of methods on the SyncIdentityProvidersClient type. +type SyncIdentityProvidersClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, childResourceName string, parameters redhatopenshift.SyncIdentityProvider) (result redhatopenshift.SyncIdentityProvider, err error) + Delete(ctx context.Context, resourceGroupName string, resourceName string, childResourceName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, resourceName string, childResourceName string) (result redhatopenshift.SyncIdentityProvider, err error) + List(ctx context.Context, resourceGroupName string, resourceName string) (result redhatopenshift.SyncIdentityProviderListPage, err error) + ListComplete(ctx context.Context, resourceGroupName string, resourceName string) (result redhatopenshift.SyncIdentityProviderListIterator, err error) + Update(ctx context.Context, resourceGroupName string, resourceName string, childResourceName string, parameters redhatopenshift.SyncIdentityProviderUpdate) (result redhatopenshift.SyncIdentityProvider, err error) +} + +var _ SyncIdentityProvidersClientAPI = (*redhatopenshift.SyncIdentityProvidersClient)(nil) + // SyncSetsClientAPI contains the set of methods on the SyncSetsClient type. type SyncSetsClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, syncSetResourceName string) (result redhatopenshift.SyncSet, err error) - Delete(ctx context.Context, resourceGroupName string, resourceName string, syncSetResourceName string) (result autorest.Response, err error) - Get(ctx context.Context, resourceGroupName string, resourceName string, syncSetResourceName string) (result redhatopenshift.SyncSet, err error) + CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, childResourceName string, parameters redhatopenshift.SyncSet) (result redhatopenshift.SyncSet, err error) + Delete(ctx context.Context, resourceGroupName string, resourceName string, childResourceName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, resourceName string, childResourceName string) (result redhatopenshift.SyncSet, err error) List(ctx context.Context, resourceGroupName string, resourceName string) (result redhatopenshift.SyncSetListPage, err error) ListComplete(ctx context.Context, resourceGroupName string, resourceName string) (result redhatopenshift.SyncSetListIterator, err error) - Update(ctx context.Context, resourceGroupName string, resourceName string, syncSetResourceName string) (result redhatopenshift.SyncSet, err error) + Update(ctx context.Context, resourceGroupName string, resourceName string, childResourceName string, parameters redhatopenshift.SyncSetUpdate) (result redhatopenshift.SyncSet, err error) } var _ SyncSetsClientAPI = (*redhatopenshift.SyncSetsClient)(nil) diff --git a/pkg/client/services/redhatopenshift/mgmt/2022-09-04/redhatopenshift/secrets.go b/pkg/client/services/redhatopenshift/mgmt/2022-09-04/redhatopenshift/secrets.go new file mode 100644 index 000000000..c7293e394 --- /dev/null +++ b/pkg/client/services/redhatopenshift/mgmt/2022-09-04/redhatopenshift/secrets.go @@ -0,0 +1,525 @@ +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" +) + +// SecretsClient is the rest API for Azure Red Hat OpenShift 4 +type SecretsClient struct { + BaseClient +} + +// NewSecretsClient creates an instance of the SecretsClient client. +func NewSecretsClient(subscriptionID string) SecretsClient { + return NewSecretsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSecretsClientWithBaseURI creates an instance of the SecretsClient 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 NewSecretsClientWithBaseURI(baseURI string, subscriptionID string) SecretsClient { + return SecretsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate the operation returns properties of a Secret. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// resourceName - the name of the OpenShift cluster resource. +// childResourceName - the name of the Secret resource. +// parameters - the Secret resource. +func (client SecretsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, childResourceName string, parameters Secret) (result Secret, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecretsClient.CreateOrUpdate") + 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}}}}); err != nil { + return result, validation.NewError("redhatopenshift.SecretsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceName, childResourceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "redhatopenshift.SecretsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "redhatopenshift.SecretsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "redhatopenshift.SecretsClient", "CreateOrUpdate", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client SecretsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, childResourceName string, parameters Secret) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "childResourceName": autorest.Encode("path", childResourceName), + "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.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/secret/{childResourceName}", 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 SecretsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client SecretsClient) CreateOrUpdateResponder(resp *http.Response) (result Secret, 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. +// childResourceName - the name of the Secret resource. +func (client SecretsClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, childResourceName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecretsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.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}}}}); err != nil { + return result, validation.NewError("redhatopenshift.SecretsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName, childResourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "redhatopenshift.SecretsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "redhatopenshift.SecretsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "redhatopenshift.SecretsClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client SecretsClient) DeletePreparer(ctx context.Context, resourceGroupName string, resourceName string, childResourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "childResourceName": autorest.Encode("path", childResourceName), + "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}/secret/{childResourceName}", 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 SecretsClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client SecretsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get the operation returns properties of a Secret. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// resourceName - the name of the OpenShift cluster resource. +// childResourceName - the name of the Secret resource. +func (client SecretsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, childResourceName string) (result Secret, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecretsClient.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}}}}); err != nil { + return result, validation.NewError("redhatopenshift.SecretsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, resourceName, childResourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "redhatopenshift.SecretsClient", "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.SecretsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "redhatopenshift.SecretsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client SecretsClient) GetPreparer(ctx context.Context, resourceGroupName string, resourceName string, childResourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "childResourceName": autorest.Encode("path", childResourceName), + "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}/secret/{childResourceName}", 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 SecretsClient) 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 SecretsClient) GetResponder(resp *http.Response) (result Secret, 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 Secret. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// resourceName - the name of the OpenShift cluster resource. +func (client SecretsClient) List(ctx context.Context, resourceGroupName string, resourceName string) (result SecretListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecretsClient.List") + defer func() { + sc := -1 + if result.sl.Response.Response != nil { + sc = result.sl.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}}}}); err != nil { + return result, validation.NewError("redhatopenshift.SecretsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "redhatopenshift.SecretsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.sl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "redhatopenshift.SecretsClient", "List", resp, "Failure sending request") + return + } + + result.sl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "redhatopenshift.SecretsClient", "List", resp, "Failure responding to request") + return + } + if result.sl.hasNextLink() && result.sl.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client SecretsClient) ListPreparer(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/openShiftCluster/{resourceName}/secrets", 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 SecretsClient) 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 SecretsClient) ListResponder(resp *http.Response) (result SecretList, 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 SecretsClient) listNextResults(ctx context.Context, lastResults SecretList) (result SecretList, err error) { + req, err := lastResults.secretListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "redhatopenshift.SecretsClient", "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.SecretsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "redhatopenshift.SecretsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client SecretsClient) ListComplete(ctx context.Context, resourceGroupName string, resourceName string) (result SecretListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecretsClient.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, resourceGroupName, resourceName) + return +} + +// Update the operation returns properties of a Secret. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// resourceName - the name of the OpenShift cluster resource. +// childResourceName - the name of the Secret resource. +// parameters - the Secret resource. +func (client SecretsClient) Update(ctx context.Context, resourceGroupName string, resourceName string, childResourceName string, parameters SecretUpdate) (result Secret, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecretsClient.Update") + 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}}}}); err != nil { + return result, validation.NewError("redhatopenshift.SecretsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, resourceName, childResourceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "redhatopenshift.SecretsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "redhatopenshift.SecretsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "redhatopenshift.SecretsClient", "Update", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client SecretsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, childResourceName string, parameters SecretUpdate) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "childResourceName": autorest.Encode("path", childResourceName), + "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}/secret/{childResourceName}", 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 SecretsClient) UpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client SecretsClient) UpdateResponder(resp *http.Response) (result Secret, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/pkg/client/services/redhatopenshift/mgmt/2022-09-04/redhatopenshift/syncidentityproviders.go b/pkg/client/services/redhatopenshift/mgmt/2022-09-04/redhatopenshift/syncidentityproviders.go new file mode 100644 index 000000000..c629da2e6 --- /dev/null +++ b/pkg/client/services/redhatopenshift/mgmt/2022-09-04/redhatopenshift/syncidentityproviders.go @@ -0,0 +1,526 @@ +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" +) + +// SyncIdentityProvidersClient is the rest API for Azure Red Hat OpenShift 4 +type SyncIdentityProvidersClient struct { + BaseClient +} + +// NewSyncIdentityProvidersClient creates an instance of the SyncIdentityProvidersClient client. +func NewSyncIdentityProvidersClient(subscriptionID string) SyncIdentityProvidersClient { + return NewSyncIdentityProvidersClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSyncIdentityProvidersClientWithBaseURI creates an instance of the SyncIdentityProvidersClient 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 NewSyncIdentityProvidersClientWithBaseURI(baseURI string, subscriptionID string) SyncIdentityProvidersClient { + return SyncIdentityProvidersClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate the operation returns properties of a SyncIdentityProvider. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// resourceName - the name of the OpenShift cluster resource. +// childResourceName - the name of the SyncIdentityProvider resource. +// parameters - the SyncIdentityProvider resource. +func (client SyncIdentityProvidersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, childResourceName string, parameters SyncIdentityProvider) (result SyncIdentityProvider, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SyncIdentityProvidersClient.CreateOrUpdate") + 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}}}}); err != nil { + return result, validation.NewError("redhatopenshift.SyncIdentityProvidersClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceName, childResourceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "redhatopenshift.SyncIdentityProvidersClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "redhatopenshift.SyncIdentityProvidersClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "redhatopenshift.SyncIdentityProvidersClient", "CreateOrUpdate", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client SyncIdentityProvidersClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, childResourceName string, parameters SyncIdentityProvider) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "childResourceName": autorest.Encode("path", childResourceName), + "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.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/syncIdentityProvider/{childResourceName}", 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 SyncIdentityProvidersClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client SyncIdentityProvidersClient) CreateOrUpdateResponder(resp *http.Response) (result SyncIdentityProvider, 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. +// childResourceName - the name of the SyncIdentityProvider resource. +func (client SyncIdentityProvidersClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, childResourceName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SyncIdentityProvidersClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.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}}}}); err != nil { + return result, validation.NewError("redhatopenshift.SyncIdentityProvidersClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName, childResourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "redhatopenshift.SyncIdentityProvidersClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "redhatopenshift.SyncIdentityProvidersClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "redhatopenshift.SyncIdentityProvidersClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client SyncIdentityProvidersClient) DeletePreparer(ctx context.Context, resourceGroupName string, resourceName string, childResourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "childResourceName": autorest.Encode("path", childResourceName), + "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}/syncIdentityProvider/{childResourceName}", 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 SyncIdentityProvidersClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client SyncIdentityProvidersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get the operation returns properties of a SyncIdentityProvider. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// resourceName - the name of the OpenShift cluster resource. +// childResourceName - the name of the SyncIdentityProvider resource. +func (client SyncIdentityProvidersClient) Get(ctx context.Context, resourceGroupName string, resourceName string, childResourceName string) (result SyncIdentityProvider, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SyncIdentityProvidersClient.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}}}}); err != nil { + return result, validation.NewError("redhatopenshift.SyncIdentityProvidersClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, resourceName, childResourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "redhatopenshift.SyncIdentityProvidersClient", "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.SyncIdentityProvidersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "redhatopenshift.SyncIdentityProvidersClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client SyncIdentityProvidersClient) GetPreparer(ctx context.Context, resourceGroupName string, resourceName string, childResourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "childResourceName": autorest.Encode("path", childResourceName), + "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}/syncIdentityProvider/{childResourceName}", 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 SyncIdentityProvidersClient) 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 SyncIdentityProvidersClient) GetResponder(resp *http.Response) (result SyncIdentityProvider, 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 SyncIdentityProvider. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// resourceName - the name of the OpenShift cluster resource. +func (client SyncIdentityProvidersClient) List(ctx context.Context, resourceGroupName string, resourceName string) (result SyncIdentityProviderListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SyncIdentityProvidersClient.List") + defer func() { + sc := -1 + if result.sipl.Response.Response != nil { + sc = result.sipl.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}}}}); err != nil { + return result, validation.NewError("redhatopenshift.SyncIdentityProvidersClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "redhatopenshift.SyncIdentityProvidersClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.sipl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "redhatopenshift.SyncIdentityProvidersClient", "List", resp, "Failure sending request") + return + } + + result.sipl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "redhatopenshift.SyncIdentityProvidersClient", "List", resp, "Failure responding to request") + return + } + if result.sipl.hasNextLink() && result.sipl.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client SyncIdentityProvidersClient) ListPreparer(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/openShiftCluster/{resourceName}/syncIdentityProviders", 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 SyncIdentityProvidersClient) 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 SyncIdentityProvidersClient) ListResponder(resp *http.Response) (result SyncIdentityProviderList, 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 SyncIdentityProvidersClient) listNextResults(ctx context.Context, lastResults SyncIdentityProviderList) (result SyncIdentityProviderList, err error) { + req, err := lastResults.syncIdentityProviderListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "redhatopenshift.SyncIdentityProvidersClient", "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.SyncIdentityProvidersClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "redhatopenshift.SyncIdentityProvidersClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client SyncIdentityProvidersClient) ListComplete(ctx context.Context, resourceGroupName string, resourceName string) (result SyncIdentityProviderListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SyncIdentityProvidersClient.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, resourceGroupName, resourceName) + return +} + +// Update the operation returns properties of a SyncIdentityProvider. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// resourceName - the name of the OpenShift cluster resource. +// childResourceName - the name of the SyncIdentityProvider resource. +// parameters - the SyncIdentityProvider resource. +func (client SyncIdentityProvidersClient) Update(ctx context.Context, resourceGroupName string, resourceName string, childResourceName string, parameters SyncIdentityProviderUpdate) (result SyncIdentityProvider, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SyncIdentityProvidersClient.Update") + 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}}}}); err != nil { + return result, validation.NewError("redhatopenshift.SyncIdentityProvidersClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, resourceName, childResourceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "redhatopenshift.SyncIdentityProvidersClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "redhatopenshift.SyncIdentityProvidersClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "redhatopenshift.SyncIdentityProvidersClient", "Update", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client SyncIdentityProvidersClient) UpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, childResourceName string, parameters SyncIdentityProviderUpdate) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "childResourceName": autorest.Encode("path", childResourceName), + "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}/syncIdentityProvider/{childResourceName}", 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 SyncIdentityProvidersClient) UpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client SyncIdentityProvidersClient) UpdateResponder(resp *http.Response) (result SyncIdentityProvider, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/pkg/client/services/redhatopenshift/mgmt/2022-09-04/redhatopenshift/syncsets.go b/pkg/client/services/redhatopenshift/mgmt/2022-09-04/redhatopenshift/syncsets.go index 17d9fb57f..856f90ffb 100644 --- a/pkg/client/services/redhatopenshift/mgmt/2022-09-04/redhatopenshift/syncsets.go +++ b/pkg/client/services/redhatopenshift/mgmt/2022-09-04/redhatopenshift/syncsets.go @@ -47,8 +47,9 @@ func NewSyncSetsClientWithBaseURI(baseURI string, subscriptionID string) SyncSet // Parameters: // resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the OpenShift cluster resource. -// syncSetResourceName - the name of the SyncSet resource. -func (client SyncSetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, syncSetResourceName string) (result SyncSet, err error) { +// childResourceName - the name of the SyncSet resource. +// parameters - the SyncSet resource. +func (client SyncSetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, childResourceName string, parameters SyncSet) (result SyncSet, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/SyncSetsClient.CreateOrUpdate") defer func() { @@ -68,7 +69,7 @@ func (client SyncSetsClient) CreateOrUpdate(ctx context.Context, resourceGroupNa return result, validation.NewError("redhatopenshift.SyncSetsClient", "CreateOrUpdate", err.Error()) } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceName, syncSetResourceName) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceName, childResourceName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "redhatopenshift.SyncSetsClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -91,12 +92,12 @@ func (client SyncSetsClient) CreateOrUpdate(ctx context.Context, resourceGroupNa } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client SyncSetsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, syncSetResourceName string) (*http.Request, error) { +func (client SyncSetsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, childResourceName string, parameters SyncSet) (*http.Request, error) { pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "resourceName": autorest.Encode("path", resourceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "syncSetResourceName": autorest.Encode("path", syncSetResourceName), + "childResourceName": autorest.Encode("path", childResourceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2022-09-04" @@ -105,9 +106,11 @@ func (client SyncSetsClient) CreateOrUpdatePreparer(ctx context.Context, resourc } 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}/syncSet/{syncSetResourceName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/syncSet/{childResourceName}", pathParameters), + autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -134,8 +137,8 @@ func (client SyncSetsClient) CreateOrUpdateResponder(resp *http.Response) (resul // Parameters: // resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the OpenShift cluster resource. -// syncSetResourceName - the name of the SyncSet resource. -func (client SyncSetsClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, syncSetResourceName string) (result autorest.Response, err error) { +// childResourceName - the name of the SyncSet resource. +func (client SyncSetsClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, childResourceName string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/SyncSetsClient.Delete") defer func() { @@ -155,7 +158,7 @@ func (client SyncSetsClient) Delete(ctx context.Context, resourceGroupName strin return result, validation.NewError("redhatopenshift.SyncSetsClient", "Delete", err.Error()) } - req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName, syncSetResourceName) + req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName, childResourceName) if err != nil { err = autorest.NewErrorWithError(err, "redhatopenshift.SyncSetsClient", "Delete", nil, "Failure preparing request") return @@ -178,12 +181,12 @@ func (client SyncSetsClient) Delete(ctx context.Context, resourceGroupName strin } // DeletePreparer prepares the Delete request. -func (client SyncSetsClient) DeletePreparer(ctx context.Context, resourceGroupName string, resourceName string, syncSetResourceName string) (*http.Request, error) { +func (client SyncSetsClient) DeletePreparer(ctx context.Context, resourceGroupName string, resourceName string, childResourceName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "resourceName": autorest.Encode("path", resourceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "syncSetResourceName": autorest.Encode("path", syncSetResourceName), + "childResourceName": autorest.Encode("path", childResourceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2022-09-04" @@ -194,7 +197,7 @@ func (client SyncSetsClient) DeletePreparer(ctx context.Context, resourceGroupNa preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/syncSet/{syncSetResourceName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/syncSet/{childResourceName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -210,7 +213,7 @@ func (client SyncSetsClient) DeleteSender(req *http.Request) (*http.Response, er func (client SyncSetsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp return @@ -220,8 +223,8 @@ func (client SyncSetsClient) DeleteResponder(resp *http.Response) (result autore // Parameters: // resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the OpenShift cluster resource. -// syncSetResourceName - the name of the SyncSet resource. -func (client SyncSetsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, syncSetResourceName string) (result SyncSet, err error) { +// childResourceName - the name of the SyncSet resource. +func (client SyncSetsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, childResourceName string) (result SyncSet, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/SyncSetsClient.Get") defer func() { @@ -241,7 +244,7 @@ func (client SyncSetsClient) Get(ctx context.Context, resourceGroupName string, return result, validation.NewError("redhatopenshift.SyncSetsClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, resourceGroupName, resourceName, syncSetResourceName) + req, err := client.GetPreparer(ctx, resourceGroupName, resourceName, childResourceName) if err != nil { err = autorest.NewErrorWithError(err, "redhatopenshift.SyncSetsClient", "Get", nil, "Failure preparing request") return @@ -264,12 +267,12 @@ func (client SyncSetsClient) Get(ctx context.Context, resourceGroupName string, } // GetPreparer prepares the Get request. -func (client SyncSetsClient) GetPreparer(ctx context.Context, resourceGroupName string, resourceName string, syncSetResourceName string) (*http.Request, error) { +func (client SyncSetsClient) GetPreparer(ctx context.Context, resourceGroupName string, resourceName string, childResourceName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "resourceName": autorest.Encode("path", resourceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "syncSetResourceName": autorest.Encode("path", syncSetResourceName), + "childResourceName": autorest.Encode("path", childResourceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2022-09-04" @@ -280,7 +283,7 @@ func (client SyncSetsClient) GetPreparer(ctx context.Context, resourceGroupName preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/syncSet/{syncSetResourceName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/syncSet/{childResourceName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -434,8 +437,9 @@ func (client SyncSetsClient) ListComplete(ctx context.Context, resourceGroupName // Parameters: // resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the OpenShift cluster resource. -// syncSetResourceName - the name of the SyncSet resource. -func (client SyncSetsClient) Update(ctx context.Context, resourceGroupName string, resourceName string, syncSetResourceName string) (result SyncSet, err error) { +// childResourceName - the name of the SyncSet resource. +// parameters - the SyncSet resource. +func (client SyncSetsClient) Update(ctx context.Context, resourceGroupName string, resourceName string, childResourceName string, parameters SyncSetUpdate) (result SyncSet, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/SyncSetsClient.Update") defer func() { @@ -455,7 +459,7 @@ func (client SyncSetsClient) Update(ctx context.Context, resourceGroupName strin return result, validation.NewError("redhatopenshift.SyncSetsClient", "Update", err.Error()) } - req, err := client.UpdatePreparer(ctx, resourceGroupName, resourceName, syncSetResourceName) + req, err := client.UpdatePreparer(ctx, resourceGroupName, resourceName, childResourceName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "redhatopenshift.SyncSetsClient", "Update", nil, "Failure preparing request") return @@ -478,12 +482,12 @@ func (client SyncSetsClient) Update(ctx context.Context, resourceGroupName strin } // UpdatePreparer prepares the Update request. -func (client SyncSetsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, syncSetResourceName string) (*http.Request, error) { +func (client SyncSetsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, childResourceName string, parameters SyncSetUpdate) (*http.Request, error) { pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "resourceName": autorest.Encode("path", resourceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "syncSetResourceName": autorest.Encode("path", syncSetResourceName), + "childResourceName": autorest.Encode("path", childResourceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2022-09-04" @@ -491,10 +495,13 @@ func (client SyncSetsClient) UpdatePreparer(ctx context.Context, resourceGroupNa "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}/syncSet/{syncSetResourceName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/syncSet/{childResourceName}", pathParameters), + autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } diff --git a/pkg/frontend/clustermanager_delete.go b/pkg/frontend/clustermanager_delete.go index b2148541c..20cb5280f 100644 --- a/pkg/frontend/clustermanager_delete.go +++ b/pkg/frontend/clustermanager_delete.go @@ -19,7 +19,7 @@ func (f *frontend) deleteClusterManagerConfiguration(w http.ResponseWriter, r *h ctx := r.Context() log := ctx.Value(middleware.ContextKeyLog).(*logrus.Entry) - if DISABLEOCMAPI { + if disableOCMAPI { reply(log, w, nil, []byte("forbidden."), api.NewCloudError(http.StatusForbidden, api.CloudErrorCodeForbidden, "", "forbidden.")) return } diff --git a/pkg/frontend/clustermanager_get.go b/pkg/frontend/clustermanager_get.go index 4356018ab..7cbbf65d3 100644 --- a/pkg/frontend/clustermanager_get.go +++ b/pkg/frontend/clustermanager_get.go @@ -21,12 +21,12 @@ func (f *frontend) getClusterManagerConfiguration(w http.ResponseWriter, r *http log := ctx.Value(middleware.ContextKeyLog).(*logrus.Entry) vars := mux.Vars(r) - if DISABLEOCMAPI { + if disableOCMAPI { reply(log, w, nil, []byte("forbidden."), api.NewCloudError(http.StatusForbidden, api.CloudErrorCodeForbidden, "", "forbidden.")) return } - b, err := f._getClusterManagerConfiguration(ctx, log, r, f.apis[vars["api-version"]].ClusterManagerConfigurationConverter()) + b, err := f._getClusterManagerConfiguration(ctx, log, r, f.apis[vars["api-version"]].ClusterManagerConfigurationConverter) reply(log, w, nil, b, err) } diff --git a/pkg/frontend/clustermanager_putorpatch.go b/pkg/frontend/clustermanager_putorpatch.go index 29089a1b4..f6b2e7d48 100644 --- a/pkg/frontend/clustermanager_putorpatch.go +++ b/pkg/frontend/clustermanager_putorpatch.go @@ -25,14 +25,14 @@ func (f *frontend) putOrPatchClusterManagerConfiguration(w http.ResponseWriter, var header http.Header var b []byte - if DISABLEOCMAPI { + if disableOCMAPI { reply(log, w, nil, []byte("forbidden."), api.NewCloudError(http.StatusForbidden, api.CloudErrorCodeForbidden, "", "forbidden.")) return } err := cosmosdb.RetryOnPreconditionFailed(func() error { var err error - b, err = f._putOrPatchClusterManagerConfiguration(ctx, log, r, &header, f.apis[vars["api-version"]].ClusterManagerConfigurationConverter()) + b, err = f._putOrPatchClusterManagerConfiguration(ctx, log, r, &header, f.apis[vars["api-version"]].ClusterManagerConfigurationConverter) return err }) @@ -42,8 +42,7 @@ func (f *frontend) putOrPatchClusterManagerConfiguration(w http.ResponseWriter, func (f *frontend) _putOrPatchClusterManagerConfiguration(ctx context.Context, log *logrus.Entry, r *http.Request, header *http.Header, converter api.ClusterManagerConfigurationConverter) ([]byte, error) { body := r.Context().Value(middleware.ContextKeyBody).([]byte) correlationData := r.Context().Value(middleware.ContextKeyCorrelationData).(*api.CorrelationData) - // TODO implement systemdata - // systemData, _ := r.Context().Value(middleware.ContextKeySystemData).(*api.SystemData) // don't panic + systemData, _ := r.Context().Value(middleware.ContextKeySystemData).(*api.SystemData) // don't panic _, err := f.validateSubscriptionState(ctx, r.URL.Path, api.SubscriptionStateRegistered) if err != nil { @@ -80,7 +79,7 @@ func (f *frontend) _putOrPatchClusterManagerConfiguration(ctx context.Context, l ClusterManagerConfiguration: &api.ClusterManagerConfiguration{ ID: originalPath, Name: armResource.SubResource.ResourceName, - ClusterResourceId: clusterURL, + ClusterResourceID: clusterURL, Properties: api.ClusterManagerConfigurationProperties{ Resources: body, }, @@ -100,7 +99,7 @@ func (f *frontend) _putOrPatchClusterManagerConfiguration(ctx context.Context, l ocmdoc.CorrelationData = correlationData - // f.systemDataClusterManagerConfigurationEnricher(ocmdoc, systemData) + f.systemDataClusterManagerEnricher(ocmdoc, systemData) ocmdoc, err = f.dbClusterManagerConfiguration.Update(ctx, ocmdoc) if err != nil { return nil, err @@ -118,26 +117,26 @@ func (f *frontend) _putOrPatchClusterManagerConfiguration(ctx context.Context, l // enrichClusterManagerSystemData will selectively overwrite systemData fields based on // arm inputs -// func enrichSyncSetSystemData(doc *api.ClusterManagerConfigurationDocument, systemData *api.SystemData) { -// if systemData == nil { -// return -// } -// if systemData.CreatedAt != nil { -// doc.SyncSet.SystemData.CreatedAt = systemData.CreatedAt -// } -// if systemData.CreatedBy != "" { -// doc.SyncSet.SystemData.CreatedBy = systemData.CreatedBy -// } -// if systemData.CreatedByType != "" { -// doc.SyncSet.SystemData.CreatedByType = systemData.CreatedByType -// } -// if systemData.LastModifiedAt != nil { -// doc.SyncSet.SystemData.LastModifiedAt = systemData.LastModifiedAt -// } -// if systemData.LastModifiedBy != "" { -// doc.SyncSet.SystemData.LastModifiedBy = systemData.LastModifiedBy -// } -// if systemData.LastModifiedByType != "" { -// doc.SyncSet.SystemData.LastModifiedByType = systemData.LastModifiedByType -// } -// } +func enrichClusterManagerSystemData(doc *api.ClusterManagerConfigurationDocument, systemData *api.SystemData) { + if systemData == nil { + return + } + if systemData.CreatedAt != nil { + doc.ClusterManagerConfiguration.SystemData.CreatedAt = systemData.CreatedAt + } + if systemData.CreatedBy != "" { + doc.ClusterManagerConfiguration.SystemData.CreatedBy = systemData.CreatedBy + } + if systemData.CreatedByType != "" { + doc.ClusterManagerConfiguration.SystemData.CreatedByType = systemData.CreatedByType + } + if systemData.LastModifiedAt != nil { + doc.ClusterManagerConfiguration.SystemData.LastModifiedAt = systemData.LastModifiedAt + } + if systemData.LastModifiedBy != "" { + doc.ClusterManagerConfiguration.SystemData.LastModifiedBy = systemData.LastModifiedBy + } + if systemData.LastModifiedByType != "" { + doc.ClusterManagerConfiguration.SystemData.LastModifiedByType = systemData.LastModifiedByType + } +} diff --git a/pkg/frontend/frontend.go b/pkg/frontend/frontend.go index fe7b9f4f3..568c089e5 100644 --- a/pkg/frontend/frontend.go +++ b/pkg/frontend/frontend.go @@ -32,7 +32,9 @@ import ( "github.com/Azure/ARO-RP/pkg/util/recover" ) -const DISABLEOCMAPI = true +// TODO this const was put in place to disable the ocm routes +// once we are ready to begin testing we can remove this bool and related code +const disableOCMAPI = true type statusCodeError int @@ -75,8 +77,9 @@ type frontend struct { ready atomic.Value // these helps us to test and mock easier - now func() time.Time - systemDataClusterDocEnricher func(*api.OpenShiftClusterDocument, *api.SystemData) + now func() time.Time + systemDataClusterDocEnricher func(*api.OpenShiftClusterDocument, *api.SystemData) + systemDataClusterManagerEnricher func(*api.ClusterManagerConfigurationDocument, *api.SystemData) } // Runnable represents a runnable object @@ -120,8 +123,9 @@ func NewFrontend(ctx context.Context, startTime: time.Now(), - now: time.Now, - systemDataClusterDocEnricher: enrichClusterSystemData, + now: time.Now, + systemDataClusterDocEnricher: enrichClusterSystemData, + systemDataClusterManagerEnricher: enrichClusterManagerSystemData, } l, err := f.env.Listen() diff --git a/pkg/swagger/examples.go b/pkg/swagger/examples.go index ebf22f80e..c25e4eb6f 100644 --- a/pkg/swagger/examples.go +++ b/pkg/swagger/examples.go @@ -66,9 +66,10 @@ func (g *generator) generateExamples(outputDir string, s *Swagger) error { Name: param.Name, Parameter: "resourceName", }) + case "childResourceName": example.Parameters = append(example.Parameters, NameParameter{ - Name: "syncSetResourceName", - Parameter: "syncSetResourceName", + Name: "childResourceName", + Parameter: "childResourceName", }) case "parameters": switch param.Schema.Ref { @@ -82,16 +83,46 @@ func (g *generator) generateExamples(outputDir string, s *Swagger) error { Name: param.Name, Parameter: g.exampleOpenShiftClusterPatchParameter(), }) - case "#/definitions/Syncset": + case "#/definitions/SyncSet": example.Parameters = append(example.Parameters, NameParameter{ Name: param.Name, Parameter: g.exampleSyncSetPutParameter(), }) - case "#/definitions/SyncsetUpdate": + case "#/definitions/SyncSetUpdate": example.Parameters = append(example.Parameters, NameParameter{ Name: param.Name, Parameter: g.exampleSyncSetPatchParameter(), }) + case "#/definitions/MachinePool": + example.Parameters = append(example.Parameters, NameParameter{ + Name: param.Name, + Parameter: g.exampleMachinePoolPutParameter(), + }) + case "#/definitions/MachinePoolUpdate": + example.Parameters = append(example.Parameters, NameParameter{ + Name: param.Name, + Parameter: g.exampleMachinePoolPatchParameter(), + }) + case "#/definitions/SyncIdentityProvider": + example.Parameters = append(example.Parameters, NameParameter{ + Name: param.Name, + Parameter: g.exampleSyncIdentityProviderPutParameter(), + }) + case "#/definitions/SyncIdentityProviderUpdate": + example.Parameters = append(example.Parameters, NameParameter{ + Name: param.Name, + Parameter: g.exampleSyncIdentityProviderPatchParameter(), + }) + case "#/definitions/Secret": + example.Parameters = append(example.Parameters, NameParameter{ + Name: param.Name, + Parameter: g.exampleSecretPutParameter(), + }) + case "#/definitions/SecretUpdate": + example.Parameters = append(example.Parameters, NameParameter{ + Name: param.Name, + Parameter: g.exampleSecretPatchParameter(), + }) } } } @@ -111,6 +142,18 @@ func (g *generator) generateExamples(outputDir string, s *Swagger) error { body = g.exampleSyncSetResponse() case "#/definitions/SyncSetList": body = g.exampleSyncSetListResponse() + case "#/definitions/MachinePool": + body = g.exampleSyncSetResponse() + case "#/definitions/MachinePoolList": + body = g.exampleSyncSetListResponse() + case "#/definitions/SyncIdentityProvider": + body = g.exampleSyncSetResponse() + case "#/definitions/SyncIdentityProviderList": + body = g.exampleSyncSetListResponse() + case "#/definitions/Secret": + body = g.exampleSecretResponse() + case "#/definitions/SecretList": + body = g.exampleSecretListResponse() case "#/definitions/OpenShiftCluster": body = g.exampleOpenShiftClusterResponse() case "#/definitions/OpenShiftClusterCredentials": diff --git a/pkg/swagger/generator.go b/pkg/swagger/generator.go index 4babdd868..b428c3b8a 100644 --- a/pkg/swagger/generator.go +++ b/pkg/swagger/generator.go @@ -23,6 +23,18 @@ type generator struct { exampleSyncSetPatchParameter func() interface{} exampleSyncSetResponse func() interface{} exampleSyncSetListResponse func() interface{} + exampleMachinePoolPutParameter func() interface{} + exampleMachinePoolPatchParameter func() interface{} + exampleMachinePoolResponse func() interface{} + exampleMachinePoolListResponse func() interface{} + exampleSyncIdentityProviderPutParameter func() interface{} + exampleSyncIdentityProviderPatchParameter func() interface{} + exampleSyncIdentityProviderResponse func() interface{} + exampleSyncIdentityProviderListResponse func() interface{} + exampleSecretPutParameter func() interface{} + exampleSecretPatchParameter func() interface{} + exampleSecretResponse func() interface{} + exampleSecretListResponse func() interface{} exampleOpenShiftClusterPutParameter func() interface{} exampleOpenShiftClusterPatchParameter func() interface{} exampleOpenShiftClusterResponse func() interface{} @@ -90,6 +102,18 @@ var apis = map[string]*generator{ exampleSyncSetPatchParameter: v20220904.ExampleSyncSetPatchParameter, exampleSyncSetResponse: v20220904.ExampleSyncSetResponse, exampleSyncSetListResponse: v20220904.ExampleSyncSetListResponse, + exampleMachinePoolPutParameter: v20220904.ExampleMachinePoolPutParameter, + exampleMachinePoolPatchParameter: v20220904.ExampleMachinePoolPatchParameter, + exampleMachinePoolResponse: v20220904.ExampleMachinePoolResponse, + exampleMachinePoolListResponse: v20220904.ExampleMachinePoolListResponse, + exampleSyncIdentityProviderPutParameter: v20220904.ExampleSyncIdentityProviderPutParameter, + exampleSyncIdentityProviderPatchParameter: v20220904.ExampleSyncIdentityProviderPatchParameter, + exampleSyncIdentityProviderResponse: v20220904.ExampleSyncIdentityProviderResponse, + exampleSyncIdentityProviderListResponse: v20220904.ExampleSyncIdentityProviderListResponse, + exampleSecretPutParameter: v20220904.ExampleSecretPutParameter, + exampleSecretPatchParameter: v20220904.ExampleSecretPatchParameter, + exampleSecretResponse: v20220904.ExampleSecretResponse, + exampleSecretListResponse: v20220904.ExampleSecretListResponse, exampleOpenShiftClusterPutParameter: v20220904.ExampleOpenShiftClusterPutParameter, exampleOpenShiftClusterPatchParameter: v20220904.ExampleOpenShiftClusterPatchParameter, exampleOpenShiftClusterResponse: v20220904.ExampleOpenShiftClusterResponse, @@ -100,7 +124,7 @@ var apis = map[string]*generator{ exampleOperationListResponse: api.ExampleOperationListResponse, xmsEnum: []string{"EncryptionAtHost", "FipsValidatedModules", "SoftwareDefinedNetwork", "Visibility"}, - xmsSecretList: []string{"kubeconfig", "kubeadminPassword"}, + xmsSecretList: []string{"kubeconfig", "kubeadminPassword", "secretResources"}, xmsIdentifiers: []string{}, commonTypesVersion: "v3", systemData: true, diff --git a/pkg/swagger/paths.go b/pkg/swagger/paths.go index f70cb326e..294c2c8d5 100644 --- a/pkg/swagger/paths.go +++ b/pkg/swagger/paths.go @@ -52,7 +52,7 @@ func (g *generator) populateParameters(n int, typ, friendlyName string) (s []int if n > 2 { temp := friendlyName - if temp == "SyncSet" { + if contains(proxyResources, temp) { temp = "OpenShift cluster" } s = append(s, Parameter{ @@ -70,16 +70,17 @@ func (g *generator) populateParameters(n int, typ, friendlyName string) (s []int // except when n==10, then its not a required parameter if n >= 7 && n != 10 { s = append(s, Parameter{ - Name: "syncSetResourceName", + Name: "childResourceName", In: "path", Description: "The name of the " + friendlyName + " resource.", Required: true, Type: "string", }) - return } - if n > 3 && n != 10 { + // TODO: refactor this entire function to make sense + // so we can stop thinking about what int value builds a proper swagger parameter + if n > 3 && n != 7 && n != 10 { s = append(s, Parameter{ Name: "parameters", In: "body", @@ -91,7 +92,7 @@ func (g *generator) populateParameters(n int, typ, friendlyName string) (s []int }) } - if n > 4 && friendlyName != "SyncSet" { + if n == 5 || n == 9 { s[len(s)-1].(Parameter).Schema.Ref += "Update" } return @@ -127,7 +128,7 @@ func (g *generator) populateResponses(typ string, isDelete bool, statusCodes ... return } -// populateChildResourcePaths populates the paths for a child resource of a top level ARM resource +// populateChildResourcePaths populates the paths for a child resource of a top level ARM resoure with list and CRUD operations defined for the path item func (g *generator) populateChildResourcePaths(ps Paths, resourceProviderNamespace string, resourceType string, childResourceType string, friendlyName string) { titleCaser := cases.Title(language.Und, cases.NoLower) ps["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/"+resourceProviderNamespace+"/"+resourceType+"/{resourceName}/"+childResourceType+"s"] = &PathItem{ @@ -136,14 +137,14 @@ func (g *generator) populateChildResourcePaths(ps Paths, resourceProviderNamespa Summary: "Lists " + friendlyName + "s that belong to that Azure Red Hat OpenShift Cluster.", Description: "The operation returns properties of each " + friendlyName + ".", OperationID: titleCaser.String(childResourceType) + "s_List", - Parameters: g.populateParameters(10, titleCaser.String(childResourceType), friendlyName), + Parameters: g.populateParameters(3, titleCaser.String(childResourceType), friendlyName), Responses: g.populateResponses(titleCaser.String(childResourceType)+"List", false, http.StatusOK), Pageable: &Pageable{ NextLinkName: "nextLink", }, }, } - ps["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/syncSet/{syncSetResourceName}"] = &PathItem{ + ps["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/"+childResourceType+"/{childResourceName}"] = &PathItem{ Get: &Operation{ Tags: []string{titleCaser.String(childResourceType) + "s"}, Summary: "Gets a " + friendlyName + " with the specified subscription, resource group and resource name.", @@ -166,11 +167,11 @@ func (g *generator) populateChildResourcePaths(ps Paths, resourceProviderNamespa Description: "The operation returns nothing.", OperationID: titleCaser.String(childResourceType) + "s_Delete", Parameters: g.populateParameters(7, titleCaser.String(childResourceType), friendlyName), - Responses: g.populateResponses(titleCaser.String(childResourceType), true, http.StatusAccepted, http.StatusNoContent), + Responses: g.populateResponses(titleCaser.String(childResourceType), true, http.StatusOK, http.StatusNoContent), }, Patch: &Operation{ Tags: []string{titleCaser.String(childResourceType) + "s"}, - Summary: "Creates or updates a " + friendlyName + " with the specified subscription, resource group and resource name.", + Summary: "Patches (create or update) a " + friendlyName + " with the specified subscription, resource group and resource name.", Description: "The operation returns properties of a " + friendlyName + ".", OperationID: titleCaser.String(childResourceType) + "s_Update", Parameters: g.populateParameters(9, titleCaser.String(childResourceType), friendlyName), @@ -180,7 +181,7 @@ func (g *generator) populateChildResourcePaths(ps Paths, resourceProviderNamespa } // populateTopLevelPaths populates the paths for a top level ARM resource -func (g *generator) populateTopLevelPaths(resourceProviderNamespace string, resourceType string, friendlyName string) (ps Paths) { +func (g *generator) populateTopLevelPaths(resourceProviderNamespace, resourceType, friendlyName string) (ps Paths) { titleCaser := cases.Title(language.Und, cases.NoLower) ps = Paths{} diff --git a/pkg/swagger/swagger.go b/pkg/swagger/swagger.go index 87da4f1fa..e55ac8acc 100644 --- a/pkg/swagger/swagger.go +++ b/pkg/swagger/swagger.go @@ -12,8 +12,18 @@ import ( "github.com/Azure/ARO-RP/pkg/util/stringutils" ) +// resourceName represents the tracked resource, OpenShiftCluster var resourceName = "OpenShiftCluster" +// proxyResources represent the list of proxy resources - these are resources with operations, but do not exist in the Azure Portal +// https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/proxy-api-reference.md +var proxyResources = []string{ + "SyncSet", + "SyncIdentityProvider", + "MachinePool", + "Secret", +} + func Run(api, outputDir string) error { g, err := New(api) if err != nil { @@ -51,6 +61,20 @@ func Run(api, outputDir string) error { }, } + s.Paths["/providers/Microsoft.RedHatOpenShift/operations"] = &PathItem{ + Get: &Operation{ + Tags: []string{"Operations"}, + Summary: "Lists all of the available RP operations.", + Description: "The operation returns the RP operations.", + OperationID: "Operations_List", + Parameters: g.populateParameters(0, "Operation", "Operation"), + Responses: g.populateResponses("OperationList", false, http.StatusOK), + Pageable: &Pageable{ + NextLinkName: "nextLink", + }, + }, + } + s.Paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openShiftClusters/{resourceName}/listCredentials"] = &PathItem{ Post: &Operation{ Tags: []string{"OpenShiftClusters"}, @@ -75,20 +99,6 @@ func Run(api, outputDir string) error { } } - s.Paths["/providers/Microsoft.RedHatOpenShift/operations"] = &PathItem{ - Get: &Operation{ - Tags: []string{"Operations"}, - Summary: "Lists all of the available RP operations.", - Description: "The operation returns the RP operations.", - OperationID: "Operations_List", - Parameters: g.populateParameters(0, "Operation", "Operation"), - Responses: g.populateResponses("OperationList", false, http.StatusOK), - Pageable: &Pageable{ - NextLinkName: "nextLink", - }, - }, - } - if g.installVersionList { s.Paths["/subscriptions/{subscriptionId}/providers/Microsoft.RedHatOpenShift/locations/{location}/listinstallversions"] = &PathItem{ Get: &Operation{ @@ -104,9 +114,13 @@ func Run(api, outputDir string) error { if g.clusterManager { g.populateChildResourcePaths(s.Paths, "Microsoft.RedHatOpenShift", "openShiftCluster", "syncSet", "SyncSet") + g.populateChildResourcePaths(s.Paths, "Microsoft.RedHatOpenShift", "openShiftCluster", "machinePool", "MachinePool") + g.populateChildResourcePaths(s.Paths, "Microsoft.RedHatOpenShift", "openShiftCluster", "syncIdentityProvider", "SyncIdentityProvider") + g.populateChildResourcePaths(s.Paths, "Microsoft.RedHatOpenShift", "openShiftCluster", "secret", "Secret") } - populateExamples(s.Paths) + + // This begins to define definitions required for the paths, parameters, and responses defined above names := []string{"OpenShiftClusterList", "OpenShiftClusterCredentials"} if g.kubeConfig { names = append(names, "OpenShiftClusterAdminKubeconfig") @@ -117,7 +131,9 @@ func Run(api, outputDir string) error { } if g.clusterManager { - names = append(names, "SyncSetList") + // This needs to be the top level struct + // in most cases, the "list" struct (a collection of resources) + names = append(names, "SyncSetList", "MachinePoolList", "SyncIdentityProviderList", "SecretList") } err = define(s.Definitions, api, g.xmsEnum, g.xmsSecretList, g.xmsIdentifiers, names...) @@ -131,11 +147,13 @@ func Run(api, outputDir string) error { return err } + // This begins the ARM / Azure Resources definition generation azureResources := []string{ resourceName, } + if g.clusterManager { - azureResources = append(azureResources, "SyncSet") + azureResources = append(azureResources, "SyncSet", "MachinePool", "SyncIdentityProvider", "Secret") } for _, azureResource := range azureResources { @@ -161,16 +179,22 @@ func Run(api, outputDir string) error { update.Properties = properties s.Definitions[azureResource+"Update"] = update - if azureResource != "SyncSet" { + // If this resource is not a proxy resource mark as tracked resource + // otherwise, its a proxy resource and we remove the proxyResource .Allof ref for the Update definition + // in order to make azure-rest-specs-api validation happy + if !contains(proxyResources, azureResource) { s.Definitions[azureResource].AllOf = []Schema{ { Ref: "../../../../../common-types/resource-management/" + g.commonTypesVersion + "/types.json#/definitions/TrackedResource", }, } + } else { + if def, ok := s.Definitions[azureResource+"Update"]; ok { + def.AllOf = []Schema{} + } } properties = nil - for _, property := range s.Definitions[azureResource].Properties { if property.Name == "properties" { property.Schema.ClientFlatten = true @@ -248,3 +272,15 @@ func removeNamedSchemas(list NameSchemas, remove string) NameSchemas { return result } + +// TODO: once we upgrade to go 1.18 we can use the slices.Contains function +// until then, heres this helper func to check if the slice exists after we put it in a map +func contains(slice []string, item string) bool { + set := make(map[string]struct{}, len(slice)) + for _, s := range slice { + set[s] = struct{}{} + } + + _, ok := set[item] + return ok +} diff --git a/python/az/aro/azext_aro/custom.py b/python/az/aro/azext_aro/custom.py index ce9ef32d0..fc7b814dd 100644 --- a/python/az/aro/azext_aro/custom.py +++ b/python/az/aro/azext_aro/custom.py @@ -224,7 +224,7 @@ def aro_list_admin_credentials(cmd, client, resource_group_name, resource_name, def aro_get_versions(client, location): - return client.list.install_versions(location) + return client.install_versions.list(location) def aro_update(cmd, 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 e175c86de..03ee33d08 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, OpenShiftClustersOperations, Operations, SyncSetsOperations +from .operations import InstallVersionsOperations, MachinePoolsOperations, OpenShiftClustersOperations, Operations, SecretsOperations, SyncIdentityProvidersOperations, SyncSetsOperations if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -32,7 +32,7 @@ if TYPE_CHECKING: from azure.core.credentials import TokenCredential from azure.core.rest import HttpRequest, HttpResponse -class AzureRedHatOpenShiftClient(object): +class AzureRedHatOpenShiftClient(object): # pylint: disable=too-many-instance-attributes """Rest API for Azure Red Hat OpenShift 4. :ivar operations: Operations operations @@ -43,6 +43,14 @@ class AzureRedHatOpenShiftClient(object): :ivar open_shift_clusters: OpenShiftClustersOperations operations :vartype open_shift_clusters: azure.mgmt.redhatopenshift.v2022_09_04.operations.OpenShiftClustersOperations + :ivar machine_pools: MachinePoolsOperations operations + :vartype machine_pools: + azure.mgmt.redhatopenshift.v2022_09_04.operations.MachinePoolsOperations + :ivar secrets: SecretsOperations operations + :vartype secrets: azure.mgmt.redhatopenshift.v2022_09_04.operations.SecretsOperations + :ivar sync_identity_providers: SyncIdentityProvidersOperations operations + :vartype sync_identity_providers: + azure.mgmt.redhatopenshift.v2022_09_04.operations.SyncIdentityProvidersOperations :ivar sync_sets: SyncSetsOperations operations :vartype sync_sets: azure.mgmt.redhatopenshift.v2022_09_04.operations.SyncSetsOperations :param credential: Credential needed for the client to connect to Azure. @@ -76,6 +84,9 @@ class AzureRedHatOpenShiftClient(object): 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_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) + self.sync_identity_providers = SyncIdentityProvidersOperations(self._client, self._config, self._serialize, self._deserialize) self.sync_sets = SyncSetsOperations(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 d292aafde..5263ff679 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 @@ -21,6 +21,9 @@ try: from ._models_py3 import ConsoleProfile from ._models_py3 import Display from ._models_py3 import IngressProfile + from ._models_py3 import MachinePool + from ._models_py3 import MachinePoolList + from ._models_py3 import MachinePoolUpdate from ._models_py3 import MasterProfile from ._models_py3 import NetworkProfile from ._models_py3 import OpenShiftCluster @@ -32,7 +35,13 @@ try: from ._models_py3 import OperationList from ._models_py3 import ProxyResource from ._models_py3 import Resource + from ._models_py3 import Secret + from ._models_py3 import SecretList + from ._models_py3 import SecretUpdate from ._models_py3 import ServicePrincipalProfile + from ._models_py3 import SyncIdentityProvider + from ._models_py3 import SyncIdentityProviderList + from ._models_py3 import SyncIdentityProviderUpdate from ._models_py3 import SyncSet from ._models_py3 import SyncSetList from ._models_py3 import SyncSetUpdate @@ -46,6 +55,9 @@ except (SyntaxError, ImportError): from ._models import ConsoleProfile # type: ignore from ._models import Display # type: ignore from ._models import IngressProfile # type: ignore + from ._models import MachinePool # type: ignore + from ._models import MachinePoolList # type: ignore + from ._models import MachinePoolUpdate # type: ignore from ._models import MasterProfile # type: ignore from ._models import NetworkProfile # type: ignore from ._models import OpenShiftCluster # type: ignore @@ -57,7 +69,13 @@ except (SyntaxError, ImportError): from ._models import OperationList # type: ignore from ._models import ProxyResource # type: ignore from ._models import Resource # type: ignore + from ._models import Secret # type: ignore + from ._models import SecretList # type: ignore + from ._models import SecretUpdate # type: ignore from ._models import ServicePrincipalProfile # type: ignore + from ._models import SyncIdentityProvider # type: ignore + from ._models import SyncIdentityProviderList # type: ignore + from ._models import SyncIdentityProviderUpdate # type: ignore from ._models import SyncSet # type: ignore from ._models import SyncSetList # type: ignore from ._models import SyncSetUpdate # type: ignore @@ -80,6 +98,9 @@ __all__ = [ 'ConsoleProfile', 'Display', 'IngressProfile', + 'MachinePool', + 'MachinePoolList', + 'MachinePoolUpdate', 'MasterProfile', 'NetworkProfile', 'OpenShiftCluster', @@ -91,7 +112,13 @@ __all__ = [ 'OperationList', 'ProxyResource', 'Resource', + 'Secret', + 'SecretList', + 'SecretUpdate', 'ServicePrincipalProfile', + 'SyncIdentityProvider', + 'SyncIdentityProviderList', + 'SyncIdentityProviderUpdate', 'SyncSet', 'SyncSetList', 'SyncSetUpdate', 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 6ce0d0c98..71b5724f6 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 @@ -249,6 +249,201 @@ class IngressProfile(msrest.serialization.Model): self.ip = kwargs.get('ip', 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 + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SystemData + """ + + _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'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.system_data = None + + +class ProxyResource(Resource): + """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. + + 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 + """ + + _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'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(ProxyResource, self).__init__(**kwargs) + + +class MachinePool(ProxyResource): + """MachinePool represents a MachinePool. + + 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 resources: + :vartype resources: str + """ + + _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'}, + 'resources': {'key': 'properties.resources', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword resources: + :paramtype resources: str + """ + super(MachinePool, self).__init__(**kwargs) + self.resources = kwargs.get('resources', None) + + +class MachinePoolList(msrest.serialization.Model): + """MachinePoolList represents a list of MachinePools. + + :ivar value: The list of Machine Pools. + :vartype value: list[~azure.mgmt.redhatopenshift.v2022_09_04.models.MachinePool] + :ivar next_link: The link used to get the next page of operations. + :vartype next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[MachinePool]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword value: The list of Machine Pools. + :paramtype value: list[~azure.mgmt.redhatopenshift.v2022_09_04.models.MachinePool] + :keyword next_link: The link used to get the next page of operations. + :paramtype next_link: str + """ + super(MachinePoolList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class MachinePoolUpdate(msrest.serialization.Model): + """MachinePool represents a MachinePool. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar system_data: The system meta data relating to this resource. + :vartype system_data: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SystemData + :ivar resources: + :vartype resources: str + """ + + _validation = { + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'resources': {'key': 'properties.resources', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword resources: + :paramtype resources: str + """ + super(MachinePoolUpdate, self).__init__(**kwargs) + self.system_data = None + self.resources = kwargs.get('resources', None) + + class MasterProfile(msrest.serialization.Model): """MasterProfile represents a master profile. @@ -325,51 +520,6 @@ class NetworkProfile(msrest.serialization.Model): 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 - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SystemData - """ - - _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'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.system_data = None - - class TrackedResource(Resource): """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. @@ -794,8 +944,8 @@ class OperationList(msrest.serialization.Model): self.next_link = kwargs.get('next_link', None) -class ProxyResource(Resource): - """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. +class Secret(ProxyResource): + """Secret represents a secret. Variables are only populated by the server, and will be ignored when sending a request. @@ -810,6 +960,8 @@ class ProxyResource(Resource): :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. :vartype system_data: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SystemData + :ivar secret_resources: The Secrets Resources. + :vartype secret_resources: str """ _validation = { @@ -824,6 +976,7 @@ class ProxyResource(Resource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'secret_resources': {'key': 'properties.secretResources', 'type': 'str'}, } def __init__( @@ -831,8 +984,73 @@ class ProxyResource(Resource): **kwargs ): """ + :keyword secret_resources: The Secrets Resources. + :paramtype secret_resources: str """ - super(ProxyResource, self).__init__(**kwargs) + super(Secret, self).__init__(**kwargs) + self.secret_resources = kwargs.get('secret_resources', None) + + +class SecretList(msrest.serialization.Model): + """SecretList represents a list of Secrets. + + :ivar value: The list of secrets. + :vartype value: list[~azure.mgmt.redhatopenshift.v2022_09_04.models.Secret] + :ivar next_link: The link used to get the next page of operations. + :vartype next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Secret]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword value: The list of secrets. + :paramtype value: list[~azure.mgmt.redhatopenshift.v2022_09_04.models.Secret] + :keyword next_link: The link used to get the next page of operations. + :paramtype next_link: str + """ + super(SecretList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class SecretUpdate(msrest.serialization.Model): + """Secret represents a secret. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar system_data: The system meta data relating to this resource. + :vartype system_data: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SystemData + :ivar secret_resources: The Secrets Resources. + :vartype secret_resources: str + """ + + _validation = { + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'secret_resources': {'key': 'properties.secretResources', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword secret_resources: The Secrets Resources. + :paramtype secret_resources: str + """ + super(SecretUpdate, self).__init__(**kwargs) + self.system_data = None + self.secret_resources = kwargs.get('secret_resources', None) class ServicePrincipalProfile(msrest.serialization.Model): @@ -864,47 +1082,8 @@ class ServicePrincipalProfile(msrest.serialization.Model): self.client_secret = kwargs.get('client_secret', None) -class SyncSet(msrest.serialization.Model): - """SyncSet represents a SyncSet for an Azure Red Hat OpenShift Cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar system_data: The system meta data relating to this resource. - :vartype system_data: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SystemData - :ivar cluster_resource_id: The parent Azure Red Hat OpenShift resourceID. - :vartype cluster_resource_id: str - :ivar resources: Resources represents the SyncSets configuration. - :vartype resources: str - """ - - _validation = { - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'cluster_resource_id': {'key': 'properties.clusterResourceId', 'type': 'str'}, - 'resources': {'key': 'properties.resources', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword cluster_resource_id: The parent Azure Red Hat OpenShift resourceID. - :paramtype cluster_resource_id: str - :keyword resources: Resources represents the SyncSets configuration. - :paramtype resources: str - """ - super(SyncSet, self).__init__(**kwargs) - self.system_data = None - self.cluster_resource_id = kwargs.get('cluster_resource_id', None) - self.resources = kwargs.get('resources', None) - - -class SyncSetList(ProxyResource): - """SyncSetList represents a list of SyncSets. +class SyncIdentityProvider(ProxyResource): + """SyncIdentityProvider represents a SyncIdentityProvider. Variables are only populated by the server, and will be ignored when sending a request. @@ -919,10 +1098,8 @@ class SyncSetList(ProxyResource): :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. :vartype system_data: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SystemData - :ivar value: The list of syncsets. - :vartype value: list[~azure.mgmt.redhatopenshift.v2022_09_04.models.SyncSet] - :ivar next_link: The link used to get the next page of operations. - :vartype next_link: str + :ivar resources: + :vartype resources: str """ _validation = { @@ -937,6 +1114,140 @@ class SyncSetList(ProxyResource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'resources': {'key': 'properties.resources', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword resources: + :paramtype resources: str + """ + super(SyncIdentityProvider, self).__init__(**kwargs) + self.resources = kwargs.get('resources', None) + + +class SyncIdentityProviderList(msrest.serialization.Model): + """SyncSetList represents a list of SyncSets. + + :ivar value: The list of sync identity providers. + :vartype value: list[~azure.mgmt.redhatopenshift.v2022_09_04.models.SyncIdentityProvider] + :ivar next_link: The link used to get the next page of operations. + :vartype next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SyncIdentityProvider]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword value: The list of sync identity providers. + :paramtype value: list[~azure.mgmt.redhatopenshift.v2022_09_04.models.SyncIdentityProvider] + :keyword next_link: The link used to get the next page of operations. + :paramtype next_link: str + """ + super(SyncIdentityProviderList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class SyncIdentityProviderUpdate(msrest.serialization.Model): + """SyncIdentityProvider represents a SyncIdentityProvider. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar system_data: The system meta data relating to this resource. + :vartype system_data: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SystemData + :ivar resources: + :vartype resources: str + """ + + _validation = { + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'resources': {'key': 'properties.resources', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword resources: + :paramtype resources: str + """ + super(SyncIdentityProviderUpdate, self).__init__(**kwargs) + self.system_data = None + self.resources = kwargs.get('resources', None) + + +class SyncSet(ProxyResource): + """SyncSet represents a SyncSet for an Azure Red Hat OpenShift Cluster. + + 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 resources: Resources represents the SyncSets configuration. + :vartype resources: str + """ + + _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'}, + 'resources': {'key': 'properties.resources', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword resources: Resources represents the SyncSets configuration. + :paramtype resources: str + """ + super(SyncSet, self).__init__(**kwargs) + self.resources = kwargs.get('resources', None) + + +class SyncSetList(msrest.serialization.Model): + """SyncSetList represents a list of SyncSets. + + :ivar value: The list of syncsets. + :vartype value: list[~azure.mgmt.redhatopenshift.v2022_09_04.models.SyncSet] + :ivar next_link: The link used to get the next page of operations. + :vartype next_link: str + """ + + _attribute_map = { 'value': {'key': 'value', 'type': '[SyncSet]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -963,8 +1274,6 @@ class SyncSetUpdate(msrest.serialization.Model): :ivar system_data: The system meta data relating to this resource. :vartype system_data: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SystemData - :ivar cluster_resource_id: The parent Azure Red Hat OpenShift resourceID. - :vartype cluster_resource_id: str :ivar resources: Resources represents the SyncSets configuration. :vartype resources: str """ @@ -975,7 +1284,6 @@ class SyncSetUpdate(msrest.serialization.Model): _attribute_map = { 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'cluster_resource_id': {'key': 'properties.clusterResourceId', 'type': 'str'}, 'resources': {'key': 'properties.resources', 'type': 'str'}, } @@ -984,14 +1292,11 @@ class SyncSetUpdate(msrest.serialization.Model): **kwargs ): """ - :keyword cluster_resource_id: The parent Azure Red Hat OpenShift resourceID. - :paramtype cluster_resource_id: str :keyword resources: Resources represents the SyncSets configuration. :paramtype resources: str """ super(SyncSetUpdate, self).__init__(**kwargs) self.system_data = None - self.cluster_resource_id = kwargs.get('cluster_resource_id', None) self.resources = kwargs.get('resources', None) 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 97a6a75f9..1c06dedd3 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 @@ -280,6 +280,208 @@ class IngressProfile(msrest.serialization.Model): self.ip = ip +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 + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SystemData + """ + + _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'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.system_data = None + + +class ProxyResource(Resource): + """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. + + 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 + """ + + _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'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(ProxyResource, self).__init__(**kwargs) + + +class MachinePool(ProxyResource): + """MachinePool represents a MachinePool. + + 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 resources: + :vartype resources: str + """ + + _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'}, + 'resources': {'key': 'properties.resources', 'type': 'str'}, + } + + def __init__( + self, + *, + resources: Optional[str] = None, + **kwargs + ): + """ + :keyword resources: + :paramtype resources: str + """ + super(MachinePool, self).__init__(**kwargs) + self.resources = resources + + +class MachinePoolList(msrest.serialization.Model): + """MachinePoolList represents a list of MachinePools. + + :ivar value: The list of Machine Pools. + :vartype value: list[~azure.mgmt.redhatopenshift.v2022_09_04.models.MachinePool] + :ivar next_link: The link used to get the next page of operations. + :vartype next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[MachinePool]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["MachinePool"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + """ + :keyword value: The list of Machine Pools. + :paramtype value: list[~azure.mgmt.redhatopenshift.v2022_09_04.models.MachinePool] + :keyword next_link: The link used to get the next page of operations. + :paramtype next_link: str + """ + super(MachinePoolList, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class MachinePoolUpdate(msrest.serialization.Model): + """MachinePool represents a MachinePool. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar system_data: The system meta data relating to this resource. + :vartype system_data: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SystemData + :ivar resources: + :vartype resources: str + """ + + _validation = { + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'resources': {'key': 'properties.resources', 'type': 'str'}, + } + + def __init__( + self, + *, + resources: Optional[str] = None, + **kwargs + ): + """ + :keyword resources: + :paramtype resources: str + """ + super(MachinePoolUpdate, self).__init__(**kwargs) + self.system_data = None + self.resources = resources + + class MasterProfile(msrest.serialization.Model): """MasterProfile represents a master profile. @@ -364,51 +566,6 @@ class NetworkProfile(msrest.serialization.Model): self.service_cidr = service_cidr -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 - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SystemData - """ - - _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'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.system_data = None - - class TrackedResource(Resource): """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. @@ -876,8 +1033,8 @@ class OperationList(msrest.serialization.Model): self.next_link = next_link -class ProxyResource(Resource): - """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. +class Secret(ProxyResource): + """Secret represents a secret. Variables are only populated by the server, and will be ignored when sending a request. @@ -892,6 +1049,8 @@ class ProxyResource(Resource): :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. :vartype system_data: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SystemData + :ivar secret_resources: The Secrets Resources. + :vartype secret_resources: str """ _validation = { @@ -906,15 +1065,88 @@ class ProxyResource(Resource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'secret_resources': {'key': 'properties.secretResources', 'type': 'str'}, } def __init__( self, + *, + secret_resources: Optional[str] = None, **kwargs ): """ + :keyword secret_resources: The Secrets Resources. + :paramtype secret_resources: str """ - super(ProxyResource, self).__init__(**kwargs) + super(Secret, self).__init__(**kwargs) + self.secret_resources = secret_resources + + +class SecretList(msrest.serialization.Model): + """SecretList represents a list of Secrets. + + :ivar value: The list of secrets. + :vartype value: list[~azure.mgmt.redhatopenshift.v2022_09_04.models.Secret] + :ivar next_link: The link used to get the next page of operations. + :vartype next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Secret]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["Secret"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + """ + :keyword value: The list of secrets. + :paramtype value: list[~azure.mgmt.redhatopenshift.v2022_09_04.models.Secret] + :keyword next_link: The link used to get the next page of operations. + :paramtype next_link: str + """ + super(SecretList, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class SecretUpdate(msrest.serialization.Model): + """Secret represents a secret. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar system_data: The system meta data relating to this resource. + :vartype system_data: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SystemData + :ivar secret_resources: The Secrets Resources. + :vartype secret_resources: str + """ + + _validation = { + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'secret_resources': {'key': 'properties.secretResources', 'type': 'str'}, + } + + def __init__( + self, + *, + secret_resources: Optional[str] = None, + **kwargs + ): + """ + :keyword secret_resources: The Secrets Resources. + :paramtype secret_resources: str + """ + super(SecretUpdate, self).__init__(**kwargs) + self.system_data = None + self.secret_resources = secret_resources class ServicePrincipalProfile(msrest.serialization.Model): @@ -949,50 +1181,8 @@ class ServicePrincipalProfile(msrest.serialization.Model): self.client_secret = client_secret -class SyncSet(msrest.serialization.Model): - """SyncSet represents a SyncSet for an Azure Red Hat OpenShift Cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar system_data: The system meta data relating to this resource. - :vartype system_data: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SystemData - :ivar cluster_resource_id: The parent Azure Red Hat OpenShift resourceID. - :vartype cluster_resource_id: str - :ivar resources: Resources represents the SyncSets configuration. - :vartype resources: str - """ - - _validation = { - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'cluster_resource_id': {'key': 'properties.clusterResourceId', 'type': 'str'}, - 'resources': {'key': 'properties.resources', 'type': 'str'}, - } - - def __init__( - self, - *, - cluster_resource_id: Optional[str] = None, - resources: Optional[str] = None, - **kwargs - ): - """ - :keyword cluster_resource_id: The parent Azure Red Hat OpenShift resourceID. - :paramtype cluster_resource_id: str - :keyword resources: Resources represents the SyncSets configuration. - :paramtype resources: str - """ - super(SyncSet, self).__init__(**kwargs) - self.system_data = None - self.cluster_resource_id = cluster_resource_id - self.resources = resources - - -class SyncSetList(ProxyResource): - """SyncSetList represents a list of SyncSets. +class SyncIdentityProvider(ProxyResource): + """SyncIdentityProvider represents a SyncIdentityProvider. Variables are only populated by the server, and will be ignored when sending a request. @@ -1007,10 +1197,8 @@ class SyncSetList(ProxyResource): :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. :vartype system_data: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SystemData - :ivar value: The list of syncsets. - :vartype value: list[~azure.mgmt.redhatopenshift.v2022_09_04.models.SyncSet] - :ivar next_link: The link used to get the next page of operations. - :vartype next_link: str + :ivar resources: + :vartype resources: str """ _validation = { @@ -1025,6 +1213,149 @@ class SyncSetList(ProxyResource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'resources': {'key': 'properties.resources', 'type': 'str'}, + } + + def __init__( + self, + *, + resources: Optional[str] = None, + **kwargs + ): + """ + :keyword resources: + :paramtype resources: str + """ + super(SyncIdentityProvider, self).__init__(**kwargs) + self.resources = resources + + +class SyncIdentityProviderList(msrest.serialization.Model): + """SyncSetList represents a list of SyncSets. + + :ivar value: The list of sync identity providers. + :vartype value: list[~azure.mgmt.redhatopenshift.v2022_09_04.models.SyncIdentityProvider] + :ivar next_link: The link used to get the next page of operations. + :vartype next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SyncIdentityProvider]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["SyncIdentityProvider"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + """ + :keyword value: The list of sync identity providers. + :paramtype value: list[~azure.mgmt.redhatopenshift.v2022_09_04.models.SyncIdentityProvider] + :keyword next_link: The link used to get the next page of operations. + :paramtype next_link: str + """ + super(SyncIdentityProviderList, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class SyncIdentityProviderUpdate(msrest.serialization.Model): + """SyncIdentityProvider represents a SyncIdentityProvider. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar system_data: The system meta data relating to this resource. + :vartype system_data: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SystemData + :ivar resources: + :vartype resources: str + """ + + _validation = { + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'resources': {'key': 'properties.resources', 'type': 'str'}, + } + + def __init__( + self, + *, + resources: Optional[str] = None, + **kwargs + ): + """ + :keyword resources: + :paramtype resources: str + """ + super(SyncIdentityProviderUpdate, self).__init__(**kwargs) + self.system_data = None + self.resources = resources + + +class SyncSet(ProxyResource): + """SyncSet represents a SyncSet for an Azure Red Hat OpenShift Cluster. + + 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 resources: Resources represents the SyncSets configuration. + :vartype resources: str + """ + + _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'}, + 'resources': {'key': 'properties.resources', 'type': 'str'}, + } + + def __init__( + self, + *, + resources: Optional[str] = None, + **kwargs + ): + """ + :keyword resources: Resources represents the SyncSets configuration. + :paramtype resources: str + """ + super(SyncSet, self).__init__(**kwargs) + self.resources = resources + + +class SyncSetList(msrest.serialization.Model): + """SyncSetList represents a list of SyncSets. + + :ivar value: The list of syncsets. + :vartype value: list[~azure.mgmt.redhatopenshift.v2022_09_04.models.SyncSet] + :ivar next_link: The link used to get the next page of operations. + :vartype next_link: str + """ + + _attribute_map = { 'value': {'key': 'value', 'type': '[SyncSet]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -1054,8 +1385,6 @@ class SyncSetUpdate(msrest.serialization.Model): :ivar system_data: The system meta data relating to this resource. :vartype system_data: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SystemData - :ivar cluster_resource_id: The parent Azure Red Hat OpenShift resourceID. - :vartype cluster_resource_id: str :ivar resources: Resources represents the SyncSets configuration. :vartype resources: str """ @@ -1066,26 +1395,21 @@ class SyncSetUpdate(msrest.serialization.Model): _attribute_map = { 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'cluster_resource_id': {'key': 'properties.clusterResourceId', 'type': 'str'}, 'resources': {'key': 'properties.resources', 'type': 'str'}, } def __init__( self, *, - cluster_resource_id: Optional[str] = None, resources: Optional[str] = None, **kwargs ): """ - :keyword cluster_resource_id: The parent Azure Red Hat OpenShift resourceID. - :paramtype cluster_resource_id: str :keyword resources: Resources represents the SyncSets configuration. :paramtype resources: str """ super(SyncSetUpdate, self).__init__(**kwargs) self.system_data = None - self.cluster_resource_id = cluster_resource_id self.resources = resources 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 9e3308cdd..a70265e21 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 @@ -17,11 +17,17 @@ from ._operations import Operations from ._install_versions_operations import InstallVersionsOperations from ._open_shift_clusters_operations import OpenShiftClustersOperations +from ._machine_pools_operations import MachinePoolsOperations +from ._secrets_operations import SecretsOperations +from ._sync_identity_providers_operations import SyncIdentityProvidersOperations from ._sync_sets_operations import SyncSetsOperations __all__ = [ 'Operations', 'InstallVersionsOperations', 'OpenShiftClustersOperations', + 'MachinePoolsOperations', + 'SecretsOperations', + 'SyncIdentityProvidersOperations', 'SyncSetsOperations', ] diff --git a/python/client/azure/mgmt/redhatopenshift/v2022_09_04/operations/_machine_pools_operations.py b/python/client/azure/mgmt/redhatopenshift/v2022_09_04/operations/_machine_pools_operations.py new file mode 100644 index 000000000..74aa885ba --- /dev/null +++ b/python/client/azure/mgmt/redhatopenshift/v2022_09_04/operations/_machine_pools_operations.py @@ -0,0 +1,626 @@ +# 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, _format_url_section + +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( + subscription_id, # type: str + resource_group_name, # type: str + resource_name, # type: str + **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", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openShiftCluster/{resourceName}/machinePools") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # 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 + ) + + +def build_get_request( + subscription_id, # type: str + resource_group_name, # type: str + resource_name, # type: str + child_resource_name, # type: str + **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", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/machinePool/{childResourceName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "childResourceName": _SERIALIZER.url("child_resource_name", child_resource_name, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # 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 + ) + + +def build_create_or_update_request( + subscription_id, # type: str + resource_group_name, # type: str + resource_name, # type: str + child_resource_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2022-09-04") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/machinePool/{childResourceName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "childResourceName": _SERIALIZER.url("child_resource_name", child_resource_name, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # 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] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_delete_request( + subscription_id, # type: str + resource_group_name, # type: str + resource_name, # type: str + child_resource_name, # type: str + **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", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/machinePool/{childResourceName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "childResourceName": _SERIALIZER.url("child_resource_name", child_resource_name, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # 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="DELETE", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_update_request( + subscription_id, # type: str + resource_group_name, # type: str + resource_name, # type: str + child_resource_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2022-09-04") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/machinePool/{childResourceName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "childResourceName": _SERIALIZER.url("child_resource_name", child_resource_name, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # 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] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + +# fmt: on +class MachinePoolsOperations(object): + """MachinePoolsOperations 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, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.MachinePoolList"] + """Lists MachinePools that belong to that Azure Red Hat OpenShift Cluster. + + The operation returns properties of each MachinePool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the OpenShift cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either MachinePoolList or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.redhatopenshift.v2022_09_04.models.MachinePoolList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2022-09-04") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.MachinePoolList"] + 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( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + 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( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + 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("MachinePoolList", 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': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openShiftCluster/{resourceName}/machinePools"} # type: ignore + + @distributed_trace + def get( + self, + resource_group_name, # type: str + resource_name, # type: str + child_resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.MachinePool" + """Gets a MachinePool with the specified subscription, resource group and resource name. + + The operation returns properties of a MachinePool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the OpenShift cluster resource. + :type resource_name: str + :param child_resource_name: The name of the MachinePool resource. + :type child_resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MachinePool, or the result of cls(response) + :rtype: ~azure.mgmt.redhatopenshift.v2022_09_04.models.MachinePool + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MachinePool"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2022-09-04") # type: str + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + child_resource_name=child_resource_name, + api_version=api_version, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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) + + deserialized = self._deserialize('MachinePool', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/machinePool/{childResourceName}"} # type: ignore + + + @distributed_trace + def create_or_update( + self, + resource_group_name, # type: str + resource_name, # type: str + child_resource_name, # type: str + parameters, # type: "_models.MachinePool" + **kwargs # type: Any + ): + # type: (...) -> "_models.MachinePool" + """Creates or updates a MachinePool with the specified subscription, resource group and resource + name. + + The operation returns properties of a MachinePool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the OpenShift cluster resource. + :type resource_name: str + :param child_resource_name: The name of the MachinePool resource. + :type child_resource_name: str + :param parameters: The MachinePool resource. + :type parameters: ~azure.mgmt.redhatopenshift.v2022_09_04.models.MachinePool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MachinePool, or the result of cls(response) + :rtype: ~azure.mgmt.redhatopenshift.v2022_09_04.models.MachinePool + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MachinePool"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2022-09-04") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'MachinePool') + + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + child_resource_name=child_resource_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('MachinePool', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('MachinePool', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/machinePool/{childResourceName}"} # type: ignore + + + @distributed_trace + def delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name, # type: str + resource_name, # type: str + child_resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a MachinePool with the specified subscription, resource group and resource name. + + The operation returns nothing. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the OpenShift cluster resource. + :type resource_name: str + :param child_resource_name: The name of the MachinePool resource. + :type child_resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2022-09-04") # type: str + + + request = build_delete_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + child_resource_name=child_resource_name, + api_version=api_version, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/machinePool/{childResourceName}"} # type: ignore + + + @distributed_trace + def update( + self, + resource_group_name, # type: str + resource_name, # type: str + child_resource_name, # type: str + parameters, # type: "_models.MachinePoolUpdate" + **kwargs # type: Any + ): + # type: (...) -> "_models.MachinePool" + """Patches (create or update) a MachinePool with the specified subscription, resource group and + resource name. + + The operation returns properties of a MachinePool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the OpenShift cluster resource. + :type resource_name: str + :param child_resource_name: The name of the MachinePool resource. + :type child_resource_name: str + :param parameters: The MachinePool resource. + :type parameters: ~azure.mgmt.redhatopenshift.v2022_09_04.models.MachinePoolUpdate + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MachinePool, or the result of cls(response) + :rtype: ~azure.mgmt.redhatopenshift.v2022_09_04.models.MachinePool + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MachinePool"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2022-09-04") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'MachinePoolUpdate') + + request = build_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + child_resource_name=child_resource_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('MachinePool', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('MachinePool', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/machinePool/{childResourceName}"} # type: ignore + diff --git a/python/client/azure/mgmt/redhatopenshift/v2022_09_04/operations/_secrets_operations.py b/python/client/azure/mgmt/redhatopenshift/v2022_09_04/operations/_secrets_operations.py new file mode 100644 index 000000000..1d208a63f --- /dev/null +++ b/python/client/azure/mgmt/redhatopenshift/v2022_09_04/operations/_secrets_operations.py @@ -0,0 +1,624 @@ +# 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, _format_url_section + +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( + subscription_id, # type: str + resource_group_name, # type: str + resource_name, # type: str + **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", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openShiftCluster/{resourceName}/secrets") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # 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 + ) + + +def build_get_request( + subscription_id, # type: str + resource_group_name, # type: str + resource_name, # type: str + child_resource_name, # type: str + **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", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/secret/{childResourceName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "childResourceName": _SERIALIZER.url("child_resource_name", child_resource_name, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # 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 + ) + + +def build_create_or_update_request( + subscription_id, # type: str + resource_group_name, # type: str + resource_name, # type: str + child_resource_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2022-09-04") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/secret/{childResourceName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "childResourceName": _SERIALIZER.url("child_resource_name", child_resource_name, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # 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] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_delete_request( + subscription_id, # type: str + resource_group_name, # type: str + resource_name, # type: str + child_resource_name, # type: str + **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", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/secret/{childResourceName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "childResourceName": _SERIALIZER.url("child_resource_name", child_resource_name, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # 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="DELETE", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_update_request( + subscription_id, # type: str + resource_group_name, # type: str + resource_name, # type: str + child_resource_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2022-09-04") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/secret/{childResourceName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "childResourceName": _SERIALIZER.url("child_resource_name", child_resource_name, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # 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] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + +# fmt: on +class SecretsOperations(object): + """SecretsOperations 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, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SecretList"] + """Lists Secrets that belong to that Azure Red Hat OpenShift Cluster. + + The operation returns properties of each Secret. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the OpenShift cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SecretList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.redhatopenshift.v2022_09_04.models.SecretList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2022-09-04") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecretList"] + 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( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + 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( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + 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("SecretList", 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': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openShiftCluster/{resourceName}/secrets"} # type: ignore + + @distributed_trace + def get( + self, + resource_group_name, # type: str + resource_name, # type: str + child_resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Secret" + """Gets a Secret with the specified subscription, resource group and resource name. + + The operation returns properties of a Secret. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the OpenShift cluster resource. + :type resource_name: str + :param child_resource_name: The name of the Secret resource. + :type child_resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Secret, or the result of cls(response) + :rtype: ~azure.mgmt.redhatopenshift.v2022_09_04.models.Secret + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Secret"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2022-09-04") # type: str + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + child_resource_name=child_resource_name, + api_version=api_version, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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) + + deserialized = self._deserialize('Secret', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/secret/{childResourceName}"} # type: ignore + + + @distributed_trace + def create_or_update( + self, + resource_group_name, # type: str + resource_name, # type: str + child_resource_name, # type: str + parameters, # type: "_models.Secret" + **kwargs # type: Any + ): + # type: (...) -> "_models.Secret" + """Creates or updates a Secret with the specified subscription, resource group and resource name. + + The operation returns properties of a Secret. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the OpenShift cluster resource. + :type resource_name: str + :param child_resource_name: The name of the Secret resource. + :type child_resource_name: str + :param parameters: The Secret resource. + :type parameters: ~azure.mgmt.redhatopenshift.v2022_09_04.models.Secret + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Secret, or the result of cls(response) + :rtype: ~azure.mgmt.redhatopenshift.v2022_09_04.models.Secret + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Secret"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2022-09-04") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'Secret') + + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + child_resource_name=child_resource_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Secret', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Secret', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/secret/{childResourceName}"} # type: ignore + + + @distributed_trace + def delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name, # type: str + resource_name, # type: str + child_resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a Secret with the specified subscription, resource group and resource name. + + The operation returns nothing. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the OpenShift cluster resource. + :type resource_name: str + :param child_resource_name: The name of the Secret resource. + :type child_resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2022-09-04") # type: str + + + request = build_delete_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + child_resource_name=child_resource_name, + api_version=api_version, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/secret/{childResourceName}"} # type: ignore + + + @distributed_trace + def update( + self, + resource_group_name, # type: str + resource_name, # type: str + child_resource_name, # type: str + parameters, # type: "_models.SecretUpdate" + **kwargs # type: Any + ): + # type: (...) -> "_models.Secret" + """Patches (create or update) a Secret with the specified subscription, resource group and + resource name. + + The operation returns properties of a Secret. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the OpenShift cluster resource. + :type resource_name: str + :param child_resource_name: The name of the Secret resource. + :type child_resource_name: str + :param parameters: The Secret resource. + :type parameters: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SecretUpdate + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Secret, or the result of cls(response) + :rtype: ~azure.mgmt.redhatopenshift.v2022_09_04.models.Secret + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Secret"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2022-09-04") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'SecretUpdate') + + request = build_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + child_resource_name=child_resource_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Secret', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Secret', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/secret/{childResourceName}"} # type: ignore + diff --git a/python/client/azure/mgmt/redhatopenshift/v2022_09_04/operations/_sync_identity_providers_operations.py b/python/client/azure/mgmt/redhatopenshift/v2022_09_04/operations/_sync_identity_providers_operations.py new file mode 100644 index 000000000..82c2ed67e --- /dev/null +++ b/python/client/azure/mgmt/redhatopenshift/v2022_09_04/operations/_sync_identity_providers_operations.py @@ -0,0 +1,628 @@ +# 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, _format_url_section + +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( + subscription_id, # type: str + resource_group_name, # type: str + resource_name, # type: str + **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", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openShiftCluster/{resourceName}/syncIdentityProviders") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # 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 + ) + + +def build_get_request( + subscription_id, # type: str + resource_group_name, # type: str + resource_name, # type: str + child_resource_name, # type: str + **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", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/syncIdentityProvider/{childResourceName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "childResourceName": _SERIALIZER.url("child_resource_name", child_resource_name, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # 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 + ) + + +def build_create_or_update_request( + subscription_id, # type: str + resource_group_name, # type: str + resource_name, # type: str + child_resource_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2022-09-04") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/syncIdentityProvider/{childResourceName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "childResourceName": _SERIALIZER.url("child_resource_name", child_resource_name, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # 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] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_delete_request( + subscription_id, # type: str + resource_group_name, # type: str + resource_name, # type: str + child_resource_name, # type: str + **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", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/syncIdentityProvider/{childResourceName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "childResourceName": _SERIALIZER.url("child_resource_name", child_resource_name, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # 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="DELETE", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_update_request( + subscription_id, # type: str + resource_group_name, # type: str + resource_name, # type: str + child_resource_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2022-09-04") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/syncIdentityProvider/{childResourceName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "childResourceName": _SERIALIZER.url("child_resource_name", child_resource_name, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # 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] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + +# fmt: on +class SyncIdentityProvidersOperations(object): + """SyncIdentityProvidersOperations 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, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SyncIdentityProviderList"] + """Lists SyncIdentityProviders that belong to that Azure Red Hat OpenShift Cluster. + + The operation returns properties of each SyncIdentityProvider. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the OpenShift cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SyncIdentityProviderList or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.redhatopenshift.v2022_09_04.models.SyncIdentityProviderList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2022-09-04") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.SyncIdentityProviderList"] + 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( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + 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( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + 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("SyncIdentityProviderList", 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': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openShiftCluster/{resourceName}/syncIdentityProviders"} # type: ignore + + @distributed_trace + def get( + self, + resource_group_name, # type: str + resource_name, # type: str + child_resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SyncIdentityProvider" + """Gets a SyncIdentityProvider with the specified subscription, resource group and resource name. + + The operation returns properties of a SyncIdentityProvider. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the OpenShift cluster resource. + :type resource_name: str + :param child_resource_name: The name of the SyncIdentityProvider resource. + :type child_resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SyncIdentityProvider, or the result of cls(response) + :rtype: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SyncIdentityProvider + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SyncIdentityProvider"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2022-09-04") # type: str + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + child_resource_name=child_resource_name, + api_version=api_version, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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) + + deserialized = self._deserialize('SyncIdentityProvider', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/syncIdentityProvider/{childResourceName}"} # type: ignore + + + @distributed_trace + def create_or_update( + self, + resource_group_name, # type: str + resource_name, # type: str + child_resource_name, # type: str + parameters, # type: "_models.SyncIdentityProvider" + **kwargs # type: Any + ): + # type: (...) -> "_models.SyncIdentityProvider" + """Creates or updates a SyncIdentityProvider with the specified subscription, resource group and + resource name. + + The operation returns properties of a SyncIdentityProvider. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the OpenShift cluster resource. + :type resource_name: str + :param child_resource_name: The name of the SyncIdentityProvider resource. + :type child_resource_name: str + :param parameters: The SyncIdentityProvider resource. + :type parameters: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SyncIdentityProvider + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SyncIdentityProvider, or the result of cls(response) + :rtype: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SyncIdentityProvider + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SyncIdentityProvider"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2022-09-04") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'SyncIdentityProvider') + + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + child_resource_name=child_resource_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SyncIdentityProvider', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SyncIdentityProvider', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/syncIdentityProvider/{childResourceName}"} # type: ignore + + + @distributed_trace + def delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name, # type: str + resource_name, # type: str + child_resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a SyncIdentityProvider with the specified subscription, resource group and resource + name. + + The operation returns nothing. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the OpenShift cluster resource. + :type resource_name: str + :param child_resource_name: The name of the SyncIdentityProvider resource. + :type child_resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2022-09-04") # type: str + + + request = build_delete_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + child_resource_name=child_resource_name, + api_version=api_version, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/syncIdentityProvider/{childResourceName}"} # type: ignore + + + @distributed_trace + def update( + self, + resource_group_name, # type: str + resource_name, # type: str + child_resource_name, # type: str + parameters, # type: "_models.SyncIdentityProviderUpdate" + **kwargs # type: Any + ): + # type: (...) -> "_models.SyncIdentityProvider" + """Patches (create or update) a SyncIdentityProvider with the specified subscription, resource + group and resource name. + + The operation returns properties of a SyncIdentityProvider. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the OpenShift cluster resource. + :type resource_name: str + :param child_resource_name: The name of the SyncIdentityProvider resource. + :type child_resource_name: str + :param parameters: The SyncIdentityProvider resource. + :type parameters: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SyncIdentityProviderUpdate + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SyncIdentityProvider, or the result of cls(response) + :rtype: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SyncIdentityProvider + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SyncIdentityProvider"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2022-09-04") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'SyncIdentityProviderUpdate') + + request = build_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + child_resource_name=child_resource_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SyncIdentityProvider', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SyncIdentityProvider', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/syncIdentityProvider/{childResourceName}"} # type: ignore + diff --git a/python/client/azure/mgmt/redhatopenshift/v2022_09_04/operations/_sync_sets_operations.py b/python/client/azure/mgmt/redhatopenshift/v2022_09_04/operations/_sync_sets_operations.py index a5929c4be..b4d598410 100644 --- a/python/client/azure/mgmt/redhatopenshift/v2022_09_04/operations/_sync_sets_operations.py +++ b/python/client/azure/mgmt/redhatopenshift/v2022_09_04/operations/_sync_sets_operations.py @@ -80,7 +80,7 @@ def build_get_request( subscription_id, # type: str resource_group_name, # type: str resource_name, # type: str - sync_set_resource_name, # type: str + child_resource_name, # type: str **kwargs # type: Any ): # type: (...) -> HttpRequest @@ -88,12 +88,12 @@ def build_get_request( accept = "application/json" # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/syncSet/{syncSetResourceName}") # pylint: disable=line-too-long + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/syncSet/{childResourceName}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), - "syncSetResourceName": _SERIALIZER.url("sync_set_resource_name", sync_set_resource_name, 'str'), + "childResourceName": _SERIALIZER.url("child_resource_name", child_resource_name, 'str'), } _url = _format_url_section(_url, **path_format_arguments) @@ -119,20 +119,21 @@ def build_create_or_update_request( subscription_id, # type: str resource_group_name, # type: str resource_name, # type: str - sync_set_resource_name, # type: str + child_resource_name, # type: str **kwargs # type: Any ): # type: (...) -> HttpRequest api_version = kwargs.pop('api_version', "2022-09-04") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] accept = "application/json" # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/syncSet/{syncSetResourceName}") # pylint: disable=line-too-long + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/syncSet/{childResourceName}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), - "syncSetResourceName": _SERIALIZER.url("sync_set_resource_name", sync_set_resource_name, 'str'), + "childResourceName": _SERIALIZER.url("child_resource_name", child_resource_name, 'str'), } _url = _format_url_section(_url, **path_format_arguments) @@ -143,6 +144,8 @@ def build_create_or_update_request( # Construct headers _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( @@ -158,7 +161,7 @@ def build_delete_request( subscription_id, # type: str resource_group_name, # type: str resource_name, # type: str - sync_set_resource_name, # type: str + child_resource_name, # type: str **kwargs # type: Any ): # type: (...) -> HttpRequest @@ -166,12 +169,12 @@ def build_delete_request( accept = "application/json" # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/syncSet/{syncSetResourceName}") # pylint: disable=line-too-long + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/syncSet/{childResourceName}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), - "syncSetResourceName": _SERIALIZER.url("sync_set_resource_name", sync_set_resource_name, 'str'), + "childResourceName": _SERIALIZER.url("child_resource_name", child_resource_name, 'str'), } _url = _format_url_section(_url, **path_format_arguments) @@ -197,20 +200,21 @@ def build_update_request( subscription_id, # type: str resource_group_name, # type: str resource_name, # type: str - sync_set_resource_name, # type: str + child_resource_name, # type: str **kwargs # type: Any ): # type: (...) -> HttpRequest api_version = kwargs.pop('api_version', "2022-09-04") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] accept = "application/json" # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/syncSet/{syncSetResourceName}") # pylint: disable=line-too-long + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/syncSet/{childResourceName}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), - "syncSetResourceName": _SERIALIZER.url("sync_set_resource_name", sync_set_resource_name, 'str'), + "childResourceName": _SERIALIZER.url("child_resource_name", child_resource_name, 'str'), } _url = _format_url_section(_url, **path_format_arguments) @@ -221,6 +225,8 @@ def build_update_request( # Construct headers _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( @@ -344,7 +350,7 @@ class SyncSetsOperations(object): self, resource_group_name, # type: str resource_name, # type: str - sync_set_resource_name, # type: str + child_resource_name, # type: str **kwargs # type: Any ): # type: (...) -> "_models.SyncSet" @@ -356,8 +362,8 @@ class SyncSetsOperations(object): :type resource_group_name: str :param resource_name: The name of the OpenShift cluster resource. :type resource_name: str - :param sync_set_resource_name: The name of the SyncSet resource. - :type sync_set_resource_name: str + :param child_resource_name: The name of the SyncSet resource. + :type child_resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SyncSet, or the result of cls(response) :rtype: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SyncSet @@ -376,7 +382,7 @@ class SyncSetsOperations(object): subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, resource_name=resource_name, - sync_set_resource_name=sync_set_resource_name, + child_resource_name=child_resource_name, api_version=api_version, template_url=self.get.metadata['url'], ) @@ -401,7 +407,7 @@ class SyncSetsOperations(object): return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/syncSet/{syncSetResourceName}"} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/syncSet/{childResourceName}"} # type: ignore @distributed_trace @@ -409,7 +415,8 @@ class SyncSetsOperations(object): self, resource_group_name, # type: str resource_name, # type: str - sync_set_resource_name, # type: str + child_resource_name, # type: str + parameters, # type: "_models.SyncSet" **kwargs # type: Any ): # type: (...) -> "_models.SyncSet" @@ -421,8 +428,10 @@ class SyncSetsOperations(object): :type resource_group_name: str :param resource_name: The name of the OpenShift cluster resource. :type resource_name: str - :param sync_set_resource_name: The name of the SyncSet resource. - :type sync_set_resource_name: str + :param child_resource_name: The name of the SyncSet resource. + :type child_resource_name: str + :param parameters: The SyncSet resource. + :type parameters: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SyncSet :keyword callable cls: A custom type or function that will be passed the direct response :return: SyncSet, or the result of cls(response) :rtype: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SyncSet @@ -435,14 +444,18 @@ class SyncSetsOperations(object): error_map.update(kwargs.pop('error_map', {})) api_version = kwargs.pop('api_version', "2022-09-04") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'SyncSet') - request = build_create_or_update_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, resource_name=resource_name, - sync_set_resource_name=sync_set_resource_name, + child_resource_name=child_resource_name, api_version=api_version, + content_type=content_type, + json=_json, template_url=self.create_or_update.metadata['url'], ) request = _convert_request(request) @@ -470,7 +483,7 @@ class SyncSetsOperations(object): return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/syncSet/{syncSetResourceName}"} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/syncSet/{childResourceName}"} # type: ignore @distributed_trace @@ -478,7 +491,7 @@ class SyncSetsOperations(object): self, resource_group_name, # type: str resource_name, # type: str - sync_set_resource_name, # type: str + child_resource_name, # type: str **kwargs # type: Any ): # type: (...) -> None @@ -490,8 +503,8 @@ class SyncSetsOperations(object): :type resource_group_name: str :param resource_name: The name of the OpenShift cluster resource. :type resource_name: str - :param sync_set_resource_name: The name of the SyncSet resource. - :type sync_set_resource_name: str + :param child_resource_name: The name of the SyncSet resource. + :type child_resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -510,7 +523,7 @@ class SyncSetsOperations(object): subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, resource_name=resource_name, - sync_set_resource_name=sync_set_resource_name, + child_resource_name=child_resource_name, api_version=api_version, template_url=self.delete.metadata['url'], ) @@ -524,14 +537,14 @@ class SyncSetsOperations(object): ) response = pipeline_response.http_response - if response.status_code not in [202, 204]: + if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/syncSet/{syncSetResourceName}"} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/syncSet/{childResourceName}"} # type: ignore @distributed_trace @@ -539,11 +552,13 @@ class SyncSetsOperations(object): self, resource_group_name, # type: str resource_name, # type: str - sync_set_resource_name, # type: str + child_resource_name, # type: str + parameters, # type: "_models.SyncSetUpdate" **kwargs # type: Any ): # type: (...) -> "_models.SyncSet" - """Creates or updates a SyncSet with the specified subscription, resource group and resource name. + """Patches (create or update) a SyncSet with the specified subscription, resource group and + resource name. The operation returns properties of a SyncSet. @@ -551,8 +566,10 @@ class SyncSetsOperations(object): :type resource_group_name: str :param resource_name: The name of the OpenShift cluster resource. :type resource_name: str - :param sync_set_resource_name: The name of the SyncSet resource. - :type sync_set_resource_name: str + :param child_resource_name: The name of the SyncSet resource. + :type child_resource_name: str + :param parameters: The SyncSet resource. + :type parameters: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SyncSetUpdate :keyword callable cls: A custom type or function that will be passed the direct response :return: SyncSet, or the result of cls(response) :rtype: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SyncSet @@ -565,14 +582,18 @@ class SyncSetsOperations(object): error_map.update(kwargs.pop('error_map', {})) api_version = kwargs.pop('api_version', "2022-09-04") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'SyncSetUpdate') - request = build_update_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, resource_name=resource_name, - sync_set_resource_name=sync_set_resource_name, + child_resource_name=child_resource_name, api_version=api_version, + content_type=content_type, + json=_json, template_url=self.update.metadata['url'], ) request = _convert_request(request) @@ -600,5 +621,5 @@ class SyncSetsOperations(object): return deserialized - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/syncSet/{syncSetResourceName}"} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/syncSet/{childResourceName}"} # type: ignore diff --git a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/preview/2021-09-01-preview/examples/OpenShiftClusters_CreateOrUpdate.json b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/preview/2021-09-01-preview/examples/OpenShiftClusters_CreateOrUpdate.json index 0bea31cb6..9684f3163 100644 --- a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/preview/2021-09-01-preview/examples/OpenShiftClusters_CreateOrUpdate.json +++ b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/preview/2021-09-01-preview/examples/OpenShiftClusters_CreateOrUpdate.json @@ -4,7 +4,6 @@ "subscriptionId": "subscriptionId", "resourceGroupName": "resourceGroup", "resourceName": "resourceName", - "syncSetResourceName": "syncSetResourceName", "parameters": { "location": "location", "tags": { diff --git a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/preview/2021-09-01-preview/examples/OpenShiftClusters_Delete.json b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/preview/2021-09-01-preview/examples/OpenShiftClusters_Delete.json index 0901a2842..eabe1dac5 100644 --- a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/preview/2021-09-01-preview/examples/OpenShiftClusters_Delete.json +++ b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/preview/2021-09-01-preview/examples/OpenShiftClusters_Delete.json @@ -3,8 +3,7 @@ "api-version": "2021-09-01-preview", "subscriptionId": "subscriptionId", "resourceGroupName": "resourceGroup", - "resourceName": "resourceName", - "syncSetResourceName": "syncSetResourceName" + "resourceName": "resourceName" }, "responses": { "202": {}, diff --git a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/preview/2021-09-01-preview/examples/OpenShiftClusters_Get.json b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/preview/2021-09-01-preview/examples/OpenShiftClusters_Get.json index 90114a120..42a886401 100644 --- a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/preview/2021-09-01-preview/examples/OpenShiftClusters_Get.json +++ b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/preview/2021-09-01-preview/examples/OpenShiftClusters_Get.json @@ -3,8 +3,7 @@ "api-version": "2021-09-01-preview", "subscriptionId": "subscriptionId", "resourceGroupName": "resourceGroup", - "resourceName": "resourceName", - "syncSetResourceName": "syncSetResourceName" + "resourceName": "resourceName" }, "responses": { "200": { diff --git a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/preview/2021-09-01-preview/examples/OpenShiftClusters_ListAdminCredentials.json b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/preview/2021-09-01-preview/examples/OpenShiftClusters_ListAdminCredentials.json index cbb63939a..9adda4cfc 100644 --- a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/preview/2021-09-01-preview/examples/OpenShiftClusters_ListAdminCredentials.json +++ b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/preview/2021-09-01-preview/examples/OpenShiftClusters_ListAdminCredentials.json @@ -3,8 +3,7 @@ "api-version": "2021-09-01-preview", "subscriptionId": "subscriptionId", "resourceGroupName": "resourceGroup", - "resourceName": "resourceName", - "syncSetResourceName": "syncSetResourceName" + "resourceName": "resourceName" }, "responses": { "200": { diff --git a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/preview/2021-09-01-preview/examples/OpenShiftClusters_ListCredentials.json b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/preview/2021-09-01-preview/examples/OpenShiftClusters_ListCredentials.json index bc5e0d3d8..e2f8a89a6 100644 --- a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/preview/2021-09-01-preview/examples/OpenShiftClusters_ListCredentials.json +++ b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/preview/2021-09-01-preview/examples/OpenShiftClusters_ListCredentials.json @@ -3,8 +3,7 @@ "api-version": "2021-09-01-preview", "subscriptionId": "subscriptionId", "resourceGroupName": "resourceGroup", - "resourceName": "resourceName", - "syncSetResourceName": "syncSetResourceName" + "resourceName": "resourceName" }, "responses": { "200": { diff --git a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/preview/2021-09-01-preview/examples/OpenShiftClusters_Update.json b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/preview/2021-09-01-preview/examples/OpenShiftClusters_Update.json index ea7c27e70..5c35f160d 100644 --- a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/preview/2021-09-01-preview/examples/OpenShiftClusters_Update.json +++ b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/preview/2021-09-01-preview/examples/OpenShiftClusters_Update.json @@ -4,7 +4,6 @@ "subscriptionId": "subscriptionId", "resourceGroupName": "resourceGroup", "resourceName": "resourceName", - "syncSetResourceName": "syncSetResourceName", "parameters": { "tags": { "key": "value" diff --git a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2020-04-30/examples/OpenShiftClusters_CreateOrUpdate.json b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2020-04-30/examples/OpenShiftClusters_CreateOrUpdate.json index 2d45f28a9..c25bf4010 100644 --- a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2020-04-30/examples/OpenShiftClusters_CreateOrUpdate.json +++ b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2020-04-30/examples/OpenShiftClusters_CreateOrUpdate.json @@ -4,7 +4,6 @@ "subscriptionId": "subscriptionId", "resourceGroupName": "resourceGroup", "resourceName": "resourceName", - "syncSetResourceName": "syncSetResourceName", "parameters": { "location": "location", "tags": { diff --git a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2020-04-30/examples/OpenShiftClusters_Delete.json b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2020-04-30/examples/OpenShiftClusters_Delete.json index 592412c58..d851985e9 100644 --- a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2020-04-30/examples/OpenShiftClusters_Delete.json +++ b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2020-04-30/examples/OpenShiftClusters_Delete.json @@ -3,8 +3,7 @@ "api-version": "2020-04-30", "subscriptionId": "subscriptionId", "resourceGroupName": "resourceGroup", - "resourceName": "resourceName", - "syncSetResourceName": "syncSetResourceName" + "resourceName": "resourceName" }, "responses": { "202": {}, diff --git a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2020-04-30/examples/OpenShiftClusters_Get.json b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2020-04-30/examples/OpenShiftClusters_Get.json index 0ea834c13..504a8cfed 100644 --- a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2020-04-30/examples/OpenShiftClusters_Get.json +++ b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2020-04-30/examples/OpenShiftClusters_Get.json @@ -3,8 +3,7 @@ "api-version": "2020-04-30", "subscriptionId": "subscriptionId", "resourceGroupName": "resourceGroup", - "resourceName": "resourceName", - "syncSetResourceName": "syncSetResourceName" + "resourceName": "resourceName" }, "responses": { "200": { diff --git a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2020-04-30/examples/OpenShiftClusters_ListCredentials.json b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2020-04-30/examples/OpenShiftClusters_ListCredentials.json index 00bab26f7..aa749c7a2 100644 --- a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2020-04-30/examples/OpenShiftClusters_ListCredentials.json +++ b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2020-04-30/examples/OpenShiftClusters_ListCredentials.json @@ -3,8 +3,7 @@ "api-version": "2020-04-30", "subscriptionId": "subscriptionId", "resourceGroupName": "resourceGroup", - "resourceName": "resourceName", - "syncSetResourceName": "syncSetResourceName" + "resourceName": "resourceName" }, "responses": { "200": { diff --git a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2020-04-30/examples/OpenShiftClusters_Update.json b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2020-04-30/examples/OpenShiftClusters_Update.json index 3bfa6ed75..e4a13ea19 100644 --- a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2020-04-30/examples/OpenShiftClusters_Update.json +++ b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2020-04-30/examples/OpenShiftClusters_Update.json @@ -4,7 +4,6 @@ "subscriptionId": "subscriptionId", "resourceGroupName": "resourceGroup", "resourceName": "resourceName", - "syncSetResourceName": "syncSetResourceName", "parameters": { "tags": { "key": "value" diff --git a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-04-01/examples/OpenShiftClusters_CreateOrUpdate.json b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-04-01/examples/OpenShiftClusters_CreateOrUpdate.json index 4c60f52a5..38d560fe7 100644 --- a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-04-01/examples/OpenShiftClusters_CreateOrUpdate.json +++ b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-04-01/examples/OpenShiftClusters_CreateOrUpdate.json @@ -4,7 +4,6 @@ "subscriptionId": "subscriptionId", "resourceGroupName": "resourceGroup", "resourceName": "resourceName", - "syncSetResourceName": "syncSetResourceName", "parameters": { "location": "location", "tags": { diff --git a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-04-01/examples/OpenShiftClusters_Delete.json b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-04-01/examples/OpenShiftClusters_Delete.json index dbfc2b237..8ac3a44e9 100644 --- a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-04-01/examples/OpenShiftClusters_Delete.json +++ b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-04-01/examples/OpenShiftClusters_Delete.json @@ -3,8 +3,7 @@ "api-version": "2022-04-01", "subscriptionId": "subscriptionId", "resourceGroupName": "resourceGroup", - "resourceName": "resourceName", - "syncSetResourceName": "syncSetResourceName" + "resourceName": "resourceName" }, "responses": { "202": {}, diff --git a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-04-01/examples/OpenShiftClusters_Get.json b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-04-01/examples/OpenShiftClusters_Get.json index b53f8b9ef..7489aafe8 100644 --- a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-04-01/examples/OpenShiftClusters_Get.json +++ b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-04-01/examples/OpenShiftClusters_Get.json @@ -3,8 +3,7 @@ "api-version": "2022-04-01", "subscriptionId": "subscriptionId", "resourceGroupName": "resourceGroup", - "resourceName": "resourceName", - "syncSetResourceName": "syncSetResourceName" + "resourceName": "resourceName" }, "responses": { "200": { diff --git a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-04-01/examples/OpenShiftClusters_ListAdminCredentials.json b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-04-01/examples/OpenShiftClusters_ListAdminCredentials.json index b55b7dd39..4d0e6be7d 100644 --- a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-04-01/examples/OpenShiftClusters_ListAdminCredentials.json +++ b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-04-01/examples/OpenShiftClusters_ListAdminCredentials.json @@ -3,8 +3,7 @@ "api-version": "2022-04-01", "subscriptionId": "subscriptionId", "resourceGroupName": "resourceGroup", - "resourceName": "resourceName", - "syncSetResourceName": "syncSetResourceName" + "resourceName": "resourceName" }, "responses": { "200": { diff --git a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-04-01/examples/OpenShiftClusters_ListCredentials.json b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-04-01/examples/OpenShiftClusters_ListCredentials.json index d0c040424..ca057487f 100644 --- a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-04-01/examples/OpenShiftClusters_ListCredentials.json +++ b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-04-01/examples/OpenShiftClusters_ListCredentials.json @@ -3,8 +3,7 @@ "api-version": "2022-04-01", "subscriptionId": "subscriptionId", "resourceGroupName": "resourceGroup", - "resourceName": "resourceName", - "syncSetResourceName": "syncSetResourceName" + "resourceName": "resourceName" }, "responses": { "200": { diff --git a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-04-01/examples/OpenShiftClusters_Update.json b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-04-01/examples/OpenShiftClusters_Update.json index 5f33c5264..af782af47 100644 --- a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-04-01/examples/OpenShiftClusters_Update.json +++ b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-04-01/examples/OpenShiftClusters_Update.json @@ -4,7 +4,6 @@ "subscriptionId": "subscriptionId", "resourceGroupName": "resourceGroup", "resourceName": "resourceName", - "syncSetResourceName": "syncSetResourceName", "parameters": { "tags": { "key": "value" diff --git a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/MachinePools_CreateOrUpdate.json b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/MachinePools_CreateOrUpdate.json new file mode 100644 index 000000000..82b54231c --- /dev/null +++ b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/MachinePools_CreateOrUpdate.json @@ -0,0 +1,30 @@ +{ + "parameters": { + "api-version": "2022-09-04", + "subscriptionId": "subscriptionId", + "resourceGroupName": "resourceGroup", + "resourceName": "resourceName", + "childResourceName": "childResourceName", + "parameters": { + "properties": { + "resources": "ewogICAgImFwaVZlcnNpb24iOiAiaGl2ZS5vcGVuc2hpZnQuaW8vdjEiLAogICAgImtpbmQiOiAiTWFjaGluZVBvb2wiLAogICAgIm1ldGFkYXRhIjogewogICAgICAgICJuYW1lIjogInRlc3QtY2x1c3Rlci13b3JrZXIiLAogICAgICAgICJuYW1lc3BhY2UiOiAiYXJvLWY2MGFlOGEyLWJjYTEtNDk4Ny05MDU2LVhYWFhYWFhYWFhYWCIKICAgIH0sCiAgICAic3BlYyI6IHsKICAgICAgICAiY2x1c3RlckRlcGxveW1lbnRSZWYiOiB7CiAgICAgICAgICAgICJuYW1lIjogInRlc3QtY2x1c3RlciIKICAgICAgICB9LAogICAgICAgICJuYW1lIjogIndvcmtlciIsCiAgICAgICAgInBsYXRmb3JtIjogewogICAgICAgICAgICAiYXdzIjogewogICAgICAgICAgICAgICAgInJvb3RWb2x1bWUiOiB7CiAgICAgICAgICAgICAgICAgICAgImlvcHMiOiAwLAogICAgICAgICAgICAgICAgICAgICJzaXplIjogMzAwLAogICAgICAgICAgICAgICAgICAgICJ0eXBlIjogImdwMyIKICAgICAgICAgICAgICAgIH0sCiAgICAgICAgICAgICAgICAidHlwZSI6ICJtNS54bGFyZ2UiLAogICAgICAgICAgICAgICAgInpvbmVzIjogWwogICAgICAgICAgICAgICAgICAgICJ1cy1lYXN0LTFhIgogICAgICAgICAgICAgICAgXQogICAgICAgICAgICB9CiAgICAgICAgfSwKICAgICAgICAicmVwbGljYXMiOiAyCiAgICB9LAogICAgInN0YXR1cyI6IHsKICAgICAgICAiY29uZGl0aW9ucyI6IFsKICAgICAgICBdCiAgICB9Cn0K" + } + } + }, + "responses": { + "200": { + "body": { + "properties": { + "resources": "eyAKICAiYXBpVmVyc2lvbiI6ICJoaXZlLm9wZW5zaGlmdC5pby92MSIsCiAgImtpbmQiOiAiU3luY1NldCIsCiAgIm1ldGFkYXRhIjogewogICAgIm5hbWUiOiAic2FtcGxlIiwKICAgICJuYW1lc3BhY2UiOiAiYXJvLWY2MGFlOGEyLWJjYTEtNDk4Ny05MDU2LWYyZjZhMTgzN2NhYSIKICB9LAogICJzcGVjIjogewogICAgImNsdXN0ZXJEZXBsb3ltZW50UmVmcyI6IFtdLAogICAgInJlc291cmNlcyI6IFsKICAgICAgewogICAgICAgICJhcGlWZXJzaW9uIjogInYxIiwKICAgICAgICAia2luZCI6ICJDb25maWdNYXAiLAogICAgICAgICJtZXRhZGF0YSI6IHsKICAgICAgICAgICJuYW1lIjogIm15Y29uZmlnbWFwIgogICAgICAgIH0KICAgICAgfQogICAgXQogIH0KfQo=" + } + } + }, + "201": { + "body": { + "properties": { + "resources": "eyAKICAiYXBpVmVyc2lvbiI6ICJoaXZlLm9wZW5zaGlmdC5pby92MSIsCiAgImtpbmQiOiAiU3luY1NldCIsCiAgIm1ldGFkYXRhIjogewogICAgIm5hbWUiOiAic2FtcGxlIiwKICAgICJuYW1lc3BhY2UiOiAiYXJvLWY2MGFlOGEyLWJjYTEtNDk4Ny05MDU2LWYyZjZhMTgzN2NhYSIKICB9LAogICJzcGVjIjogewogICAgImNsdXN0ZXJEZXBsb3ltZW50UmVmcyI6IFtdLAogICAgInJlc291cmNlcyI6IFsKICAgICAgewogICAgICAgICJhcGlWZXJzaW9uIjogInYxIiwKICAgICAgICAia2luZCI6ICJDb25maWdNYXAiLAogICAgICAgICJtZXRhZGF0YSI6IHsKICAgICAgICAgICJuYW1lIjogIm15Y29uZmlnbWFwIgogICAgICAgIH0KICAgICAgfQogICAgXQogIH0KfQo=" + } + } + } + } +} diff --git a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/MachinePools_Delete.json b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/MachinePools_Delete.json new file mode 100644 index 000000000..ceec18a1e --- /dev/null +++ b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/MachinePools_Delete.json @@ -0,0 +1,13 @@ +{ + "parameters": { + "api-version": "2022-09-04", + "subscriptionId": "subscriptionId", + "resourceGroupName": "resourceGroup", + "resourceName": "resourceName", + "childResourceName": "childResourceName" + }, + "responses": { + "200": {}, + "204": {} + } +} diff --git a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/MachinePools_Get.json b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/MachinePools_Get.json new file mode 100644 index 000000000..5a9651690 --- /dev/null +++ b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/MachinePools_Get.json @@ -0,0 +1,18 @@ +{ + "parameters": { + "api-version": "2022-09-04", + "subscriptionId": "subscriptionId", + "resourceGroupName": "resourceGroup", + "resourceName": "resourceName", + "childResourceName": "childResourceName" + }, + "responses": { + "200": { + "body": { + "properties": { + "resources": "eyAKICAiYXBpVmVyc2lvbiI6ICJoaXZlLm9wZW5zaGlmdC5pby92MSIsCiAgImtpbmQiOiAiU3luY1NldCIsCiAgIm1ldGFkYXRhIjogewogICAgIm5hbWUiOiAic2FtcGxlIiwKICAgICJuYW1lc3BhY2UiOiAiYXJvLWY2MGFlOGEyLWJjYTEtNDk4Ny05MDU2LWYyZjZhMTgzN2NhYSIKICB9LAogICJzcGVjIjogewogICAgImNsdXN0ZXJEZXBsb3ltZW50UmVmcyI6IFtdLAogICAgInJlc291cmNlcyI6IFsKICAgICAgewogICAgICAgICJhcGlWZXJzaW9uIjogInYxIiwKICAgICAgICAia2luZCI6ICJDb25maWdNYXAiLAogICAgICAgICJtZXRhZGF0YSI6IHsKICAgICAgICAgICJuYW1lIjogIm15Y29uZmlnbWFwIgogICAgICAgIH0KICAgICAgfQogICAgXQogIH0KfQo=" + } + } + } + } +} diff --git a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/MachinePools_List.json b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/MachinePools_List.json new file mode 100644 index 000000000..20795a189 --- /dev/null +++ b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/MachinePools_List.json @@ -0,0 +1,21 @@ +{ + "parameters": { + "api-version": "2022-09-04", + "subscriptionId": "subscriptionId", + "resourceGroupName": "resourceGroup", + "resourceName": "resourceName" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "properties": { + "resources": "eyAKICAiYXBpVmVyc2lvbiI6ICJoaXZlLm9wZW5zaGlmdC5pby92MSIsCiAgImtpbmQiOiAiU3luY1NldCIsCiAgIm1ldGFkYXRhIjogewogICAgIm5hbWUiOiAic2FtcGxlIiwKICAgICJuYW1lc3BhY2UiOiAiYXJvLWY2MGFlOGEyLWJjYTEtNDk4Ny05MDU2LWYyZjZhMTgzN2NhYSIKICB9LAogICJzcGVjIjogewogICAgImNsdXN0ZXJEZXBsb3ltZW50UmVmcyI6IFtdLAogICAgInJlc291cmNlcyI6IFsKICAgICAgewogICAgICAgICJhcGlWZXJzaW9uIjogInYxIiwKICAgICAgICAia2luZCI6ICJDb25maWdNYXAiLAogICAgICAgICJtZXRhZGF0YSI6IHsKICAgICAgICAgICJuYW1lIjogIm15Y29uZmlnbWFwIgogICAgICAgIH0KICAgICAgfQogICAgXQogIH0KfQo=" + } + } + ] + } + } + } +} diff --git a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/MachinePools_Update.json b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/MachinePools_Update.json new file mode 100644 index 000000000..82b54231c --- /dev/null +++ b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/MachinePools_Update.json @@ -0,0 +1,30 @@ +{ + "parameters": { + "api-version": "2022-09-04", + "subscriptionId": "subscriptionId", + "resourceGroupName": "resourceGroup", + "resourceName": "resourceName", + "childResourceName": "childResourceName", + "parameters": { + "properties": { + "resources": "ewogICAgImFwaVZlcnNpb24iOiAiaGl2ZS5vcGVuc2hpZnQuaW8vdjEiLAogICAgImtpbmQiOiAiTWFjaGluZVBvb2wiLAogICAgIm1ldGFkYXRhIjogewogICAgICAgICJuYW1lIjogInRlc3QtY2x1c3Rlci13b3JrZXIiLAogICAgICAgICJuYW1lc3BhY2UiOiAiYXJvLWY2MGFlOGEyLWJjYTEtNDk4Ny05MDU2LVhYWFhYWFhYWFhYWCIKICAgIH0sCiAgICAic3BlYyI6IHsKICAgICAgICAiY2x1c3RlckRlcGxveW1lbnRSZWYiOiB7CiAgICAgICAgICAgICJuYW1lIjogInRlc3QtY2x1c3RlciIKICAgICAgICB9LAogICAgICAgICJuYW1lIjogIndvcmtlciIsCiAgICAgICAgInBsYXRmb3JtIjogewogICAgICAgICAgICAiYXdzIjogewogICAgICAgICAgICAgICAgInJvb3RWb2x1bWUiOiB7CiAgICAgICAgICAgICAgICAgICAgImlvcHMiOiAwLAogICAgICAgICAgICAgICAgICAgICJzaXplIjogMzAwLAogICAgICAgICAgICAgICAgICAgICJ0eXBlIjogImdwMyIKICAgICAgICAgICAgICAgIH0sCiAgICAgICAgICAgICAgICAidHlwZSI6ICJtNS54bGFyZ2UiLAogICAgICAgICAgICAgICAgInpvbmVzIjogWwogICAgICAgICAgICAgICAgICAgICJ1cy1lYXN0LTFhIgogICAgICAgICAgICAgICAgXQogICAgICAgICAgICB9CiAgICAgICAgfSwKICAgICAgICAicmVwbGljYXMiOiAyCiAgICB9LAogICAgInN0YXR1cyI6IHsKICAgICAgICAiY29uZGl0aW9ucyI6IFsKICAgICAgICBdCiAgICB9Cn0K" + } + } + }, + "responses": { + "200": { + "body": { + "properties": { + "resources": "eyAKICAiYXBpVmVyc2lvbiI6ICJoaXZlLm9wZW5zaGlmdC5pby92MSIsCiAgImtpbmQiOiAiU3luY1NldCIsCiAgIm1ldGFkYXRhIjogewogICAgIm5hbWUiOiAic2FtcGxlIiwKICAgICJuYW1lc3BhY2UiOiAiYXJvLWY2MGFlOGEyLWJjYTEtNDk4Ny05MDU2LWYyZjZhMTgzN2NhYSIKICB9LAogICJzcGVjIjogewogICAgImNsdXN0ZXJEZXBsb3ltZW50UmVmcyI6IFtdLAogICAgInJlc291cmNlcyI6IFsKICAgICAgewogICAgICAgICJhcGlWZXJzaW9uIjogInYxIiwKICAgICAgICAia2luZCI6ICJDb25maWdNYXAiLAogICAgICAgICJtZXRhZGF0YSI6IHsKICAgICAgICAgICJuYW1lIjogIm15Y29uZmlnbWFwIgogICAgICAgIH0KICAgICAgfQogICAgXQogIH0KfQo=" + } + } + }, + "201": { + "body": { + "properties": { + "resources": "eyAKICAiYXBpVmVyc2lvbiI6ICJoaXZlLm9wZW5zaGlmdC5pby92MSIsCiAgImtpbmQiOiAiU3luY1NldCIsCiAgIm1ldGFkYXRhIjogewogICAgIm5hbWUiOiAic2FtcGxlIiwKICAgICJuYW1lc3BhY2UiOiAiYXJvLWY2MGFlOGEyLWJjYTEtNDk4Ny05MDU2LWYyZjZhMTgzN2NhYSIKICB9LAogICJzcGVjIjogewogICAgImNsdXN0ZXJEZXBsb3ltZW50UmVmcyI6IFtdLAogICAgInJlc291cmNlcyI6IFsKICAgICAgewogICAgICAgICJhcGlWZXJzaW9uIjogInYxIiwKICAgICAgICAia2luZCI6ICJDb25maWdNYXAiLAogICAgICAgICJtZXRhZGF0YSI6IHsKICAgICAgICAgICJuYW1lIjogIm15Y29uZmlnbWFwIgogICAgICAgIH0KICAgICAgfQogICAgXQogIH0KfQo=" + } + } + } + } +} diff --git a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/OpenShiftClusters_CreateOrUpdate.json b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/OpenShiftClusters_CreateOrUpdate.json index 5e157a2d7..d3efc5ced 100644 --- a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/OpenShiftClusters_CreateOrUpdate.json +++ b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/OpenShiftClusters_CreateOrUpdate.json @@ -4,7 +4,6 @@ "subscriptionId": "subscriptionId", "resourceGroupName": "resourceGroup", "resourceName": "resourceName", - "syncSetResourceName": "syncSetResourceName", "parameters": { "location": "location", "tags": { diff --git a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/OpenShiftClusters_Delete.json b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/OpenShiftClusters_Delete.json index 45db57820..f0a504d0c 100644 --- a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/OpenShiftClusters_Delete.json +++ b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/OpenShiftClusters_Delete.json @@ -3,8 +3,7 @@ "api-version": "2022-09-04", "subscriptionId": "subscriptionId", "resourceGroupName": "resourceGroup", - "resourceName": "resourceName", - "syncSetResourceName": "syncSetResourceName" + "resourceName": "resourceName" }, "responses": { "202": {}, diff --git a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/OpenShiftClusters_Get.json b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/OpenShiftClusters_Get.json index e42077082..4d7802946 100644 --- a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/OpenShiftClusters_Get.json +++ b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/OpenShiftClusters_Get.json @@ -3,8 +3,7 @@ "api-version": "2022-09-04", "subscriptionId": "subscriptionId", "resourceGroupName": "resourceGroup", - "resourceName": "resourceName", - "syncSetResourceName": "syncSetResourceName" + "resourceName": "resourceName" }, "responses": { "200": { diff --git a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/OpenShiftClusters_ListAdminCredentials.json b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/OpenShiftClusters_ListAdminCredentials.json index 16991db9e..6d66ba584 100644 --- a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/OpenShiftClusters_ListAdminCredentials.json +++ b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/OpenShiftClusters_ListAdminCredentials.json @@ -3,8 +3,7 @@ "api-version": "2022-09-04", "subscriptionId": "subscriptionId", "resourceGroupName": "resourceGroup", - "resourceName": "resourceName", - "syncSetResourceName": "syncSetResourceName" + "resourceName": "resourceName" }, "responses": { "200": { diff --git a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/OpenShiftClusters_ListCredentials.json b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/OpenShiftClusters_ListCredentials.json index 12d24a36d..b14349983 100644 --- a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/OpenShiftClusters_ListCredentials.json +++ b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/OpenShiftClusters_ListCredentials.json @@ -3,8 +3,7 @@ "api-version": "2022-09-04", "subscriptionId": "subscriptionId", "resourceGroupName": "resourceGroup", - "resourceName": "resourceName", - "syncSetResourceName": "syncSetResourceName" + "resourceName": "resourceName" }, "responses": { "200": { diff --git a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/OpenShiftClusters_Update.json b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/OpenShiftClusters_Update.json index 4ecbf8bd3..9ef82e4ae 100644 --- a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/OpenShiftClusters_Update.json +++ b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/OpenShiftClusters_Update.json @@ -4,7 +4,6 @@ "subscriptionId": "subscriptionId", "resourceGroupName": "resourceGroup", "resourceName": "resourceName", - "syncSetResourceName": "syncSetResourceName", "parameters": { "tags": { "key": "value" diff --git a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/Secrets_CreateOrUpdate.json b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/Secrets_CreateOrUpdate.json new file mode 100644 index 000000000..16fb1ef83 --- /dev/null +++ b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/Secrets_CreateOrUpdate.json @@ -0,0 +1,24 @@ +{ + "parameters": { + "api-version": "2022-09-04", + "subscriptionId": "subscriptionId", + "resourceGroupName": "resourceGroup", + "resourceName": "resourceName", + "childResourceName": "childResourceName", + "parameters": { + "properties": {} + } + }, + "responses": { + "200": { + "body": { + "properties": {} + } + }, + "201": { + "body": { + "properties": {} + } + } + } +} diff --git a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/Secrets_Delete.json b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/Secrets_Delete.json new file mode 100644 index 000000000..ceec18a1e --- /dev/null +++ b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/Secrets_Delete.json @@ -0,0 +1,13 @@ +{ + "parameters": { + "api-version": "2022-09-04", + "subscriptionId": "subscriptionId", + "resourceGroupName": "resourceGroup", + "resourceName": "resourceName", + "childResourceName": "childResourceName" + }, + "responses": { + "200": {}, + "204": {} + } +} diff --git a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/Secrets_Get.json b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/Secrets_Get.json new file mode 100644 index 000000000..9ae1678a6 --- /dev/null +++ b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/Secrets_Get.json @@ -0,0 +1,16 @@ +{ + "parameters": { + "api-version": "2022-09-04", + "subscriptionId": "subscriptionId", + "resourceGroupName": "resourceGroup", + "resourceName": "resourceName", + "childResourceName": "childResourceName" + }, + "responses": { + "200": { + "body": { + "properties": {} + } + } + } +} diff --git a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/Secrets_List.json b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/Secrets_List.json new file mode 100644 index 000000000..dc12e651c --- /dev/null +++ b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/Secrets_List.json @@ -0,0 +1,19 @@ +{ + "parameters": { + "api-version": "2022-09-04", + "subscriptionId": "subscriptionId", + "resourceGroupName": "resourceGroup", + "resourceName": "resourceName" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "properties": {} + } + ] + } + } + } +} diff --git a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/Secrets_Update.json b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/Secrets_Update.json new file mode 100644 index 000000000..16fb1ef83 --- /dev/null +++ b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/Secrets_Update.json @@ -0,0 +1,24 @@ +{ + "parameters": { + "api-version": "2022-09-04", + "subscriptionId": "subscriptionId", + "resourceGroupName": "resourceGroup", + "resourceName": "resourceName", + "childResourceName": "childResourceName", + "parameters": { + "properties": {} + } + }, + "responses": { + "200": { + "body": { + "properties": {} + } + }, + "201": { + "body": { + "properties": {} + } + } + } +} diff --git a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/SyncIdentityProviders_CreateOrUpdate.json b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/SyncIdentityProviders_CreateOrUpdate.json new file mode 100644 index 000000000..3830160e2 --- /dev/null +++ b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/SyncIdentityProviders_CreateOrUpdate.json @@ -0,0 +1,30 @@ +{ + "parameters": { + "api-version": "2022-09-04", + "subscriptionId": "subscriptionId", + "resourceGroupName": "resourceGroup", + "resourceName": "resourceName", + "childResourceName": "childResourceName", + "parameters": { + "properties": { + "resources": "ewogICAgImFwaVZlcnNpb24iOiAiaGl2ZS5vcGVuc2hpZnQuaW8vdjEiLAogICAgImtpbmQiOiAiU3luY0lkZW50aXR5UHJvdmlkZXIiLAogICAgIm1ldGFkYXRhIjogewogICAgICAgICJuYW1lIjogInRlc3QtY2x1c3RlciIsCiAgICAgICAgIm5hbWVzcGFjZSI6ICJhcm8tZjYwYWU4YTItYmNhMS00OTg3LTkwNTYtWFhYWFhYWFhYWFhYIgogICAgfSwKICAgICJzcGVjIjogewogICAgICAgICJjbHVzdGVyRGVwbG95bWVudFJlZnMiOiBbCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICJuYW1lIjogInRlc3QtY2x1c3RlciIKICAgICAgICAgICAgfQogICAgICAgIF0sCiAgICAgICAgImlkZW50aXR5UHJvdmlkZXJzIjogWwogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAiaHRwYXNzd2QiOiB7CiAgICAgICAgICAgICAgICAgICAgImZpbGVEYXRhIjogewogICAgICAgICAgICAgICAgICAgICAgICAibmFtZSI6ICJodHBhc3N3ZC1zZWNyZXQiCiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfSwKICAgICAgICAgICAgICAgICJtYXBwaW5nTWV0aG9kIjogImNsYWltIiwKICAgICAgICAgICAgICAgICJuYW1lIjogIkhUUGFzc3dkIiwKICAgICAgICAgICAgICAgICJ0eXBlIjogIkhUUGFzc3dkIgogICAgICAgICAgICB9CiAgICAgICAgXQogICAgfSwKICAgICJzdGF0dXMiOiB7fQp9Cg==" + } + } + }, + "responses": { + "200": { + "body": { + "properties": { + "resources": "eyAKICAiYXBpVmVyc2lvbiI6ICJoaXZlLm9wZW5zaGlmdC5pby92MSIsCiAgImtpbmQiOiAiU3luY1NldCIsCiAgIm1ldGFkYXRhIjogewogICAgIm5hbWUiOiAic2FtcGxlIiwKICAgICJuYW1lc3BhY2UiOiAiYXJvLWY2MGFlOGEyLWJjYTEtNDk4Ny05MDU2LWYyZjZhMTgzN2NhYSIKICB9LAogICJzcGVjIjogewogICAgImNsdXN0ZXJEZXBsb3ltZW50UmVmcyI6IFtdLAogICAgInJlc291cmNlcyI6IFsKICAgICAgewogICAgICAgICJhcGlWZXJzaW9uIjogInYxIiwKICAgICAgICAia2luZCI6ICJDb25maWdNYXAiLAogICAgICAgICJtZXRhZGF0YSI6IHsKICAgICAgICAgICJuYW1lIjogIm15Y29uZmlnbWFwIgogICAgICAgIH0KICAgICAgfQogICAgXQogIH0KfQo=" + } + } + }, + "201": { + "body": { + "properties": { + "resources": "eyAKICAiYXBpVmVyc2lvbiI6ICJoaXZlLm9wZW5zaGlmdC5pby92MSIsCiAgImtpbmQiOiAiU3luY1NldCIsCiAgIm1ldGFkYXRhIjogewogICAgIm5hbWUiOiAic2FtcGxlIiwKICAgICJuYW1lc3BhY2UiOiAiYXJvLWY2MGFlOGEyLWJjYTEtNDk4Ny05MDU2LWYyZjZhMTgzN2NhYSIKICB9LAogICJzcGVjIjogewogICAgImNsdXN0ZXJEZXBsb3ltZW50UmVmcyI6IFtdLAogICAgInJlc291cmNlcyI6IFsKICAgICAgewogICAgICAgICJhcGlWZXJzaW9uIjogInYxIiwKICAgICAgICAia2luZCI6ICJDb25maWdNYXAiLAogICAgICAgICJtZXRhZGF0YSI6IHsKICAgICAgICAgICJuYW1lIjogIm15Y29uZmlnbWFwIgogICAgICAgIH0KICAgICAgfQogICAgXQogIH0KfQo=" + } + } + } + } +} diff --git a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/SyncIdentityProviders_Delete.json b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/SyncIdentityProviders_Delete.json new file mode 100644 index 000000000..ceec18a1e --- /dev/null +++ b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/SyncIdentityProviders_Delete.json @@ -0,0 +1,13 @@ +{ + "parameters": { + "api-version": "2022-09-04", + "subscriptionId": "subscriptionId", + "resourceGroupName": "resourceGroup", + "resourceName": "resourceName", + "childResourceName": "childResourceName" + }, + "responses": { + "200": {}, + "204": {} + } +} diff --git a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/SyncIdentityProviders_Get.json b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/SyncIdentityProviders_Get.json new file mode 100644 index 000000000..5a9651690 --- /dev/null +++ b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/SyncIdentityProviders_Get.json @@ -0,0 +1,18 @@ +{ + "parameters": { + "api-version": "2022-09-04", + "subscriptionId": "subscriptionId", + "resourceGroupName": "resourceGroup", + "resourceName": "resourceName", + "childResourceName": "childResourceName" + }, + "responses": { + "200": { + "body": { + "properties": { + "resources": "eyAKICAiYXBpVmVyc2lvbiI6ICJoaXZlLm9wZW5zaGlmdC5pby92MSIsCiAgImtpbmQiOiAiU3luY1NldCIsCiAgIm1ldGFkYXRhIjogewogICAgIm5hbWUiOiAic2FtcGxlIiwKICAgICJuYW1lc3BhY2UiOiAiYXJvLWY2MGFlOGEyLWJjYTEtNDk4Ny05MDU2LWYyZjZhMTgzN2NhYSIKICB9LAogICJzcGVjIjogewogICAgImNsdXN0ZXJEZXBsb3ltZW50UmVmcyI6IFtdLAogICAgInJlc291cmNlcyI6IFsKICAgICAgewogICAgICAgICJhcGlWZXJzaW9uIjogInYxIiwKICAgICAgICAia2luZCI6ICJDb25maWdNYXAiLAogICAgICAgICJtZXRhZGF0YSI6IHsKICAgICAgICAgICJuYW1lIjogIm15Y29uZmlnbWFwIgogICAgICAgIH0KICAgICAgfQogICAgXQogIH0KfQo=" + } + } + } + } +} diff --git a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/SyncIdentityProviders_List.json b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/SyncIdentityProviders_List.json new file mode 100644 index 000000000..20795a189 --- /dev/null +++ b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/SyncIdentityProviders_List.json @@ -0,0 +1,21 @@ +{ + "parameters": { + "api-version": "2022-09-04", + "subscriptionId": "subscriptionId", + "resourceGroupName": "resourceGroup", + "resourceName": "resourceName" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "properties": { + "resources": "eyAKICAiYXBpVmVyc2lvbiI6ICJoaXZlLm9wZW5zaGlmdC5pby92MSIsCiAgImtpbmQiOiAiU3luY1NldCIsCiAgIm1ldGFkYXRhIjogewogICAgIm5hbWUiOiAic2FtcGxlIiwKICAgICJuYW1lc3BhY2UiOiAiYXJvLWY2MGFlOGEyLWJjYTEtNDk4Ny05MDU2LWYyZjZhMTgzN2NhYSIKICB9LAogICJzcGVjIjogewogICAgImNsdXN0ZXJEZXBsb3ltZW50UmVmcyI6IFtdLAogICAgInJlc291cmNlcyI6IFsKICAgICAgewogICAgICAgICJhcGlWZXJzaW9uIjogInYxIiwKICAgICAgICAia2luZCI6ICJDb25maWdNYXAiLAogICAgICAgICJtZXRhZGF0YSI6IHsKICAgICAgICAgICJuYW1lIjogIm15Y29uZmlnbWFwIgogICAgICAgIH0KICAgICAgfQogICAgXQogIH0KfQo=" + } + } + ] + } + } + } +} diff --git a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/SyncIdentityProviders_Update.json b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/SyncIdentityProviders_Update.json new file mode 100644 index 000000000..3830160e2 --- /dev/null +++ b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/SyncIdentityProviders_Update.json @@ -0,0 +1,30 @@ +{ + "parameters": { + "api-version": "2022-09-04", + "subscriptionId": "subscriptionId", + "resourceGroupName": "resourceGroup", + "resourceName": "resourceName", + "childResourceName": "childResourceName", + "parameters": { + "properties": { + "resources": "ewogICAgImFwaVZlcnNpb24iOiAiaGl2ZS5vcGVuc2hpZnQuaW8vdjEiLAogICAgImtpbmQiOiAiU3luY0lkZW50aXR5UHJvdmlkZXIiLAogICAgIm1ldGFkYXRhIjogewogICAgICAgICJuYW1lIjogInRlc3QtY2x1c3RlciIsCiAgICAgICAgIm5hbWVzcGFjZSI6ICJhcm8tZjYwYWU4YTItYmNhMS00OTg3LTkwNTYtWFhYWFhYWFhYWFhYIgogICAgfSwKICAgICJzcGVjIjogewogICAgICAgICJjbHVzdGVyRGVwbG95bWVudFJlZnMiOiBbCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICJuYW1lIjogInRlc3QtY2x1c3RlciIKICAgICAgICAgICAgfQogICAgICAgIF0sCiAgICAgICAgImlkZW50aXR5UHJvdmlkZXJzIjogWwogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAiaHRwYXNzd2QiOiB7CiAgICAgICAgICAgICAgICAgICAgImZpbGVEYXRhIjogewogICAgICAgICAgICAgICAgICAgICAgICAibmFtZSI6ICJodHBhc3N3ZC1zZWNyZXQiCiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfSwKICAgICAgICAgICAgICAgICJtYXBwaW5nTWV0aG9kIjogImNsYWltIiwKICAgICAgICAgICAgICAgICJuYW1lIjogIkhUUGFzc3dkIiwKICAgICAgICAgICAgICAgICJ0eXBlIjogIkhUUGFzc3dkIgogICAgICAgICAgICB9CiAgICAgICAgXQogICAgfSwKICAgICJzdGF0dXMiOiB7fQp9Cg==" + } + } + }, + "responses": { + "200": { + "body": { + "properties": { + "resources": "eyAKICAiYXBpVmVyc2lvbiI6ICJoaXZlLm9wZW5zaGlmdC5pby92MSIsCiAgImtpbmQiOiAiU3luY1NldCIsCiAgIm1ldGFkYXRhIjogewogICAgIm5hbWUiOiAic2FtcGxlIiwKICAgICJuYW1lc3BhY2UiOiAiYXJvLWY2MGFlOGEyLWJjYTEtNDk4Ny05MDU2LWYyZjZhMTgzN2NhYSIKICB9LAogICJzcGVjIjogewogICAgImNsdXN0ZXJEZXBsb3ltZW50UmVmcyI6IFtdLAogICAgInJlc291cmNlcyI6IFsKICAgICAgewogICAgICAgICJhcGlWZXJzaW9uIjogInYxIiwKICAgICAgICAia2luZCI6ICJDb25maWdNYXAiLAogICAgICAgICJtZXRhZGF0YSI6IHsKICAgICAgICAgICJuYW1lIjogIm15Y29uZmlnbWFwIgogICAgICAgIH0KICAgICAgfQogICAgXQogIH0KfQo=" + } + } + }, + "201": { + "body": { + "properties": { + "resources": "eyAKICAiYXBpVmVyc2lvbiI6ICJoaXZlLm9wZW5zaGlmdC5pby92MSIsCiAgImtpbmQiOiAiU3luY1NldCIsCiAgIm1ldGFkYXRhIjogewogICAgIm5hbWUiOiAic2FtcGxlIiwKICAgICJuYW1lc3BhY2UiOiAiYXJvLWY2MGFlOGEyLWJjYTEtNDk4Ny05MDU2LWYyZjZhMTgzN2NhYSIKICB9LAogICJzcGVjIjogewogICAgImNsdXN0ZXJEZXBsb3ltZW50UmVmcyI6IFtdLAogICAgInJlc291cmNlcyI6IFsKICAgICAgewogICAgICAgICJhcGlWZXJzaW9uIjogInYxIiwKICAgICAgICAia2luZCI6ICJDb25maWdNYXAiLAogICAgICAgICJtZXRhZGF0YSI6IHsKICAgICAgICAgICJuYW1lIjogIm15Y29uZmlnbWFwIgogICAgICAgIH0KICAgICAgfQogICAgXQogIH0KfQo=" + } + } + } + } +} diff --git a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/SyncSets_CreateOrUpdate.json b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/SyncSets_CreateOrUpdate.json index bd7b68583..7533f1f40 100644 --- a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/SyncSets_CreateOrUpdate.json +++ b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/SyncSets_CreateOrUpdate.json @@ -4,25 +4,24 @@ "subscriptionId": "subscriptionId", "resourceGroupName": "resourceGroup", "resourceName": "resourceName", - "syncSetResourceName": "syncSetResourceName" + "childResourceName": "childResourceName", + "parameters": { + "properties": { + "resources": "eyAKICAiYXBpVmVyc2lvbiI6ICJoaXZlLm9wZW5zaGlmdC5pby92MSIsCiAgImtpbmQiOiAiU3luY1NldCIsCiAgIm1ldGFkYXRhIjogewogICAgIm5hbWUiOiAic2FtcGxlIiwKICAgICJuYW1lc3BhY2UiOiAiYXJvLWY2MGFlOGEyLWJjYTEtNDk4Ny05MDU2LWYyZjZhMTgzN2NhYSIKICB9LAogICJzcGVjIjogewogICAgImNsdXN0ZXJEZXBsb3ltZW50UmVmcyI6IFtdLAogICAgInJlc291cmNlcyI6IFsKICAgICAgewogICAgICAgICJhcGlWZXJzaW9uIjogInYxIiwKICAgICAgICAia2luZCI6ICJDb25maWdNYXAiLAogICAgICAgICJtZXRhZGF0YSI6IHsKICAgICAgICAgICJuYW1lIjogIm15Y29uZmlnbWFwIgogICAgICAgIH0KICAgICAgfQogICAgXQogIH0KfQo=" + } + } }, "responses": { "200": { "body": { - "id": "/subscriptions/subscriptionId/resourceGroups/resourceGroup/providers/Microsoft.RedHatOpenShift/OpenShiftClusters/resourceName/syncSets/mySyncSet", - "name": "mySyncSet", "properties": { - "clusterResourceId": "/subscriptions/subscriptionid/resourcegroups/resourcegroup/providers/microsoft.redhatopenshift/openshiftclusters/resourcename", "resources": "eyAKICAiYXBpVmVyc2lvbiI6ICJoaXZlLm9wZW5zaGlmdC5pby92MSIsCiAgImtpbmQiOiAiU3luY1NldCIsCiAgIm1ldGFkYXRhIjogewogICAgIm5hbWUiOiAic2FtcGxlIiwKICAgICJuYW1lc3BhY2UiOiAiYXJvLWY2MGFlOGEyLWJjYTEtNDk4Ny05MDU2LWYyZjZhMTgzN2NhYSIKICB9LAogICJzcGVjIjogewogICAgImNsdXN0ZXJEZXBsb3ltZW50UmVmcyI6IFtdLAogICAgInJlc291cmNlcyI6IFsKICAgICAgewogICAgICAgICJhcGlWZXJzaW9uIjogInYxIiwKICAgICAgICAia2luZCI6ICJDb25maWdNYXAiLAogICAgICAgICJtZXRhZGF0YSI6IHsKICAgICAgICAgICJuYW1lIjogIm15Y29uZmlnbWFwIgogICAgICAgIH0KICAgICAgfQogICAgXQogIH0KfQo=" } } }, "201": { "body": { - "id": "/subscriptions/subscriptionId/resourceGroups/resourceGroup/providers/Microsoft.RedHatOpenShift/OpenShiftClusters/resourceName/syncSets/mySyncSet", - "name": "mySyncSet", "properties": { - "clusterResourceId": "/subscriptions/subscriptionid/resourcegroups/resourcegroup/providers/microsoft.redhatopenshift/openshiftclusters/resourcename", "resources": "eyAKICAiYXBpVmVyc2lvbiI6ICJoaXZlLm9wZW5zaGlmdC5pby92MSIsCiAgImtpbmQiOiAiU3luY1NldCIsCiAgIm1ldGFkYXRhIjogewogICAgIm5hbWUiOiAic2FtcGxlIiwKICAgICJuYW1lc3BhY2UiOiAiYXJvLWY2MGFlOGEyLWJjYTEtNDk4Ny05MDU2LWYyZjZhMTgzN2NhYSIKICB9LAogICJzcGVjIjogewogICAgImNsdXN0ZXJEZXBsb3ltZW50UmVmcyI6IFtdLAogICAgInJlc291cmNlcyI6IFsKICAgICAgewogICAgICAgICJhcGlWZXJzaW9uIjogInYxIiwKICAgICAgICAia2luZCI6ICJDb25maWdNYXAiLAogICAgICAgICJtZXRhZGF0YSI6IHsKICAgICAgICAgICJuYW1lIjogIm15Y29uZmlnbWFwIgogICAgICAgIH0KICAgICAgfQogICAgXQogIH0KfQo=" } } diff --git a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/SyncSets_Delete.json b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/SyncSets_Delete.json index 45db57820..ceec18a1e 100644 --- a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/SyncSets_Delete.json +++ b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/SyncSets_Delete.json @@ -4,10 +4,10 @@ "subscriptionId": "subscriptionId", "resourceGroupName": "resourceGroup", "resourceName": "resourceName", - "syncSetResourceName": "syncSetResourceName" + "childResourceName": "childResourceName" }, "responses": { - "202": {}, + "200": {}, "204": {} } } diff --git a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/SyncSets_Get.json b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/SyncSets_Get.json index 413da6cb2..5a9651690 100644 --- a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/SyncSets_Get.json +++ b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/SyncSets_Get.json @@ -4,15 +4,12 @@ "subscriptionId": "subscriptionId", "resourceGroupName": "resourceGroup", "resourceName": "resourceName", - "syncSetResourceName": "syncSetResourceName" + "childResourceName": "childResourceName" }, "responses": { "200": { "body": { - "id": "/subscriptions/subscriptionId/resourceGroups/resourceGroup/providers/Microsoft.RedHatOpenShift/OpenShiftClusters/resourceName/syncSets/mySyncSet", - "name": "mySyncSet", "properties": { - "clusterResourceId": "/subscriptions/subscriptionid/resourcegroups/resourcegroup/providers/microsoft.redhatopenshift/openshiftclusters/resourcename", "resources": "eyAKICAiYXBpVmVyc2lvbiI6ICJoaXZlLm9wZW5zaGlmdC5pby92MSIsCiAgImtpbmQiOiAiU3luY1NldCIsCiAgIm1ldGFkYXRhIjogewogICAgIm5hbWUiOiAic2FtcGxlIiwKICAgICJuYW1lc3BhY2UiOiAiYXJvLWY2MGFlOGEyLWJjYTEtNDk4Ny05MDU2LWYyZjZhMTgzN2NhYSIKICB9LAogICJzcGVjIjogewogICAgImNsdXN0ZXJEZXBsb3ltZW50UmVmcyI6IFtdLAogICAgInJlc291cmNlcyI6IFsKICAgICAgewogICAgICAgICJhcGlWZXJzaW9uIjogInYxIiwKICAgICAgICAia2luZCI6ICJDb25maWdNYXAiLAogICAgICAgICJtZXRhZGF0YSI6IHsKICAgICAgICAgICJuYW1lIjogIm15Y29uZmlnbWFwIgogICAgICAgIH0KICAgICAgfQogICAgXQogIH0KfQo=" } } diff --git a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/SyncSets_List.json b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/SyncSets_List.json index fb8b230cf..20795a189 100644 --- a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/SyncSets_List.json +++ b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/SyncSets_List.json @@ -3,18 +3,14 @@ "api-version": "2022-09-04", "subscriptionId": "subscriptionId", "resourceGroupName": "resourceGroup", - "resourceName": "resourceName", - "syncSetResourceName": "syncSetResourceName" + "resourceName": "resourceName" }, "responses": { "200": { "body": { "value": [ { - "id": "/subscriptions/subscriptionId/resourceGroups/resourceGroup/providers/Microsoft.RedHatOpenShift/OpenShiftClusters/resourceName/syncSets/mySyncSet", - "name": "mySyncSet", "properties": { - "clusterResourceId": "/subscriptions/subscriptionid/resourcegroups/resourcegroup/providers/microsoft.redhatopenshift/openshiftclusters/resourcename", "resources": "eyAKICAiYXBpVmVyc2lvbiI6ICJoaXZlLm9wZW5zaGlmdC5pby92MSIsCiAgImtpbmQiOiAiU3luY1NldCIsCiAgIm1ldGFkYXRhIjogewogICAgIm5hbWUiOiAic2FtcGxlIiwKICAgICJuYW1lc3BhY2UiOiAiYXJvLWY2MGFlOGEyLWJjYTEtNDk4Ny05MDU2LWYyZjZhMTgzN2NhYSIKICB9LAogICJzcGVjIjogewogICAgImNsdXN0ZXJEZXBsb3ltZW50UmVmcyI6IFtdLAogICAgInJlc291cmNlcyI6IFsKICAgICAgewogICAgICAgICJhcGlWZXJzaW9uIjogInYxIiwKICAgICAgICAia2luZCI6ICJDb25maWdNYXAiLAogICAgICAgICJtZXRhZGF0YSI6IHsKICAgICAgICAgICJuYW1lIjogIm15Y29uZmlnbWFwIgogICAgICAgIH0KICAgICAgfQogICAgXQogIH0KfQo=" } } diff --git a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/SyncSets_Update.json b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/SyncSets_Update.json index bd7b68583..7533f1f40 100644 --- a/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/SyncSets_Update.json +++ b/swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/examples/SyncSets_Update.json @@ -4,25 +4,24 @@ "subscriptionId": "subscriptionId", "resourceGroupName": "resourceGroup", "resourceName": "resourceName", - "syncSetResourceName": "syncSetResourceName" + "childResourceName": "childResourceName", + "parameters": { + "properties": { + "resources": "eyAKICAiYXBpVmVyc2lvbiI6ICJoaXZlLm9wZW5zaGlmdC5pby92MSIsCiAgImtpbmQiOiAiU3luY1NldCIsCiAgIm1ldGFkYXRhIjogewogICAgIm5hbWUiOiAic2FtcGxlIiwKICAgICJuYW1lc3BhY2UiOiAiYXJvLWY2MGFlOGEyLWJjYTEtNDk4Ny05MDU2LWYyZjZhMTgzN2NhYSIKICB9LAogICJzcGVjIjogewogICAgImNsdXN0ZXJEZXBsb3ltZW50UmVmcyI6IFtdLAogICAgInJlc291cmNlcyI6IFsKICAgICAgewogICAgICAgICJhcGlWZXJzaW9uIjogInYxIiwKICAgICAgICAia2luZCI6ICJDb25maWdNYXAiLAogICAgICAgICJtZXRhZGF0YSI6IHsKICAgICAgICAgICJuYW1lIjogIm15Y29uZmlnbWFwIgogICAgICAgIH0KICAgICAgfQogICAgXQogIH0KfQo=" + } + } }, "responses": { "200": { "body": { - "id": "/subscriptions/subscriptionId/resourceGroups/resourceGroup/providers/Microsoft.RedHatOpenShift/OpenShiftClusters/resourceName/syncSets/mySyncSet", - "name": "mySyncSet", "properties": { - "clusterResourceId": "/subscriptions/subscriptionid/resourcegroups/resourcegroup/providers/microsoft.redhatopenshift/openshiftclusters/resourcename", "resources": "eyAKICAiYXBpVmVyc2lvbiI6ICJoaXZlLm9wZW5zaGlmdC5pby92MSIsCiAgImtpbmQiOiAiU3luY1NldCIsCiAgIm1ldGFkYXRhIjogewogICAgIm5hbWUiOiAic2FtcGxlIiwKICAgICJuYW1lc3BhY2UiOiAiYXJvLWY2MGFlOGEyLWJjYTEtNDk4Ny05MDU2LWYyZjZhMTgzN2NhYSIKICB9LAogICJzcGVjIjogewogICAgImNsdXN0ZXJEZXBsb3ltZW50UmVmcyI6IFtdLAogICAgInJlc291cmNlcyI6IFsKICAgICAgewogICAgICAgICJhcGlWZXJzaW9uIjogInYxIiwKICAgICAgICAia2luZCI6ICJDb25maWdNYXAiLAogICAgICAgICJtZXRhZGF0YSI6IHsKICAgICAgICAgICJuYW1lIjogIm15Y29uZmlnbWFwIgogICAgICAgIH0KICAgICAgfQogICAgXQogIH0KfQo=" } } }, "201": { "body": { - "id": "/subscriptions/subscriptionId/resourceGroups/resourceGroup/providers/Microsoft.RedHatOpenShift/OpenShiftClusters/resourceName/syncSets/mySyncSet", - "name": "mySyncSet", "properties": { - "clusterResourceId": "/subscriptions/subscriptionid/resourcegroups/resourcegroup/providers/microsoft.redhatopenshift/openshiftclusters/resourcename", "resources": "eyAKICAiYXBpVmVyc2lvbiI6ICJoaXZlLm9wZW5zaGlmdC5pby92MSIsCiAgImtpbmQiOiAiU3luY1NldCIsCiAgIm1ldGFkYXRhIjogewogICAgIm5hbWUiOiAic2FtcGxlIiwKICAgICJuYW1lc3BhY2UiOiAiYXJvLWY2MGFlOGEyLWJjYTEtNDk4Ny05MDU2LWYyZjZhMTgzN2NhYSIKICB9LAogICJzcGVjIjogewogICAgImNsdXN0ZXJEZXBsb3ltZW50UmVmcyI6IFtdLAogICAgInJlc291cmNlcyI6IFsKICAgICAgewogICAgICAgICJhcGlWZXJzaW9uIjogInYxIiwKICAgICAgICAia2luZCI6ICJDb25maWdNYXAiLAogICAgICAgICJtZXRhZGF0YSI6IHsKICAgICAgICAgICJuYW1lIjogIm15Y29uZmlnbWFwIgogICAgICAgIH0KICAgICAgfQogICAgXQogIH0KfQo=" } } 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 428478ba8..2075fac21 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 @@ -133,6 +133,156 @@ } } }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openShiftCluster/{resourceName}/machinePools": { + "get": { + "tags": [ + "MachinePools" + ], + "summary": "Lists MachinePools that belong to that Azure Red Hat OpenShift Cluster.", + "description": "The operation returns properties of each MachinePool.", + "operationId": "MachinePools_List", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "name": "resourceName", + "in": "path", + "description": "The name of the OpenShift cluster resource.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/MachinePoolList" + } + }, + "default": { + "description": "Error response describing why the operation failed. If the resource doesn't exist, 404 (Not Found) is returned. If any of the input parameters is wrong, 400 (Bad Request) is returned.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + }, + "x-ms-examples": { + "Lists MachinePools that belong to that Azure Red Hat OpenShift Cluster.": { + "$ref": "./examples/MachinePools_List.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openShiftCluster/{resourceName}/secrets": { + "get": { + "tags": [ + "Secrets" + ], + "summary": "Lists Secrets that belong to that Azure Red Hat OpenShift Cluster.", + "description": "The operation returns properties of each Secret.", + "operationId": "Secrets_List", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "name": "resourceName", + "in": "path", + "description": "The name of the OpenShift cluster resource.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/SecretList" + } + }, + "default": { + "description": "Error response describing why the operation failed. If the resource doesn't exist, 404 (Not Found) is returned. If any of the input parameters is wrong, 400 (Bad Request) is returned.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + }, + "x-ms-examples": { + "Lists Secrets that belong to that Azure Red Hat OpenShift Cluster.": { + "$ref": "./examples/Secrets_List.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openShiftCluster/{resourceName}/syncIdentityProviders": { + "get": { + "tags": [ + "SyncIdentityProviders" + ], + "summary": "Lists SyncIdentityProviders that belong to that Azure Red Hat OpenShift Cluster.", + "description": "The operation returns properties of each SyncIdentityProvider.", + "operationId": "SyncIdentityProviders_List", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "name": "resourceName", + "in": "path", + "description": "The name of the OpenShift cluster resource.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/SyncIdentityProviderList" + } + }, + "default": { + "description": "Error response describing why the operation failed. If the resource doesn't exist, 404 (Not Found) is returned. If any of the input parameters is wrong, 400 (Bad Request) is returned.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + }, + "x-ms-examples": { + "Lists SyncIdentityProviders that belong to that Azure Red Hat OpenShift Cluster.": { + "$ref": "./examples/SyncIdentityProviders_List.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openShiftCluster/{resourceName}/syncSets": { "get": { "tags": [ @@ -535,7 +685,727 @@ } } }, - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/syncSet/{syncSetResourceName}": { + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/machinePool/{childResourceName}": { + "get": { + "tags": [ + "MachinePools" + ], + "summary": "Gets a MachinePool with the specified subscription, resource group and resource name.", + "description": "The operation returns properties of a MachinePool.", + "operationId": "MachinePools_Get", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "name": "resourceName", + "in": "path", + "description": "The name of the OpenShift cluster resource.", + "required": true, + "type": "string" + }, + { + "name": "childResourceName", + "in": "path", + "description": "The name of the MachinePool resource.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/MachinePool" + } + }, + "default": { + "description": "Error response describing why the operation failed. If the resource doesn't exist, 404 (Not Found) is returned. If any of the input parameters is wrong, 400 (Bad Request) is returned.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + }, + "x-ms-examples": { + "Gets a MachinePool with the specified subscription, resource group and resource name.": { + "$ref": "./examples/MachinePools_Get.json" + } + } + }, + "put": { + "tags": [ + "MachinePools" + ], + "summary": "Creates or updates a MachinePool with the specified subscription, resource group and resource name.", + "description": "The operation returns properties of a MachinePool.", + "operationId": "MachinePools_CreateOrUpdate", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "name": "resourceName", + "in": "path", + "description": "The name of the OpenShift cluster resource.", + "required": true, + "type": "string" + }, + { + "name": "childResourceName", + "in": "path", + "description": "The name of the MachinePool resource.", + "required": true, + "type": "string" + }, + { + "name": "parameters", + "in": "body", + "description": "The MachinePool resource.", + "required": true, + "schema": { + "$ref": "#/definitions/MachinePool" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/MachinePool" + } + }, + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/MachinePool" + } + }, + "default": { + "description": "Error response describing why the operation failed. If the resource doesn't exist, 404 (Not Found) is returned. If any of the input parameters is wrong, 400 (Bad Request) is returned.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + }, + "x-ms-examples": { + "Creates or updates a MachinePool with the specified subscription, resource group and resource name.": { + "$ref": "./examples/MachinePools_CreateOrUpdate.json" + } + } + }, + "delete": { + "tags": [ + "MachinePools" + ], + "summary": "Deletes a MachinePool with the specified subscription, resource group and resource name.", + "description": "The operation returns nothing.", + "operationId": "MachinePools_Delete", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "name": "resourceName", + "in": "path", + "description": "The name of the OpenShift cluster resource.", + "required": true, + "type": "string" + }, + { + "name": "childResourceName", + "in": "path", + "description": "The name of the MachinePool resource.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK" + }, + "204": { + "description": "No Content" + }, + "default": { + "description": "Error response describing why the operation failed. If the resource doesn't exist, 404 (Not Found) is returned. If any of the input parameters is wrong, 400 (Bad Request) is returned.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + }, + "x-ms-examples": { + "Deletes a MachinePool with the specified subscription, resource group and resource name.": { + "$ref": "./examples/MachinePools_Delete.json" + } + } + }, + "patch": { + "tags": [ + "MachinePools" + ], + "summary": "Patches (create or update) a MachinePool with the specified subscription, resource group and resource name.", + "description": "The operation returns properties of a MachinePool.", + "operationId": "MachinePools_Update", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "name": "resourceName", + "in": "path", + "description": "The name of the OpenShift cluster resource.", + "required": true, + "type": "string" + }, + { + "name": "childResourceName", + "in": "path", + "description": "The name of the MachinePool resource.", + "required": true, + "type": "string" + }, + { + "name": "parameters", + "in": "body", + "description": "The MachinePool resource.", + "required": true, + "schema": { + "$ref": "#/definitions/MachinePoolUpdate" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/MachinePool" + } + }, + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/MachinePool" + } + }, + "default": { + "description": "Error response describing why the operation failed. If the resource doesn't exist, 404 (Not Found) is returned. If any of the input parameters is wrong, 400 (Bad Request) is returned.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + }, + "x-ms-examples": { + "Patches (create or update) a MachinePool with the specified subscription, resource group and resource name.": { + "$ref": "./examples/MachinePools_Update.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/secret/{childResourceName}": { + "get": { + "tags": [ + "Secrets" + ], + "summary": "Gets a Secret with the specified subscription, resource group and resource name.", + "description": "The operation returns properties of a Secret.", + "operationId": "Secrets_Get", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "name": "resourceName", + "in": "path", + "description": "The name of the OpenShift cluster resource.", + "required": true, + "type": "string" + }, + { + "name": "childResourceName", + "in": "path", + "description": "The name of the Secret resource.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Secret" + } + }, + "default": { + "description": "Error response describing why the operation failed. If the resource doesn't exist, 404 (Not Found) is returned. If any of the input parameters is wrong, 400 (Bad Request) is returned.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + }, + "x-ms-examples": { + "Gets a Secret with the specified subscription, resource group and resource name.": { + "$ref": "./examples/Secrets_Get.json" + } + } + }, + "put": { + "tags": [ + "Secrets" + ], + "summary": "Creates or updates a Secret with the specified subscription, resource group and resource name.", + "description": "The operation returns properties of a Secret.", + "operationId": "Secrets_CreateOrUpdate", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "name": "resourceName", + "in": "path", + "description": "The name of the OpenShift cluster resource.", + "required": true, + "type": "string" + }, + { + "name": "childResourceName", + "in": "path", + "description": "The name of the Secret resource.", + "required": true, + "type": "string" + }, + { + "name": "parameters", + "in": "body", + "description": "The Secret resource.", + "required": true, + "schema": { + "$ref": "#/definitions/Secret" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Secret" + } + }, + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/Secret" + } + }, + "default": { + "description": "Error response describing why the operation failed. If the resource doesn't exist, 404 (Not Found) is returned. If any of the input parameters is wrong, 400 (Bad Request) is returned.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + }, + "x-ms-examples": { + "Creates or updates a Secret with the specified subscription, resource group and resource name.": { + "$ref": "./examples/Secrets_CreateOrUpdate.json" + } + } + }, + "delete": { + "tags": [ + "Secrets" + ], + "summary": "Deletes a Secret with the specified subscription, resource group and resource name.", + "description": "The operation returns nothing.", + "operationId": "Secrets_Delete", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "name": "resourceName", + "in": "path", + "description": "The name of the OpenShift cluster resource.", + "required": true, + "type": "string" + }, + { + "name": "childResourceName", + "in": "path", + "description": "The name of the Secret resource.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK" + }, + "204": { + "description": "No Content" + }, + "default": { + "description": "Error response describing why the operation failed. If the resource doesn't exist, 404 (Not Found) is returned. If any of the input parameters is wrong, 400 (Bad Request) is returned.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + }, + "x-ms-examples": { + "Deletes a Secret with the specified subscription, resource group and resource name.": { + "$ref": "./examples/Secrets_Delete.json" + } + } + }, + "patch": { + "tags": [ + "Secrets" + ], + "summary": "Patches (create or update) a Secret with the specified subscription, resource group and resource name.", + "description": "The operation returns properties of a Secret.", + "operationId": "Secrets_Update", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "name": "resourceName", + "in": "path", + "description": "The name of the OpenShift cluster resource.", + "required": true, + "type": "string" + }, + { + "name": "childResourceName", + "in": "path", + "description": "The name of the Secret resource.", + "required": true, + "type": "string" + }, + { + "name": "parameters", + "in": "body", + "description": "The Secret resource.", + "required": true, + "schema": { + "$ref": "#/definitions/SecretUpdate" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Secret" + } + }, + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/Secret" + } + }, + "default": { + "description": "Error response describing why the operation failed. If the resource doesn't exist, 404 (Not Found) is returned. If any of the input parameters is wrong, 400 (Bad Request) is returned.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + }, + "x-ms-examples": { + "Patches (create or update) a Secret with the specified subscription, resource group and resource name.": { + "$ref": "./examples/Secrets_Update.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/syncIdentityProvider/{childResourceName}": { + "get": { + "tags": [ + "SyncIdentityProviders" + ], + "summary": "Gets a SyncIdentityProvider with the specified subscription, resource group and resource name.", + "description": "The operation returns properties of a SyncIdentityProvider.", + "operationId": "SyncIdentityProviders_Get", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "name": "resourceName", + "in": "path", + "description": "The name of the OpenShift cluster resource.", + "required": true, + "type": "string" + }, + { + "name": "childResourceName", + "in": "path", + "description": "The name of the SyncIdentityProvider resource.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/SyncIdentityProvider" + } + }, + "default": { + "description": "Error response describing why the operation failed. If the resource doesn't exist, 404 (Not Found) is returned. If any of the input parameters is wrong, 400 (Bad Request) is returned.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + }, + "x-ms-examples": { + "Gets a SyncIdentityProvider with the specified subscription, resource group and resource name.": { + "$ref": "./examples/SyncIdentityProviders_Get.json" + } + } + }, + "put": { + "tags": [ + "SyncIdentityProviders" + ], + "summary": "Creates or updates a SyncIdentityProvider with the specified subscription, resource group and resource name.", + "description": "The operation returns properties of a SyncIdentityProvider.", + "operationId": "SyncIdentityProviders_CreateOrUpdate", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "name": "resourceName", + "in": "path", + "description": "The name of the OpenShift cluster resource.", + "required": true, + "type": "string" + }, + { + "name": "childResourceName", + "in": "path", + "description": "The name of the SyncIdentityProvider resource.", + "required": true, + "type": "string" + }, + { + "name": "parameters", + "in": "body", + "description": "The SyncIdentityProvider resource.", + "required": true, + "schema": { + "$ref": "#/definitions/SyncIdentityProvider" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/SyncIdentityProvider" + } + }, + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/SyncIdentityProvider" + } + }, + "default": { + "description": "Error response describing why the operation failed. If the resource doesn't exist, 404 (Not Found) is returned. If any of the input parameters is wrong, 400 (Bad Request) is returned.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + }, + "x-ms-examples": { + "Creates or updates a SyncIdentityProvider with the specified subscription, resource group and resource name.": { + "$ref": "./examples/SyncIdentityProviders_CreateOrUpdate.json" + } + } + }, + "delete": { + "tags": [ + "SyncIdentityProviders" + ], + "summary": "Deletes a SyncIdentityProvider with the specified subscription, resource group and resource name.", + "description": "The operation returns nothing.", + "operationId": "SyncIdentityProviders_Delete", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "name": "resourceName", + "in": "path", + "description": "The name of the OpenShift cluster resource.", + "required": true, + "type": "string" + }, + { + "name": "childResourceName", + "in": "path", + "description": "The name of the SyncIdentityProvider resource.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK" + }, + "204": { + "description": "No Content" + }, + "default": { + "description": "Error response describing why the operation failed. If the resource doesn't exist, 404 (Not Found) is returned. If any of the input parameters is wrong, 400 (Bad Request) is returned.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + }, + "x-ms-examples": { + "Deletes a SyncIdentityProvider with the specified subscription, resource group and resource name.": { + "$ref": "./examples/SyncIdentityProviders_Delete.json" + } + } + }, + "patch": { + "tags": [ + "SyncIdentityProviders" + ], + "summary": "Patches (create or update) a SyncIdentityProvider with the specified subscription, resource group and resource name.", + "description": "The operation returns properties of a SyncIdentityProvider.", + "operationId": "SyncIdentityProviders_Update", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "name": "resourceName", + "in": "path", + "description": "The name of the OpenShift cluster resource.", + "required": true, + "type": "string" + }, + { + "name": "childResourceName", + "in": "path", + "description": "The name of the SyncIdentityProvider resource.", + "required": true, + "type": "string" + }, + { + "name": "parameters", + "in": "body", + "description": "The SyncIdentityProvider resource.", + "required": true, + "schema": { + "$ref": "#/definitions/SyncIdentityProviderUpdate" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/SyncIdentityProvider" + } + }, + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/SyncIdentityProvider" + } + }, + "default": { + "description": "Error response describing why the operation failed. If the resource doesn't exist, 404 (Not Found) is returned. If any of the input parameters is wrong, 400 (Bad Request) is returned.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + }, + "x-ms-examples": { + "Patches (create or update) a SyncIdentityProvider with the specified subscription, resource group and resource name.": { + "$ref": "./examples/SyncIdentityProviders_Update.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/syncSet/{childResourceName}": { "get": { "tags": [ "SyncSets" @@ -561,7 +1431,7 @@ "type": "string" }, { - "name": "syncSetResourceName", + "name": "childResourceName", "in": "path", "description": "The name of the SyncSet resource.", "required": true, @@ -613,11 +1483,20 @@ "type": "string" }, { - "name": "syncSetResourceName", + "name": "childResourceName", "in": "path", "description": "The name of the SyncSet resource.", "required": true, "type": "string" + }, + { + "name": "parameters", + "in": "body", + "description": "The SyncSet resource.", + "required": true, + "schema": { + "$ref": "#/definitions/SyncSet" + } } ], "responses": { @@ -671,7 +1550,7 @@ "type": "string" }, { - "name": "syncSetResourceName", + "name": "childResourceName", "in": "path", "description": "The name of the SyncSet resource.", "required": true, @@ -679,8 +1558,8 @@ } ], "responses": { - "202": { - "description": "Accepted" + "200": { + "description": "OK" }, "204": { "description": "No Content" @@ -702,7 +1581,7 @@ "tags": [ "SyncSets" ], - "summary": "Creates or updates a SyncSet with the specified subscription, resource group and resource name.", + "summary": "Patches (create or update) a SyncSet with the specified subscription, resource group and resource name.", "description": "The operation returns properties of a SyncSet.", "operationId": "SyncSets_Update", "parameters": [ @@ -723,11 +1602,20 @@ "type": "string" }, { - "name": "syncSetResourceName", + "name": "childResourceName", "in": "path", "description": "The name of the SyncSet resource.", "required": true, "type": "string" + }, + { + "name": "parameters", + "in": "body", + "description": "The SyncSet resource.", + "required": true, + "schema": { + "$ref": "#/definitions/SyncSetUpdate" + } } ], "responses": { @@ -751,7 +1639,7 @@ } }, "x-ms-examples": { - "Creates or updates a SyncSet with the specified subscription, resource group and resource name.": { + "Patches (create or update) a SyncSet with the specified subscription, resource group and resource name.": { "$ref": "./examples/SyncSets_Update.json" } } @@ -925,6 +1813,70 @@ }, "x-ms-identifiers": [] }, + "MachinePool": { + "description": "MachinePool represents a MachinePool", + "type": "object", + "allOf": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ProxyResource" + } + ], + "properties": { + "properties": { + "$ref": "#/definitions/MachinePoolProperties", + "description": "The MachinePool Properties", + "x-ms-client-flatten": true + }, + "systemData": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/systemData", + "description": "The system meta data relating to this resource.", + "readOnly": true + } + } + }, + "MachinePoolList": { + "description": "MachinePoolList represents a list of MachinePools", + "type": "object", + "properties": { + "value": { + "description": "The list of Machine Pools.", + "type": "array", + "items": { + "$ref": "#/definitions/MachinePool" + }, + "x-ms-identifiers": [] + }, + "nextLink": { + "description": "The link used to get the next page of operations.", + "type": "string" + } + } + }, + "MachinePoolProperties": { + "description": "MachinePoolProperties represents the properties of a MachinePool", + "type": "object", + "properties": { + "resources": { + "type": "string" + } + } + }, + "MachinePoolUpdate": { + "description": "MachinePool represents a MachinePool", + "type": "object", + "properties": { + "properties": { + "$ref": "#/definitions/MachinePoolProperties", + "description": "The MachinePool Properties", + "x-ms-client-flatten": true + }, + "systemData": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/systemData", + "description": "The system meta data relating to this resource.", + "readOnly": true + } + } + }, "MasterProfile": { "description": "MasterProfile represents a master profile.", "type": "object", @@ -1148,6 +2100,72 @@ ], "type": "string" }, + "Secret": { + "description": "Secret represents a secret.", + "type": "object", + "allOf": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ProxyResource" + } + ], + "properties": { + "properties": { + "$ref": "#/definitions/SecretProperties", + "description": "The Secret Properties", + "x-ms-client-flatten": true + }, + "systemData": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/systemData", + "description": "The system meta data relating to this resource.", + "readOnly": true + } + } + }, + "SecretList": { + "description": "SecretList represents a list of Secrets", + "type": "object", + "properties": { + "value": { + "description": "The list of secrets.", + "type": "array", + "items": { + "$ref": "#/definitions/Secret" + }, + "x-ms-identifiers": [] + }, + "nextLink": { + "description": "The link used to get the next page of operations.", + "type": "string" + } + } + }, + "SecretProperties": { + "description": "SecretProperties represents the properties of a Secret", + "type": "object", + "properties": { + "secretResources": { + "description": "The Secrets Resources.", + "type": "string", + "x-ms-secret": true + } + } + }, + "SecretUpdate": { + "description": "Secret represents a secret.", + "type": "object", + "properties": { + "properties": { + "$ref": "#/definitions/SecretProperties", + "description": "The Secret Properties", + "x-ms-client-flatten": true + }, + "systemData": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/systemData", + "description": "The system meta data relating to this resource.", + "readOnly": true + } + } + }, "ServicePrincipalProfile": { "description": "ServicePrincipalProfile represents a service principal profile.", "type": "object", @@ -1162,9 +2180,78 @@ } } }, + "SyncIdentityProvider": { + "description": "SyncIdentityProvider represents a SyncIdentityProvider", + "type": "object", + "allOf": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ProxyResource" + } + ], + "properties": { + "properties": { + "$ref": "#/definitions/SyncIdentityProviderProperties", + "description": "The SyncIdentityProvider Properties", + "x-ms-client-flatten": true + }, + "systemData": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/systemData", + "description": "The system meta data relating to this resource.", + "readOnly": true + } + } + }, + "SyncIdentityProviderList": { + "description": "SyncSetList represents a list of SyncSets", + "type": "object", + "properties": { + "value": { + "description": "The list of sync identity providers", + "type": "array", + "items": { + "$ref": "#/definitions/SyncIdentityProvider" + }, + "x-ms-identifiers": [] + }, + "nextLink": { + "description": "The link used to get the next page of operations.", + "type": "string" + } + } + }, + "SyncIdentityProviderProperties": { + "description": "SyncSetProperties represents the properties of a SyncSet", + "type": "object", + "properties": { + "resources": { + "type": "string" + } + } + }, + "SyncIdentityProviderUpdate": { + "description": "SyncIdentityProvider represents a SyncIdentityProvider", + "type": "object", + "properties": { + "properties": { + "$ref": "#/definitions/SyncIdentityProviderProperties", + "description": "The SyncIdentityProvider Properties", + "x-ms-client-flatten": true + }, + "systemData": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/systemData", + "description": "The system meta data relating to this resource.", + "readOnly": true + } + } + }, "SyncSet": { "description": "SyncSet represents a SyncSet for an Azure Red Hat OpenShift Cluster.", "type": "object", + "allOf": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ProxyResource" + } + ], "properties": { "properties": { "$ref": "#/definitions/SyncSetProperties", @@ -1181,11 +2268,6 @@ "SyncSetList": { "description": "SyncSetList represents a list of SyncSets", "type": "object", - "allOf": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ProxyResource" - } - ], "properties": { "value": { "description": "The list of syncsets.", @@ -1205,10 +2287,6 @@ "description": "SyncSetProperties represents the properties of a SyncSet", "type": "object", "properties": { - "clusterResourceId": { - "description": "The parent Azure Red Hat OpenShift resourceID.", - "type": "string" - }, "resources": { "description": "Resources represents the SyncSets configuration.", "type": "string" diff --git a/swagger/redhatopenshift/resource-manager/readme.md b/swagger/redhatopenshift/resource-manager/readme.md index cce527437..e88be4d4a 100644 --- a/swagger/redhatopenshift/resource-manager/readme.md +++ b/swagger/redhatopenshift/resource-manager/readme.md @@ -80,6 +80,7 @@ swagger-to-sdk: - repo: azure-sdk-for-go - repo: azure-sdk-for-go-track2 - repo: azure-resource-manager-schemas + - repo: azure-powershell ``` ## Go