rm interface support - refactor examples to resources b64 strings

This commit is contained in:
Ross Bryan 2022-09-06 08:35:25 -04:00
Родитель b2b82743fb
Коммит a5673f1532
27 изменённых файлов: 1153 добавлений и 550 удалений

Просмотреть файл

@ -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
10f0a281da1e0d3fcd30788b87d5afdd2b4fb501af5d179c114c45ab870b6f2a swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/redhatopenshift.json
31a28660207aba242d722899fde23455cdd85c9839d8eb3d8ea69db1f5da423d swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/redhatopenshift.json

1
hack/ocm/syncset.b64 Normal file
Просмотреть файл

@ -0,0 +1 @@
eyAKICAiYXBpVmVyc2lvbiI6ICJoaXZlLm9wZW5zaGlmdC5pby92MSIsCiAgImtpbmQiOiAiU3luY1NldCIsCiAgIm1ldGFkYXRhIjogewogICAgIm5hbWUiOiAic2FtcGxlIiwKICAgICJuYW1lc3BhY2UiOiAiYXJvLWY2MGFlOGEyLWJjYTEtNDk4Ny05MDU2LWYyZjZhMTgzN2NhYSIKICB9LAogICJzcGVjIjogewogICAgImNsdXN0ZXJEZXBsb3ltZW50UmVmcyI6IFtdLAogICAgInJlc291cmNlcyI6IFsKICAgICAgewogICAgICAgICJhcGlWZXJzaW9uIjogInYxIiwKICAgICAgICAia2luZCI6ICJDb25maWdNYXAiLAogICAgICAgICJtZXRhZGF0YSI6IHsKICAgICAgICAgICJuYW1lIjogIm15Y29uZmlnbWFwIgogICAgICAgIH0KICAgICAgfQogICAgXQogIH0KfQo=

Просмотреть файл

@ -53,31 +53,8 @@ type SyncSetProperties struct {
// The parent Azure Red Hat OpenShift resourceID.
ClusterResourceId string `json:"clusterResourceId,omitempty"`
// APIVersion for the SyncSet.
APIVersion string `json:"apiVersion,omitempty"`
// SyncSet kind.
Kind string `json:"kind,omitempty"`
// Metadata for the SyncSet.
Metadata map[string]string `json:"metadata,omitempty"`
// The SyncSet Specification.
Spec SyncSetSpec `json:"spec,omitempty"`
// ClusterDeploymentRefs map SyncSets to a Hive Cluster Deployment.
ClusterDeploymentRefs []string `json:"clusterDeploymentRefs,omitempty"`
// Resources represents the SyncSets configuration.
Resources map[string]string `json:"resources,omitempty"`
// The status of the object.
Status string `json:"status,omitempty"`
// Resources []byte `json:"resources,omitempty"`
}
type SyncSetSpec struct {
Resources string `json:"resources,omitempty"`
}
// MachinePool represents a MachinePool
@ -88,15 +65,17 @@ type MachinePool struct {
// The resource name.
Name string `json:"name,omitempty"`
// The parent cluster resourceID.
ClusterResourceId string `json:"clusterResourceId,omitempty"`
// The MachinePool properties.
Properties MachinePoolProperties `json:"properties,omitempty"`
}
// MachinePoolProperties represents the properties of a MachinePool
type MachinePoolProperties struct {
// The parent cluster resourceID.
ClusterResourceId string `json:"clusterResourceId,omitempty"`
// Resources represents the machinepools configuration.
Resources []byte `json:"resources,omitempty"`
}

Просмотреть файл

@ -34,6 +34,8 @@ const mpPayload string = `
}
`
// ExampleClusterManagerConfigurationDocumentSyncSet returns a ClusterManagerConfigurationDocument
// with an example syncset payload model. The resources field comes from the ./hack/ocm folder.
func ExampleClusterManagerConfigurationDocumentSyncSet() *ClusterManagerConfigurationDocument {
return &ClusterManagerConfigurationDocument{
ID: "00000000-0000-0000-0000-000000000000",
@ -45,21 +47,7 @@ func ExampleClusterManagerConfigurationDocumentSyncSet() *ClusterManagerConfigur
ID: "/subscriptions/subscriptionId/resourceGroups/resourceGroup/providers/Microsoft.RedHatOpenShift/OpenShiftClusters/resourceName/syncSets/mySyncSet",
Properties: SyncSetProperties{
ClusterResourceId: "/subscriptions/subscriptionid/resourcegroups/resourcegroup/providers/microsoft.redhatopenshift/openshiftclusters/resourcename",
APIVersion: "hive.openshift.io/v1",
Kind: "SyncSet",
Metadata: map[string]string{
"name": "sample",
"namespace": "aro-f60ae8a2-bca1-4987-9056-f2f6a1837caa",
},
ClusterDeploymentRefs: []string{
"uhc-staging-1u4lhakk4ar41bi3vgn0b7v9hk93dg4m",
"aro-f60ae8a2-bca1-4987-9056-f2f6a1837caa",
},
Resources: map[string]string{
"name": "worker",
"platform": "azure",
"replicas": "2",
},
Resources: "eyAKICAiYXBpVmVyc2lvbiI6ICJoaXZlLm9wZW5zaGlmdC5pby92MSIsCiAgImtpbmQiOiAiU3luY1NldCIsCiAgIm1ldGFkYXRhIjogewogICAgIm5hbWUiOiAic2FtcGxlIiwKICAgICJuYW1lc3BhY2UiOiAiYXJvLWY2MGFlOGEyLWJjYTEtNDk4Ny05MDU2LWYyZjZhMTgzN2NhYSIKICB9LAogICJzcGVjIjogewogICAgImNsdXN0ZXJEZXBsb3ltZW50UmVmcyI6IFtdLAogICAgInJlc291cmNlcyI6IFsKICAgICAgewogICAgICAgICJhcGlWZXJzaW9uIjogInYxIiwKICAgICAgICAia2luZCI6ICJDb25maWdNYXAiLAogICAgICAgICJtZXRhZGF0YSI6IHsKICAgICAgICAgICJuYW1lIjogIm15Y29uZmlnbWFwIgogICAgICAgIH0KICAgICAgfQogICAgXQogIH0KfQo=",
},
},
CorrelationData: &CorrelationData{},
@ -73,11 +61,11 @@ func ExampleClusterManagerConfigurationDocumentMachinePool() *ClusterManagerConf
ResourceID: "",
PartitionKey: "",
MachinePool: &MachinePool{
Name: "myMachinePool",
ID: "/subscriptions/subscriptionId/resourceGroups/resourceGroup/providers/Microsoft.RedHatOpenShift/OpenShiftClusters/resourceName/machinePools/myMachinePool",
ClusterResourceId: "/subscriptions/subscriptionid/resourcegroups/resourcegroup/providers/microsoft.redhatopenshift/openshiftclusters/resourcename",
Name: "myMachinePool",
ID: "/subscriptions/subscriptionId/resourceGroups/resourceGroup/providers/Microsoft.RedHatOpenShift/OpenShiftClusters/resourceName/machinePools/myMachinePool",
Properties: MachinePoolProperties{
Resources: []byte(mpPayload),
ClusterResourceId: "/subscriptions/subscriptionid/resourcegroups/resourcegroup/providers/microsoft.redhatopenshift/openshiftclusters/resourcename",
Resources: []byte(mpPayload),
},
},
CorrelationData: &CorrelationData{},

Просмотреть файл

@ -11,13 +11,6 @@ const (
SecretKind = "Secret"
)
// SyncSetList represents a list of SyncSets
type SyncSetList struct {
SyncSets []*SyncSet `json:"value"`
// The link used to get the next page of operations.
NextLink string `json:"nextLink,omitempty"`
}
type ClusterManagerConfigurationList struct {
ClusterManagerConfigurations []*ClusterManagerConfiguration `json:"value"`
@ -39,12 +32,23 @@ type ClusterManagerConfigurationProperties struct {
Resources interface{} `json:"resources,omitempty"`
}
// SyncSetList represents a list of SyncSets
type SyncSetList struct {
proxyResource bool
// The list of syncsets.
SyncSets []*SyncSet `json:"value"`
// The link used to get the next page of operations.
NextLink string `json:"nextLink,omitempty"`
}
// SyncSet represents a SyncSet for an Azure Red Hat OpenShift Cluster.
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"`
@ -67,39 +71,8 @@ type SyncSetProperties struct {
// The parent Azure Red Hat OpenShift resourceID.
ClusterResourceId string `json:"clusterResourceId,omitempty"`
// APIVersion for the SyncSet.
APIVersion string `json:"apiVersion,omitempty"`
// SyncSet kind.
Kind string `json:"kind,omitempty"`
// Metadata for the SyncSet.
Metadata map[string]string `json:"metadata,omitempty"`
// The SyncSet Specification.
Spec SyncSetSpec `json:"spec,omitempty"`
// ClusterDeploymentRefs map SyncSets to a Hive Cluster Deployment.
ClusterDeploymentRefs []string `json:"clusterDeploymentRefs,omitempty"`
// Resources represents the SyncSets configuration.
Resources map[string]string `json:"resources,omitempty"`
// The status of the object.
Status string `json:"status,omitempty"`
// Resources []byte `json:"resources,omitempty"`
}
type SyncSetSpec struct {
// ClusterDeploymentRefs map SyncSets to a Hive Cluster Deployment.
ClusterDeploymentRefs []string `json:"clusterDeploymentRefs,omitempty"`
// Resources represents the SyncSets configuration.
Resources map[string]interface{} `json:"resources,omitempty"`
// The status of the object.
Status string `json:"status,omitempty"`
Resources string `json:"resources,omitempty"`
}
// MachinePool represents a MachinePool

Просмотреть файл

@ -28,15 +28,9 @@ func (c *clusterManagerConfigurationConverter) SyncSetToExternal(ocm *api.SyncSe
out.ID = ocm.ID
out.Name = ocm.Name
out.Type = ocm.Type
out.proxyResource = true
out.Properties = SyncSetProperties{
ClusterResourceId: ocm.Properties.ClusterResourceId,
APIVersion: ocm.Properties.APIVersion,
Kind: ocm.Properties.Kind,
Metadata: ocm.Properties.Metadata,
ClusterDeploymentRefs: ocm.Properties.ClusterDeploymentRefs,
Resources: ocm.Properties.Resources,
Status: ocm.Properties.Status,
ClusterResourceId: ocm.Properties.ClusterResourceId,
Resources: ocm.Properties.Resources,
}
return out, nil

Просмотреть файл

@ -31,6 +31,7 @@ func ExampleSyncSetResponse() interface{} {
func ExampleSyncSetListResponse() interface{} {
return &SyncSetList{
proxyResource: true,
SyncSets: []*SyncSet{
ExampleSyncSetResponse().(*SyncSet),
},

Просмотреть файл

@ -866,13 +866,7 @@ type SyncSet struct {
autorest.Response `json:"-"`
// SyncSetProperties - The Syncsets properties
*SyncSetProperties `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 - READ-ONLY; The system meta data relating to this resource.
SystemData *SystemData `json:"systemData,omitempty"`
}
@ -903,33 +897,6 @@ 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
@ -948,9 +915,30 @@ func (ss *SyncSet) UnmarshalJSON(body []byte) error {
// SyncSetList syncSetList represents a list of SyncSets
type SyncSetList struct {
autorest.Response `json:"-"`
Value *[]SyncSet `json:"value,omitempty"`
// Value - The list of syncsets.
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.
@ -1107,75 +1095,58 @@ func NewSyncSetListPage(cur SyncSetList, getNextPage func(context.Context, SyncS
type SyncSetProperties struct {
// ClusterResourceID - The parent Azure Red Hat OpenShift resourceID.
ClusterResourceID *string `json:"clusterResourceId,omitempty"`
// APIVersion - APIVersion for the SyncSet.
APIVersion *string `json:"apiVersion,omitempty"`
// Kind - SyncSet kind.
Kind *string `json:"kind,omitempty"`
// Metadata - Metadata for the SyncSet.
Metadata map[string]*string `json:"metadata"`
// Spec - The SyncSet Specification.
Spec *SyncSetSpec `json:"spec,omitempty"`
// ClusterDeploymentRefs - ClusterDeploymentRefs map SyncSets to a Hive Cluster Deployment.
ClusterDeploymentRefs interface{} `json:"clusterDeploymentRefs,omitempty"`
// Resources - Resources represents the SyncSets configuration.
Resources map[string]*string `json:"resources"`
// Status - The status of the object.
Status *string `json:"status,omitempty"`
Resources *string `json:"resources,omitempty"`
}
// MarshalJSON is the custom marshaler for SyncSetProperties.
func (ssp SyncSetProperties) MarshalJSON() ([]byte, error) {
// SyncSetUpdate syncSet represents a SyncSet for an Azure Red Hat OpenShift Cluster.
type SyncSetUpdate struct {
// SyncSetProperties - The Syncsets properties
*SyncSetProperties `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 SyncSetUpdate.
func (ssu SyncSetUpdate) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if ssp.ClusterResourceID != nil {
objectMap["clusterResourceId"] = ssp.ClusterResourceID
}
if ssp.APIVersion != nil {
objectMap["apiVersion"] = ssp.APIVersion
}
if ssp.Kind != nil {
objectMap["kind"] = ssp.Kind
}
if ssp.Metadata != nil {
objectMap["metadata"] = ssp.Metadata
}
if ssp.Spec != nil {
objectMap["spec"] = ssp.Spec
}
if ssp.ClusterDeploymentRefs != nil {
objectMap["clusterDeploymentRefs"] = ssp.ClusterDeploymentRefs
}
if ssp.Resources != nil {
objectMap["resources"] = ssp.Resources
}
if ssp.Status != nil {
objectMap["status"] = ssp.Status
if ssu.SyncSetProperties != nil {
objectMap["properties"] = ssu.SyncSetProperties
}
return json.Marshal(objectMap)
}
// SyncSetSpec ...
type SyncSetSpec struct {
// ClusterDeploymentRefs - ClusterDeploymentRefs map SyncSets to a Hive Cluster Deployment.
ClusterDeploymentRefs interface{} `json:"clusterDeploymentRefs,omitempty"`
// Resources - Resources represents the SyncSets configuration.
Resources map[string]interface{} `json:"resources"`
// Status - The status of the object.
Status *string `json:"status,omitempty"`
}
// UnmarshalJSON is the custom unmarshaler for SyncSetUpdate struct.
func (ssu *SyncSetUpdate) 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 syncSetProperties SyncSetProperties
err = json.Unmarshal(*v, &syncSetProperties)
if err != nil {
return err
}
ssu.SyncSetProperties = &syncSetProperties
}
case "systemData":
if v != nil {
var systemData SystemData
err = json.Unmarshal(*v, &systemData)
if err != nil {
return err
}
ssu.SystemData = &systemData
}
}
}
// MarshalJSON is the custom marshaler for SyncSetSpec.
func (sss SyncSetSpec) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if sss.ClusterDeploymentRefs != nil {
objectMap["clusterDeploymentRefs"] = sss.ClusterDeploymentRefs
}
if sss.Resources != nil {
objectMap["resources"] = sss.Resources
}
if sss.Status != nil {
objectMap["status"] = sss.Status
}
return json.Marshal(objectMap)
return nil
}
// SystemData metadata pertaining to creation and last modification of the resource.

Просмотреть файл

@ -20,6 +20,8 @@ package redhatopenshiftapi
import (
"context"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/ARO-RP/pkg/client/services/redhatopenshift/mgmt/2022-09-04/redhatopenshift"
)
@ -56,9 +58,12 @@ var _ OpenShiftClustersClientAPI = (*redhatopenshift.OpenShiftClustersClient)(ni
// 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)
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)
}
var _ SyncSetsClientAPI = (*redhatopenshift.SyncSetsClient)(nil)

Просмотреть файл

@ -43,10 +43,183 @@ func NewSyncSetsClientWithBaseURI(baseURI string, subscriptionID string) SyncSet
return SyncSetsClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// CreateOrUpdate the operation returns properties of a 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) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SyncSetsClient.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.SyncSetsClient", "CreateOrUpdate", err.Error())
}
req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceName, syncSetResourceName)
if err != nil {
err = autorest.NewErrorWithError(err, "redhatopenshift.SyncSetsClient", "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.SyncSetsClient", "CreateOrUpdate", resp, "Failure sending request")
return
}
result, err = client.CreateOrUpdateResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "redhatopenshift.SyncSetsClient", "CreateOrUpdate", resp, "Failure responding to request")
return
}
return
}
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
func (client SyncSetsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, syncSetResourceName 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),
}
const APIVersion = "2022-09-04"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/syncSet/{syncSetResourceName}", pathParameters),
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 SyncSetsClient) 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 SyncSetsClient) CreateOrUpdateResponder(resp *http.Response) (result SyncSet, 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.
// 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) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SyncSetsClient.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.SyncSetsClient", "Delete", err.Error())
}
req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName, syncSetResourceName)
if err != nil {
err = autorest.NewErrorWithError(err, "redhatopenshift.SyncSetsClient", "Delete", nil, "Failure preparing request")
return
}
resp, err := client.DeleteSender(req)
if err != nil {
result.Response = resp
err = autorest.NewErrorWithError(err, "redhatopenshift.SyncSetsClient", "Delete", resp, "Failure sending request")
return
}
result, err = client.DeleteResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "redhatopenshift.SyncSetsClient", "Delete", resp, "Failure responding to request")
return
}
return
}
// DeletePreparer prepares the Delete request.
func (client SyncSetsClient) DeletePreparer(ctx context.Context, resourceGroupName string, resourceName string, syncSetResourceName 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),
}
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}/syncSet/{syncSetResourceName}", 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 SyncSetsClient) 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 SyncSetsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
autorest.ByClosing())
result.Response = resp
return
}
// Get the operation returns properties of a SyncSet.
// Parameters:
// resourceGroupName - the name of the resource group. The name is case insensitive.
// resourceName - the name of the SyncSet resource.
// 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) {
if tracing.IsEnabled() {
@ -133,7 +306,7 @@ func (client SyncSetsClient) GetResponder(resp *http.Response) (result SyncSet,
// List the operation returns properties of each SyncSet.
// Parameters:
// resourceGroupName - the name of the resource group. The name is case insensitive.
// resourceName - the name of the SyncSet resource.
// resourceName - the name of the OpenShift cluster resource.
func (client SyncSetsClient) List(ctx context.Context, resourceGroupName string, resourceName string) (result SyncSetListPage, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SyncSetsClient.List")
@ -256,3 +429,90 @@ func (client SyncSetsClient) ListComplete(ctx context.Context, resourceGroupName
result.page, err = client.List(ctx, resourceGroupName, resourceName)
return
}
// Update the operation returns properties of a 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) Update(ctx context.Context, resourceGroupName string, resourceName string, syncSetResourceName string) (result SyncSet, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SyncSetsClient.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.SyncSetsClient", "Update", err.Error())
}
req, err := client.UpdatePreparer(ctx, resourceGroupName, resourceName, syncSetResourceName)
if err != nil {
err = autorest.NewErrorWithError(err, "redhatopenshift.SyncSetsClient", "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.SyncSetsClient", "Update", resp, "Failure sending request")
return
}
result, err = client.UpdateResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "redhatopenshift.SyncSetsClient", "Update", resp, "Failure responding to request")
return
}
return
}
// UpdatePreparer prepares the Update request.
func (client SyncSetsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, syncSetResourceName 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),
}
const APIVersion = "2022-09-04"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/syncSet/{syncSetResourceName}", pathParameters),
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 SyncSetsClient) 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 SyncSetsClient) UpdateResponder(resp *http.Response) (result SyncSet, err error) {
err = autorest.Respond(
resp,
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}

Просмотреть файл

@ -1776,7 +1776,7 @@ func TestPutOrPatchOpenShiftClusterValidated(t *testing.T) {
}
}
func TestEnrichSystemData(t *testing.T) {
func TestEnrichClusterSystemData(t *testing.T) {
accountID1 := "00000000-0000-0000-0000-000000000001"
accountID2 := "00000000-0000-0000-0000-000000000002"
timestampString := "2021-01-23T12:34:54.0000000Z"

Просмотреть файл

@ -5,7 +5,6 @@ package swagger
import (
"encoding/json"
"fmt"
"io/ioutil"
"os"
@ -35,9 +34,6 @@ func (g *generator) generateExamples(outputDir string, s *Swagger) error {
}{
Responses: Responses{},
}
for _, v := range op.Schemes {
fmt.Println("scheme: ", v)
}
for _, param := range op.Parameters {
switch param := param.(type) {
case Reference:
@ -62,11 +58,6 @@ func (g *generator) generateExamples(outputDir string, s *Swagger) error {
Name: "location",
Parameter: "location",
})
case "../../../../../common-types/resource-management/" + g.commonTypesVersion + "/types.json#/parameters/ClusterParameter":
example.Parameters = append(example.Parameters, NameParameter{
Name: "cluster",
Parameter: "cluster",
})
}
case Parameter:
switch param.Name {
@ -91,15 +82,15 @@ func (g *generator) generateExamples(outputDir string, s *Swagger) error {
Name: param.Name,
Parameter: g.exampleOpenShiftClusterPatchParameter(),
})
case "#/definitions/Configuration":
example.Parameters = append(example.Parameters, NameParameter{
Name: param.Name,
Parameter: g.exampleSyncSetPutParameter,
})
case "#/definitions/Syncset":
example.Parameters = append(example.Parameters, NameParameter{
Name: param.Name,
Parameter: g.exampleSyncSetPutParameter,
Parameter: g.exampleSyncSetPutParameter(),
})
case "#/definitions/SyncsetUpdate":
example.Parameters = append(example.Parameters, NameParameter{
Name: param.Name,
Parameter: g.exampleSyncSetPatchParameter(),
})
}
}

Просмотреть файл

@ -51,16 +51,24 @@ func (g *generator) populateParameters(n int, typ, friendlyName string) (s []int
}
if n > 2 {
temp := friendlyName
if temp == "SyncSet" {
temp = "OpenShift cluster"
}
s = append(s, Parameter{
Name: "resourceName",
In: "path",
Description: "The name of the " + friendlyName + " resource.",
Description: "The name of the " + temp + " resource.",
Required: true,
Type: "string",
})
}
if n == 7 {
// gross. this is really hacky :/
// this covers get,put,patch,delete by adding this
// parameter as a required parameter for those operations
// except when n==10, then its not a required parameter
if n >= 7 && n != 10 {
s = append(s, Parameter{
Name: "syncSetResourceName",
In: "path",
@ -144,30 +152,30 @@ func (g *generator) populateChildResourcePaths(ps Paths, resourceProviderNamespa
Parameters: g.populateParameters(7, titleCaser.String(childResourceType), friendlyName),
Responses: g.populateResponses(titleCaser.String(childResourceType), false, http.StatusOK),
},
// Put: &Operation{
// Tags: []string{titleCaser.String(childResourceType) + "s"},
// Summary: "Creates or updates a " + friendlyName + " with the specified subscription, resource group and resource name.",
// Description: "The operation returns properties of a " + friendlyName + ".",
// OperationID: titleCaser.String(childResourceType) + "s_CreateOrUpdate",
// Parameters: g.populateParameters(4, titleCaser.String(childResourceType), friendlyName),
// Responses: g.populateResponses(titleCaser.String(childResourceType), false, http.StatusOK, http.StatusCreated),
// },
// Delete: &Operation{
// Tags: []string{titleCaser.String(childResourceType) + "s"},
// Summary: "Deletes a " + friendlyName + " with the specified subscription, resource group and resource name.",
// Description: "The operation returns nothing.",
// OperationID: titleCaser.String(childResourceType) + "s_Delete",
// Parameters: g.populateParameters(3, titleCaser.String(childResourceType), friendlyName),
// Responses: g.populateResponses(titleCaser.String(childResourceType), true, http.StatusAccepted, 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.",
// Description: "The operation returns properties of a " + friendlyName + ".",
// OperationID: titleCaser.String(childResourceType) + "s_Update",
// Parameters: g.populateParameters(5, titleCaser.String(childResourceType), friendlyName),
// Responses: g.populateResponses(titleCaser.String(childResourceType), false, http.StatusOK, http.StatusCreated),
// },
Put: &Operation{
Tags: []string{titleCaser.String(childResourceType) + "s"},
Summary: "Creates or updates a " + friendlyName + " with the specified subscription, resource group and resource name.",
Description: "The operation returns properties of a " + friendlyName + ".",
OperationID: titleCaser.String(childResourceType) + "s_CreateOrUpdate",
Parameters: g.populateParameters(8, titleCaser.String(childResourceType), friendlyName),
Responses: g.populateResponses(titleCaser.String(childResourceType), false, http.StatusOK, http.StatusCreated),
},
Delete: &Operation{
Tags: []string{titleCaser.String(childResourceType) + "s"},
Summary: "Deletes a " + friendlyName + " with the specified subscription, resource group and resource name.",
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),
},
Patch: &Operation{
Tags: []string{titleCaser.String(childResourceType) + "s"},
Summary: "Creates or updates 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),
Responses: g.populateResponses(titleCaser.String(childResourceType), false, http.StatusOK, http.StatusCreated),
},
}
}

Просмотреть файл

@ -117,7 +117,7 @@ func Run(api, outputDir string) error {
}
if g.clusterManager {
names = append(names, "SyncSet", "SyncSetList")
names = append(names, "SyncSetList")
}
err = define(s.Definitions, api, g.xmsEnum, g.xmsSecretList, g.xmsIdentifiers, names...)
@ -131,7 +131,14 @@ func Run(api, outputDir string) error {
return err
}
for _, azureResource := range []string{resourceName} {
azureResources := []string{
resourceName,
}
if g.clusterManager {
azureResources = append(azureResources, "SyncSet")
}
for _, azureResource := range azureResources {
def, err := deepCopy(s.Definitions[azureResource])
if err != nil {
return err
@ -154,10 +161,12 @@ func Run(api, outputDir string) error {
update.Properties = properties
s.Definitions[azureResource+"Update"] = update
s.Definitions[azureResource].AllOf = []Schema{
{
Ref: "../../../../../common-types/resource-management/" + g.commonTypesVersion + "/types.json#/definitions/TrackedResource",
},
if azureResource != "SyncSet" {
s.Definitions[azureResource].AllOf = []Schema{
{
Ref: "../../../../../common-types/resource-management/" + g.commonTypesVersion + "/types.json#/definitions/TrackedResource",
},
}
}
properties = nil
@ -170,20 +179,6 @@ func Run(api, outputDir string) error {
}
s.Definitions[azureResource].Properties = properties
if _, ok := s.Definitions["SyncSet"]; ok {
properties = nil
for _, property := range s.Definitions["SyncSet"].Properties {
if property.Name == "properties" {
if property.Schema == nil {
property.Schema = &Schema{}
}
property.Schema.ClientFlatten = true
properties = append(properties, property)
}
}
s.Definitions["SyncSet"].Properties = properties
}
if g.systemData {
s.defineSystemData([]string{azureResource, azureResource + "Update"}, g.commonTypesVersion)
}

Просмотреть файл

@ -162,14 +162,9 @@ func (tw *typeWalker) schemaFromType(t types.Type, deps map[*types.Named]struct{
}
}
}
case *types.Interface:
s.Type = "object"
default:
panic(t)
}
return
}

Просмотреть файл

@ -22,6 +22,8 @@ type ArmResource struct {
}
// SubResource represents an ARM Proxy Resource
// ARM supports up to 3 levels of nested resources
// https://eng.ms/docs/products/arm/api_contracts/guidelines/rpc#rpc030-avoid-excessive-resource-type-nesting
type SubResource struct {
ResourceName string
ResourceType string
@ -38,6 +40,8 @@ func (r ArmResource) String() string {
return fmt.Sprintf("/subscriptions/%s/resourceGroups/%s/providers/%s/%s/%s/%s/%s", r.SubscriptionID, r.ResourceGroup, r.Provider, r.ResourceType, r.ResourceName, r.SubResource.ResourceType, r.SubResource.ResourceName)
}
// ParseArmResourceId take the resourceID of a child resource to an OpenShiftCluster
// TODO
func ParseArmResourceId(resourceId string) (*ArmResource, error) {
const resourceIDPatternText = `(?i)subscriptions/(.+)/resourceGroups/(.+)/providers/(.+?)/(.+?)/(.+?)/(.+?)/(.+)`
resourceIDPattern := regexp.MustCompile(resourceIDPatternText)

Просмотреть файл

@ -35,7 +35,7 @@ try:
from ._models_py3 import ServicePrincipalProfile
from ._models_py3 import SyncSet
from ._models_py3 import SyncSetList
from ._models_py3 import SyncSetSpec
from ._models_py3 import SyncSetUpdate
from ._models_py3 import SystemData
from ._models_py3 import TrackedResource
from ._models_py3 import WorkerProfile
@ -60,7 +60,7 @@ except (SyntaxError, ImportError):
from ._models import ServicePrincipalProfile # type: ignore
from ._models import SyncSet # type: ignore
from ._models import SyncSetList # type: ignore
from ._models import SyncSetSpec # type: ignore
from ._models import SyncSetUpdate # type: ignore
from ._models import SystemData # type: ignore
from ._models import TrackedResource # type: ignore
from ._models import WorkerProfile # type: ignore
@ -94,7 +94,7 @@ __all__ = [
'ServicePrincipalProfile',
'SyncSet',
'SyncSetList',
'SyncSetSpec',
'SyncSetUpdate',
'SystemData',
'TrackedResource',
'WorkerProfile',

Просмотреть файл

@ -864,11 +864,50 @@ class ServicePrincipalProfile(msrest.serialization.Model):
self.client_secret = kwargs.get('client_secret', None)
class SyncSet(ProxyResource):
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.
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
@ -880,22 +919,10 @@ class SyncSet(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 cluster_resource_id: The parent Azure Red Hat OpenShift resourceID.
:vartype cluster_resource_id: str
:ivar api_version: APIVersion for the SyncSet.
:vartype api_version: str
:ivar kind: SyncSet kind.
:vartype kind: str
:ivar metadata: Metadata for the SyncSet.
:vartype metadata: dict[str, str]
:ivar spec: The SyncSet Specification.
:vartype spec: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SyncSetSpec
:ivar cluster_deployment_refs: ClusterDeploymentRefs map SyncSets to a Hive Cluster Deployment.
:vartype cluster_deployment_refs: any
:ivar resources: Resources represents the SyncSets configuration.
:vartype resources: dict[str, str]
:ivar status: The status of the object.
:vartype status: str
: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
"""
_validation = {
@ -910,60 +937,6 @@ class SyncSet(ProxyResource):
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'system_data': {'key': 'systemData', 'type': 'SystemData'},
'cluster_resource_id': {'key': 'properties.clusterResourceId', 'type': 'str'},
'api_version': {'key': 'properties.apiVersion', 'type': 'str'},
'kind': {'key': 'properties.kind', 'type': 'str'},
'metadata': {'key': 'properties.metadata', 'type': '{str}'},
'spec': {'key': 'properties.spec', 'type': 'SyncSetSpec'},
'cluster_deployment_refs': {'key': 'properties.clusterDeploymentRefs', 'type': 'object'},
'resources': {'key': 'properties.resources', 'type': '{str}'},
'status': {'key': 'properties.status', 'type': 'str'},
}
def __init__(
self,
**kwargs
):
"""
:keyword cluster_resource_id: The parent Azure Red Hat OpenShift resourceID.
:paramtype cluster_resource_id: str
:keyword api_version: APIVersion for the SyncSet.
:paramtype api_version: str
:keyword kind: SyncSet kind.
:paramtype kind: str
:keyword metadata: Metadata for the SyncSet.
:paramtype metadata: dict[str, str]
:keyword spec: The SyncSet Specification.
:paramtype spec: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SyncSetSpec
:keyword cluster_deployment_refs: ClusterDeploymentRefs map SyncSets to a Hive Cluster
Deployment.
:paramtype cluster_deployment_refs: any
:keyword resources: Resources represents the SyncSets configuration.
:paramtype resources: dict[str, str]
:keyword status: The status of the object.
:paramtype status: str
"""
super(SyncSet, self).__init__(**kwargs)
self.cluster_resource_id = kwargs.get('cluster_resource_id', None)
self.api_version = kwargs.get('api_version', None)
self.kind = kwargs.get('kind', None)
self.metadata = kwargs.get('metadata', None)
self.spec = kwargs.get('spec', None)
self.cluster_deployment_refs = kwargs.get('cluster_deployment_refs', None)
self.resources = kwargs.get('resources', None)
self.status = kwargs.get('status', None)
class SyncSetList(msrest.serialization.Model):
"""SyncSetList represents a list of SyncSets.
:ivar value:
: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'},
}
@ -973,7 +946,7 @@ class SyncSetList(msrest.serialization.Model):
**kwargs
):
"""
:keyword value:
:keyword value: The list of syncsets.
:paramtype value: list[~azure.mgmt.redhatopenshift.v2022_09_04.models.SyncSet]
:keyword next_link: The link used to get the next page of operations.
:paramtype next_link: str
@ -983,21 +956,27 @@ class SyncSetList(msrest.serialization.Model):
self.next_link = kwargs.get('next_link', None)
class SyncSetSpec(msrest.serialization.Model):
"""SyncSetSpec.
class SyncSetUpdate(msrest.serialization.Model):
"""SyncSet represents a SyncSet for an Azure Red Hat OpenShift Cluster.
:ivar cluster_deployment_refs: ClusterDeploymentRefs map SyncSets to a Hive Cluster Deployment.
:vartype cluster_deployment_refs: any
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: dict[str, any]
:ivar status: The status of the object.
:vartype status: str
:vartype resources: str
"""
_validation = {
'system_data': {'readonly': True},
}
_attribute_map = {
'cluster_deployment_refs': {'key': 'clusterDeploymentRefs', 'type': 'object'},
'resources': {'key': 'resources', 'type': '{object}'},
'status': {'key': 'status', 'type': 'str'},
'system_data': {'key': 'systemData', 'type': 'SystemData'},
'cluster_resource_id': {'key': 'properties.clusterResourceId', 'type': 'str'},
'resources': {'key': 'properties.resources', 'type': 'str'},
}
def __init__(
@ -1005,18 +984,15 @@ class SyncSetSpec(msrest.serialization.Model):
**kwargs
):
"""
:keyword cluster_deployment_refs: ClusterDeploymentRefs map SyncSets to a Hive Cluster
Deployment.
:paramtype cluster_deployment_refs: any
: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: dict[str, any]
:keyword status: The status of the object.
:paramtype status: str
:paramtype resources: str
"""
super(SyncSetSpec, self).__init__(**kwargs)
self.cluster_deployment_refs = kwargs.get('cluster_deployment_refs', None)
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)
self.status = kwargs.get('status', None)
class SystemData(msrest.serialization.Model):

Просмотреть файл

@ -15,7 +15,7 @@
# --------------------------------------------------------------------------
import datetime
from typing import Any, Dict, List, Optional, Union
from typing import Dict, List, Optional, Union
import msrest.serialization
@ -949,11 +949,53 @@ class ServicePrincipalProfile(msrest.serialization.Model):
self.client_secret = client_secret
class SyncSet(ProxyResource):
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.
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
@ -965,22 +1007,10 @@ class SyncSet(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 cluster_resource_id: The parent Azure Red Hat OpenShift resourceID.
:vartype cluster_resource_id: str
:ivar api_version: APIVersion for the SyncSet.
:vartype api_version: str
:ivar kind: SyncSet kind.
:vartype kind: str
:ivar metadata: Metadata for the SyncSet.
:vartype metadata: dict[str, str]
:ivar spec: The SyncSet Specification.
:vartype spec: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SyncSetSpec
:ivar cluster_deployment_refs: ClusterDeploymentRefs map SyncSets to a Hive Cluster Deployment.
:vartype cluster_deployment_refs: any
:ivar resources: Resources represents the SyncSets configuration.
:vartype resources: dict[str, str]
:ivar status: The status of the object.
:vartype status: str
: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
"""
_validation = {
@ -995,69 +1025,6 @@ class SyncSet(ProxyResource):
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'system_data': {'key': 'systemData', 'type': 'SystemData'},
'cluster_resource_id': {'key': 'properties.clusterResourceId', 'type': 'str'},
'api_version': {'key': 'properties.apiVersion', 'type': 'str'},
'kind': {'key': 'properties.kind', 'type': 'str'},
'metadata': {'key': 'properties.metadata', 'type': '{str}'},
'spec': {'key': 'properties.spec', 'type': 'SyncSetSpec'},
'cluster_deployment_refs': {'key': 'properties.clusterDeploymentRefs', 'type': 'object'},
'resources': {'key': 'properties.resources', 'type': '{str}'},
'status': {'key': 'properties.status', 'type': 'str'},
}
def __init__(
self,
*,
cluster_resource_id: Optional[str] = None,
api_version: Optional[str] = None,
kind: Optional[str] = None,
metadata: Optional[Dict[str, str]] = None,
spec: Optional["SyncSetSpec"] = None,
cluster_deployment_refs: Optional[Any] = None,
resources: Optional[Dict[str, str]] = None,
status: Optional[str] = None,
**kwargs
):
"""
:keyword cluster_resource_id: The parent Azure Red Hat OpenShift resourceID.
:paramtype cluster_resource_id: str
:keyword api_version: APIVersion for the SyncSet.
:paramtype api_version: str
:keyword kind: SyncSet kind.
:paramtype kind: str
:keyword metadata: Metadata for the SyncSet.
:paramtype metadata: dict[str, str]
:keyword spec: The SyncSet Specification.
:paramtype spec: ~azure.mgmt.redhatopenshift.v2022_09_04.models.SyncSetSpec
:keyword cluster_deployment_refs: ClusterDeploymentRefs map SyncSets to a Hive Cluster
Deployment.
:paramtype cluster_deployment_refs: any
:keyword resources: Resources represents the SyncSets configuration.
:paramtype resources: dict[str, str]
:keyword status: The status of the object.
:paramtype status: str
"""
super(SyncSet, self).__init__(**kwargs)
self.cluster_resource_id = cluster_resource_id
self.api_version = api_version
self.kind = kind
self.metadata = metadata
self.spec = spec
self.cluster_deployment_refs = cluster_deployment_refs
self.resources = resources
self.status = status
class SyncSetList(msrest.serialization.Model):
"""SyncSetList represents a list of SyncSets.
:ivar value:
: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'},
}
@ -1070,7 +1037,7 @@ class SyncSetList(msrest.serialization.Model):
**kwargs
):
"""
:keyword value:
:keyword value: The list of syncsets.
:paramtype value: list[~azure.mgmt.redhatopenshift.v2022_09_04.models.SyncSet]
:keyword next_link: The link used to get the next page of operations.
:paramtype next_link: str
@ -1080,44 +1047,46 @@ class SyncSetList(msrest.serialization.Model):
self.next_link = next_link
class SyncSetSpec(msrest.serialization.Model):
"""SyncSetSpec.
class SyncSetUpdate(msrest.serialization.Model):
"""SyncSet represents a SyncSet for an Azure Red Hat OpenShift Cluster.
:ivar cluster_deployment_refs: ClusterDeploymentRefs map SyncSets to a Hive Cluster Deployment.
:vartype cluster_deployment_refs: any
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: dict[str, any]
:ivar status: The status of the object.
:vartype status: str
:vartype resources: str
"""
_validation = {
'system_data': {'readonly': True},
}
_attribute_map = {
'cluster_deployment_refs': {'key': 'clusterDeploymentRefs', 'type': 'object'},
'resources': {'key': 'resources', 'type': '{object}'},
'status': {'key': 'status', 'type': 'str'},
'system_data': {'key': 'systemData', 'type': 'SystemData'},
'cluster_resource_id': {'key': 'properties.clusterResourceId', 'type': 'str'},
'resources': {'key': 'properties.resources', 'type': 'str'},
}
def __init__(
self,
*,
cluster_deployment_refs: Optional[Any] = None,
resources: Optional[Dict[str, Any]] = None,
status: Optional[str] = None,
cluster_resource_id: Optional[str] = None,
resources: Optional[str] = None,
**kwargs
):
"""
:keyword cluster_deployment_refs: ClusterDeploymentRefs map SyncSets to a Hive Cluster
Deployment.
:paramtype cluster_deployment_refs: any
: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: dict[str, any]
:keyword status: The status of the object.
:paramtype status: str
:paramtype resources: str
"""
super(SyncSetSpec, self).__init__(**kwargs)
self.cluster_deployment_refs = cluster_deployment_refs
super(SyncSetUpdate, self).__init__(**kwargs)
self.system_data = None
self.cluster_resource_id = cluster_resource_id
self.resources = resources
self.status = status
class SystemData(msrest.serialization.Model):

Просмотреть файл

@ -114,6 +114,123 @@ def build_get_request(
**kwargs
)
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
**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}/syncSet/{syncSetResourceName}") # 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'),
}
_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="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
sync_set_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}/syncSet/{syncSetResourceName}") # 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'),
}
_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
sync_set_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}/syncSet/{syncSetResourceName}") # 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'),
}
_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="PATCH",
url=_url,
params=_query_parameters,
headers=_header_parameters,
**kwargs
)
# fmt: on
class SyncSetsOperations(object):
"""SyncSetsOperations operations.
@ -151,7 +268,7 @@ class SyncSetsOperations(object):
: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 SyncSet resource.
: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 SyncSetList or the result of cls(response)
@ -237,7 +354,7 @@ class SyncSetsOperations(object):
: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 SyncSet resource.
: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
@ -286,3 +403,202 @@ class SyncSetsOperations(object):
get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/syncSet/{syncSetResourceName}"} # type: ignore
@distributed_trace
def create_or_update(
self,
resource_group_name, # type: str
resource_name, # type: str
sync_set_resource_name, # type: str
**kwargs # type: Any
):
# type: (...) -> "_models.SyncSet"
"""Creates or updates a SyncSet with the specified subscription, resource group and resource name.
The operation returns properties of a SyncSet.
: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 sync_set_resource_name: The name of the SyncSet resource.
:type sync_set_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
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.SyncSet"]
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_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,
api_version=api_version,
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('SyncSet', pipeline_response)
if response.status_code == 201:
deserialized = self._deserialize('SyncSet', 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}/syncSet/{syncSetResourceName}"} # type: ignore
@distributed_trace
def delete( # pylint: disable=inconsistent-return-statements
self,
resource_group_name, # type: str
resource_name, # type: str
sync_set_resource_name, # type: str
**kwargs # type: Any
):
# type: (...) -> None
"""Deletes a SyncSet 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 sync_set_resource_name: The name of the SyncSet resource.
:type sync_set_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,
sync_set_resource_name=sync_set_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 [202, 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
@distributed_trace
def update(
self,
resource_group_name, # type: str
resource_name, # type: str
sync_set_resource_name, # type: str
**kwargs # type: Any
):
# type: (...) -> "_models.SyncSet"
"""Creates or updates a SyncSet with the specified subscription, resource group and resource name.
The operation returns properties of a SyncSet.
: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 sync_set_resource_name: The name of the SyncSet resource.
:type sync_set_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
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.SyncSet"]
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_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,
api_version=api_version,
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('SyncSet', pipeline_response)
if response.status_code == 201:
deserialized = self._deserialize('SyncSet', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/syncSet/{syncSetResourceName}"} # type: ignore

Просмотреть файл

@ -0,0 +1,31 @@
{
"parameters": {
"api-version": "2022-09-04",
"subscriptionId": "subscriptionId",
"resourceGroupName": "resourceGroup",
"resourceName": "resourceName",
"syncSetResourceName": "syncSetResourceName"
},
"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="
}
}
}
}
}

Просмотреть файл

@ -0,0 +1,13 @@
{
"parameters": {
"api-version": "2022-09-04",
"subscriptionId": "subscriptionId",
"resourceGroupName": "resourceGroup",
"resourceName": "resourceName",
"syncSetResourceName": "syncSetResourceName"
},
"responses": {
"202": {},
"204": {}
}
}

Просмотреть файл

@ -13,22 +13,7 @@
"name": "mySyncSet",
"properties": {
"clusterResourceId": "/subscriptions/subscriptionid/resourcegroups/resourcegroup/providers/microsoft.redhatopenshift/openshiftclusters/resourcename",
"apiVersion": "hive.openshift.io/v1",
"kind": "SyncSet",
"metadata": {
"name": "sample",
"namespace": "aro-f60ae8a2-bca1-4987-9056-f2f6a1837caa"
},
"spec": {},
"clusterDeploymentRefs": [
"uhc-staging-1u4lhakk4ar41bi3vgn0b7v9hk93dg4m",
"aro-f60ae8a2-bca1-4987-9056-f2f6a1837caa"
],
"resources": {
"name": "worker",
"platform": "azure",
"replicas": "2"
}
"resources": "eyAKICAiYXBpVmVyc2lvbiI6ICJoaXZlLm9wZW5zaGlmdC5pby92MSIsCiAgImtpbmQiOiAiU3luY1NldCIsCiAgIm1ldGFkYXRhIjogewogICAgIm5hbWUiOiAic2FtcGxlIiwKICAgICJuYW1lc3BhY2UiOiAiYXJvLWY2MGFlOGEyLWJjYTEtNDk4Ny05MDU2LWYyZjZhMTgzN2NhYSIKICB9LAogICJzcGVjIjogewogICAgImNsdXN0ZXJEZXBsb3ltZW50UmVmcyI6IFtdLAogICAgInJlc291cmNlcyI6IFsKICAgICAgewogICAgICAgICJhcGlWZXJzaW9uIjogInYxIiwKICAgICAgICAia2luZCI6ICJDb25maWdNYXAiLAogICAgICAgICJtZXRhZGF0YSI6IHsKICAgICAgICAgICJuYW1lIjogIm15Y29uZmlnbWFwIgogICAgICAgIH0KICAgICAgfQogICAgXQogIH0KfQo="
}
}
}

Просмотреть файл

@ -15,22 +15,7 @@
"name": "mySyncSet",
"properties": {
"clusterResourceId": "/subscriptions/subscriptionid/resourcegroups/resourcegroup/providers/microsoft.redhatopenshift/openshiftclusters/resourcename",
"apiVersion": "hive.openshift.io/v1",
"kind": "SyncSet",
"metadata": {
"name": "sample",
"namespace": "aro-f60ae8a2-bca1-4987-9056-f2f6a1837caa"
},
"spec": {},
"clusterDeploymentRefs": [
"uhc-staging-1u4lhakk4ar41bi3vgn0b7v9hk93dg4m",
"aro-f60ae8a2-bca1-4987-9056-f2f6a1837caa"
],
"resources": {
"name": "worker",
"platform": "azure",
"replicas": "2"
}
"resources": "eyAKICAiYXBpVmVyc2lvbiI6ICJoaXZlLm9wZW5zaGlmdC5pby92MSIsCiAgImtpbmQiOiAiU3luY1NldCIsCiAgIm1ldGFkYXRhIjogewogICAgIm5hbWUiOiAic2FtcGxlIiwKICAgICJuYW1lc3BhY2UiOiAiYXJvLWY2MGFlOGEyLWJjYTEtNDk4Ny05MDU2LWYyZjZhMTgzN2NhYSIKICB9LAogICJzcGVjIjogewogICAgImNsdXN0ZXJEZXBsb3ltZW50UmVmcyI6IFtdLAogICAgInJlc291cmNlcyI6IFsKICAgICAgewogICAgICAgICJhcGlWZXJzaW9uIjogInYxIiwKICAgICAgICAia2luZCI6ICJDb25maWdNYXAiLAogICAgICAgICJtZXRhZGF0YSI6IHsKICAgICAgICAgICJuYW1lIjogIm15Y29uZmlnbWFwIgogICAgICAgIH0KICAgICAgfQogICAgXQogIH0KfQo="
}
}
]

Просмотреть файл

@ -0,0 +1,31 @@
{
"parameters": {
"api-version": "2022-09-04",
"subscriptionId": "subscriptionId",
"resourceGroupName": "resourceGroup",
"resourceName": "resourceName",
"syncSetResourceName": "syncSetResourceName"
},
"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="
}
}
}
}
}

Просмотреть файл

@ -154,7 +154,7 @@
{
"name": "resourceName",
"in": "path",
"description": "The name of the SyncSet resource.",
"description": "The name of the OpenShift cluster resource.",
"required": true,
"type": "string"
}
@ -556,7 +556,7 @@
{
"name": "resourceName",
"in": "path",
"description": "The name of the SyncSet resource.",
"description": "The name of the OpenShift cluster resource.",
"required": true,
"type": "string"
},
@ -587,6 +587,174 @@
"$ref": "./examples/SyncSets_Get.json"
}
}
},
"put": {
"tags": [
"SyncSets"
],
"summary": "Creates or updates a SyncSet with the specified subscription, resource group and resource name.",
"description": "The operation returns properties of a SyncSet.",
"operationId": "SyncSets_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": "syncSetResourceName",
"in": "path",
"description": "The name of the SyncSet resource.",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/SyncSet"
}
},
"201": {
"description": "Created",
"schema": {
"$ref": "#/definitions/SyncSet"
}
},
"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 SyncSet with the specified subscription, resource group and resource name.": {
"$ref": "./examples/SyncSets_CreateOrUpdate.json"
}
}
},
"delete": {
"tags": [
"SyncSets"
],
"summary": "Deletes a SyncSet with the specified subscription, resource group and resource name.",
"description": "The operation returns nothing.",
"operationId": "SyncSets_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": "syncSetResourceName",
"in": "path",
"description": "The name of the SyncSet resource.",
"required": true,
"type": "string"
}
],
"responses": {
"202": {
"description": "Accepted"
},
"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 SyncSet with the specified subscription, resource group and resource name.": {
"$ref": "./examples/SyncSets_Delete.json"
}
}
},
"patch": {
"tags": [
"SyncSets"
],
"summary": "Creates or updates a SyncSet with the specified subscription, resource group and resource name.",
"description": "The operation returns properties of a SyncSet.",
"operationId": "SyncSets_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": "syncSetResourceName",
"in": "path",
"description": "The name of the SyncSet resource.",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/SyncSet"
}
},
"201": {
"description": "Created",
"schema": {
"$ref": "#/definitions/SyncSet"
}
},
"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 SyncSet with the specified subscription, resource group and resource name.": {
"$ref": "./examples/SyncSets_Update.json"
}
}
}
}
},
@ -997,24 +1165,30 @@
"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",
"description": "The Syncsets 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
}
}
},
"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.",
"type": "array",
"items": {
"$ref": "#/definitions/SyncSet"
@ -1035,57 +1209,25 @@
"description": "The parent Azure Red Hat OpenShift resourceID.",
"type": "string"
},
"apiVersion": {
"description": "APIVersion for the SyncSet.",
"type": "string"
},
"kind": {
"description": "SyncSet kind.",
"type": "string"
},
"metadata": {
"description": "Metadata for the SyncSet.",
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"spec": {
"$ref": "#/definitions/SyncSetSpec",
"description": "The SyncSet Specification."
},
"clusterDeploymentRefs": {
"description": "ClusterDeploymentRefs map SyncSets to a Hive Cluster Deployment."
},
"resources": {
"description": "Resources represents the SyncSets configuration.",
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"status": {
"description": "The status of the object.",
"type": "string"
}
}
},
"SyncSetSpec": {
"SyncSetUpdate": {
"description": "SyncSet represents a SyncSet for an Azure Red Hat OpenShift Cluster.",
"type": "object",
"properties": {
"clusterDeploymentRefs": {
"description": "ClusterDeploymentRefs map SyncSets to a Hive Cluster Deployment."
"properties": {
"$ref": "#/definitions/SyncSetProperties",
"description": "The Syncsets properties",
"x-ms-client-flatten": true
},
"resources": {
"description": "Resources represents the SyncSets configuration.",
"type": "object",
"additionalProperties": {
"type": "object"
}
},
"status": {
"description": "The status of the object.",
"type": "string"
"systemData": {
"$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/systemData",
"description": "The system meta data relating to this resource.",
"readOnly": true
}
}
},

Просмотреть файл

@ -1,10 +0,0 @@
openshiftcluster
openshiftclusters
listinstallversion
listinstallversions
syncset
syncsets
machinepool
machinepools
syncidentityprovider
syncidentityproviders