From ca6b08670344544f97572b53d97ab339f273dfe1 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Wed, 3 Dec 2025 22:18:05 +0000 Subject: [PATCH] Configurations: 'specification/containerservice/Fleet.Management/tspconfig.yaml', API Version: 2025-08-01-preview, SDK Release Type: beta, and CommitSHA: 'd0cd556bd91d2dda700e983c0d253fa025b324c0' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=5634442 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --- .../armcontainerservicefleet/CHANGELOG.md | 43 ++ .../autoupgradeprofileoperations_client.go | 6 +- ...deprofileoperations_client_example_test.go | 2 +- .../autoupgradeprofiles_client.go | 20 +- ...autoupgradeprofiles_client_example_test.go | 16 +- .../client_factory.go | 8 + .../armcontainerservicefleet/constants.go | 218 ++++++ .../fake/fleetmanagednamespaces_server.go | 376 ++++++++++ .../fake/server_factory.go | 9 + .../fleetmanagednamespaces_client.go | 439 +++++++++++ ...etmanagednamespaces_client_example_test.go | 613 +++++++++++++++ .../fleetmembers_client.go | 26 +- .../fleetmembers_client_example_test.go | 20 +- .../armcontainerservicefleet/fleets_client.go | 34 +- .../fleets_client_example_test.go | 28 +- .../fleetupdatestrategies_client.go | 20 +- ...eetupdatestrategies_client_example_test.go | 16 +- .../armcontainerservicefleet/gates_client.go | 14 +- .../gates_client_example_test.go | 185 ++++- .../armcontainerservicefleet/models.go | 260 +++++++ .../armcontainerservicefleet/models_serde.go | 707 ++++++++++++++++++ .../operations_client.go | 4 +- .../operations_client_example_test.go | 6 +- .../armcontainerservicefleet/options.go | 44 ++ .../armcontainerservicefleet/responses.go | 29 + .../testdata/_metadata.json | 4 +- .../tsp-location.yaml | 2 +- .../updateruns_client.go | 38 +- .../updateruns_client_example_test.go | 28 +- .../armcontainerservicefleet/version.go | 2 +- 30 files changed, 3068 insertions(+), 149 deletions(-) create mode 100644 sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fake/fleetmanagednamespaces_server.go create mode 100644 sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleetmanagednamespaces_client.go create mode 100644 sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleetmanagednamespaces_client_example_test.go diff --git a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/CHANGELOG.md b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/CHANGELOG.md index 1f81dac4459c..b159a9959533 100644 --- a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/CHANGELOG.md +++ b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/CHANGELOG.md @@ -1,5 +1,48 @@ # Release History +## 3.0.0-beta.2 (2025-12-03) +### Features Added + +- New enum type `AdoptionPolicy` with values `AdoptionPolicyAlways`, `AdoptionPolicyIfIdentical`, `AdoptionPolicyNever` +- New enum type `DeletePolicy` with values `DeletePolicyDelete`, `DeletePolicyKeep` +- New enum type `FleetManagedNamespaceProvisioningState` with values `FleetManagedNamespaceProvisioningStateCanceled`, `FleetManagedNamespaceProvisioningStateCreating`, `FleetManagedNamespaceProvisioningStateDeleting`, `FleetManagedNamespaceProvisioningStateFailed`, `FleetManagedNamespaceProvisioningStateSucceeded`, `FleetManagedNamespaceProvisioningStateUpdating` +- New enum type `LabelSelectorOperator` with values `LabelSelectorOperatorDoesNotExist`, `LabelSelectorOperatorExists`, `LabelSelectorOperatorIn`, `LabelSelectorOperatorNotIn` +- New enum type `PlacementType` with values `PlacementTypePickAll`, `PlacementTypePickFixed` +- New enum type `PolicyRule` with values `PolicyRuleAllowAll`, `PolicyRuleAllowSameNamespace`, `PolicyRuleDenyAll` +- New enum type `PropagationType` with values `PropagationTypePlacement` +- New enum type `PropertySelectorOperator` with values `PropertySelectorOperatorEq`, `PropertySelectorOperatorGe`, `PropertySelectorOperatorGt`, `PropertySelectorOperatorLe`, `PropertySelectorOperatorLt`, `PropertySelectorOperatorNe` +- New enum type `TaintEffect` with values `TaintEffectNoSchedule` +- New enum type `TolerationOperator` with values `TolerationOperatorEqual`, `TolerationOperatorExists` +- New function `*ClientFactory.NewFleetManagedNamespacesClient() *FleetManagedNamespacesClient` +- New function `NewFleetManagedNamespacesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FleetManagedNamespacesClient, error)` +- New function `*FleetManagedNamespacesClient.BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, fleetName string, managedNamespaceName string, resource FleetManagedNamespace, options *FleetManagedNamespacesClientBeginCreateOrUpdateOptions) (*runtime.Poller[FleetManagedNamespacesClientCreateOrUpdateResponse], error)` +- New function `*FleetManagedNamespacesClient.BeginDelete(ctx context.Context, resourceGroupName string, fleetName string, managedNamespaceName string, options *FleetManagedNamespacesClientBeginDeleteOptions) (*runtime.Poller[FleetManagedNamespacesClientDeleteResponse], error)` +- New function `*FleetManagedNamespacesClient.Get(ctx context.Context, resourceGroupName string, fleetName string, managedNamespaceName string, options *FleetManagedNamespacesClientGetOptions) (FleetManagedNamespacesClientGetResponse, error)` +- New function `*FleetManagedNamespacesClient.NewListByFleetPager(resourceGroupName string, fleetName string, options *FleetManagedNamespacesClientListByFleetOptions) *runtime.Pager[FleetManagedNamespacesClientListByFleetResponse]` +- New function `*FleetManagedNamespacesClient.BeginUpdate(ctx context.Context, resourceGroupName string, fleetName string, managedNamespaceName string, properties FleetManagedNamespacePatch, options *FleetManagedNamespacesClientBeginUpdateOptions) (*runtime.Poller[FleetManagedNamespacesClientUpdateResponse], error)` +- New struct `Affinity` +- New struct `ClusterAffinity` +- New struct `ClusterResourcePlacementSpec` +- New struct `ClusterSelector` +- New struct `ClusterSelectorTerm` +- New struct `FleetManagedNamespace` +- New struct `FleetManagedNamespaceListResult` +- New struct `FleetManagedNamespacePatch` +- New struct `FleetManagedNamespaceProperties` +- New struct `FleetManagedNamespaceStatus` +- New struct `LabelSelector` +- New struct `LabelSelectorRequirement` +- New struct `ManagedNamespaceProperties` +- New struct `NetworkPolicy` +- New struct `PlacementPolicy` +- New struct `PlacementProfile` +- New struct `PropagationPolicy` +- New struct `PropertySelector` +- New struct `PropertySelectorRequirement` +- New struct `ResourceQuota` +- New struct `Toleration` + + ## 3.0.0-beta.1 (2025-08-07) ### Breaking Changes diff --git a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/autoupgradeprofileoperations_client.go b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/autoupgradeprofileoperations_client.go index 94e6dc92f32f..429d701e364a 100644 --- a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/autoupgradeprofileoperations_client.go +++ b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/autoupgradeprofileoperations_client.go @@ -42,7 +42,7 @@ func NewAutoUpgradeProfileOperationsClient(subscriptionID string, credential azc // BeginGenerateUpdateRun - Generates an update run for a given auto upgrade profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-04-01-preview +// Generated from API version 2025-08-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - fleetName - The name of the Fleet resource. // - autoUpgradeProfileName - The name of the AutoUpgradeProfile resource. @@ -69,7 +69,7 @@ func (client *AutoUpgradeProfileOperationsClient) BeginGenerateUpdateRun(ctx con // GenerateUpdateRun - Generates an update run for a given auto upgrade profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-04-01-preview +// Generated from API version 2025-08-01-preview func (client *AutoUpgradeProfileOperationsClient) generateUpdateRun(ctx context.Context, resourceGroupName string, fleetName string, autoUpgradeProfileName string, options *AutoUpgradeProfileOperationsClientBeginGenerateUpdateRunOptions) (*http.Response, error) { var err error const operationName = "AutoUpgradeProfileOperationsClient.BeginGenerateUpdateRun" @@ -115,7 +115,7 @@ func (client *AutoUpgradeProfileOperationsClient) generateUpdateRunCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-04-01-preview") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/autoupgradeprofileoperations_client_example_test.go b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/autoupgradeprofileoperations_client_example_test.go index 4b9d9535174d..f49ec1cf9272 100644 --- a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/autoupgradeprofileoperations_client_example_test.go +++ b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/autoupgradeprofileoperations_client_example_test.go @@ -11,7 +11,7 @@ import ( "log" ) -// Generated from example definition: 2025-04-01-preview/AutoUpgradeProfileOperations_GenerateUpdateRun_MaximumSet_Gen.json +// Generated from example definition: 2025-08-01-preview/AutoUpgradeProfileOperations_GenerateUpdateRun_MaximumSet_Gen.json func ExampleAutoUpgradeProfileOperationsClient_BeginGenerateUpdateRun() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/autoupgradeprofiles_client.go b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/autoupgradeprofiles_client.go index 5ab032fcd9be..e090639e96e1 100644 --- a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/autoupgradeprofiles_client.go +++ b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/autoupgradeprofiles_client.go @@ -42,7 +42,7 @@ func NewAutoUpgradeProfilesClient(subscriptionID string, credential azcore.Token // BeginCreateOrUpdate - Create a AutoUpgradeProfile // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-04-01-preview +// Generated from API version 2025-08-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - fleetName - The name of the Fleet resource. // - autoUpgradeProfileName - The name of the AutoUpgradeProfile resource. @@ -69,7 +69,7 @@ func (client *AutoUpgradeProfilesClient) BeginCreateOrUpdate(ctx context.Context // CreateOrUpdate - Create a AutoUpgradeProfile // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-04-01-preview +// Generated from API version 2025-08-01-preview func (client *AutoUpgradeProfilesClient) createOrUpdate(ctx context.Context, resourceGroupName string, fleetName string, autoUpgradeProfileName string, resource AutoUpgradeProfile, options *AutoUpgradeProfilesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "AutoUpgradeProfilesClient.BeginCreateOrUpdate" @@ -115,7 +115,7 @@ func (client *AutoUpgradeProfilesClient) createOrUpdateCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-04-01-preview") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.IfMatch != nil { @@ -134,7 +134,7 @@ func (client *AutoUpgradeProfilesClient) createOrUpdateCreateRequest(ctx context // BeginDelete - Delete a AutoUpgradeProfile // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-04-01-preview +// Generated from API version 2025-08-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - fleetName - The name of the Fleet resource. // - autoUpgradeProfileName - The name of the AutoUpgradeProfile resource. @@ -160,7 +160,7 @@ func (client *AutoUpgradeProfilesClient) BeginDelete(ctx context.Context, resour // Delete - Delete a AutoUpgradeProfile // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-04-01-preview +// Generated from API version 2025-08-01-preview func (client *AutoUpgradeProfilesClient) deleteOperation(ctx context.Context, resourceGroupName string, fleetName string, autoUpgradeProfileName string, options *AutoUpgradeProfilesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "AutoUpgradeProfilesClient.BeginDelete" @@ -206,7 +206,7 @@ func (client *AutoUpgradeProfilesClient) deleteCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-04-01-preview") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -217,7 +217,7 @@ func (client *AutoUpgradeProfilesClient) deleteCreateRequest(ctx context.Context // Get - Get a AutoUpgradeProfile // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-04-01-preview +// Generated from API version 2025-08-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - fleetName - The name of the Fleet resource. // - autoUpgradeProfileName - The name of the AutoUpgradeProfile resource. @@ -268,7 +268,7 @@ func (client *AutoUpgradeProfilesClient) getCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-04-01-preview") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -285,7 +285,7 @@ func (client *AutoUpgradeProfilesClient) getHandleResponse(resp *http.Response) // NewListByFleetPager - List AutoUpgradeProfile resources by Fleet // -// Generated from API version 2025-04-01-preview +// Generated from API version 2025-08-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - fleetName - The name of the Fleet resource. // - options - AutoUpgradeProfilesClientListByFleetOptions contains the optional parameters for the AutoUpgradeProfilesClient.NewListByFleetPager @@ -333,7 +333,7 @@ func (client *AutoUpgradeProfilesClient) listByFleetCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-04-01-preview") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/autoupgradeprofiles_client_example_test.go b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/autoupgradeprofiles_client_example_test.go index 15691b8eb3a3..11d5dc397eaa 100644 --- a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/autoupgradeprofiles_client_example_test.go +++ b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/autoupgradeprofiles_client_example_test.go @@ -12,7 +12,7 @@ import ( "log" ) -// Generated from example definition: 2025-04-01-preview/AutoUpgradeProfiles_CreateOrUpdate.json +// Generated from example definition: 2025-08-01-preview/AutoUpgradeProfiles_CreateOrUpdate.json func ExampleAutoUpgradeProfilesClient_BeginCreateOrUpdate_createAnAutoUpgradeProfile() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -64,7 +64,7 @@ func ExampleAutoUpgradeProfilesClient_BeginCreateOrUpdate_createAnAutoUpgradePro // } } -// Generated from example definition: 2025-04-01-preview/AutoUpgradeProfiles_CreateOrUpdate_MaximumSet_Gen.json +// Generated from example definition: 2025-08-01-preview/AutoUpgradeProfiles_CreateOrUpdate_MaximumSet_Gen.json func ExampleAutoUpgradeProfilesClient_BeginCreateOrUpdate_createAnAutoUpgradeProfileGeneratedByMaximumSetRule() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -124,7 +124,7 @@ func ExampleAutoUpgradeProfilesClient_BeginCreateOrUpdate_createAnAutoUpgradePro // } } -// Generated from example definition: 2025-04-01-preview/AutoUpgradeProfiles_Delete.json +// Generated from example definition: 2025-08-01-preview/AutoUpgradeProfiles_Delete.json func ExampleAutoUpgradeProfilesClient_BeginDelete_deleteAnAutoUpgradeProfileResource() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -145,7 +145,7 @@ func ExampleAutoUpgradeProfilesClient_BeginDelete_deleteAnAutoUpgradeProfileReso } } -// Generated from example definition: 2025-04-01-preview/AutoUpgradeProfiles_Delete_MaximumSet_Gen.json +// Generated from example definition: 2025-08-01-preview/AutoUpgradeProfiles_Delete_MaximumSet_Gen.json func ExampleAutoUpgradeProfilesClient_BeginDelete_deleteAnAutoUpgradeProfileResourceGeneratedByMaximumSetRule() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -167,7 +167,7 @@ func ExampleAutoUpgradeProfilesClient_BeginDelete_deleteAnAutoUpgradeProfileReso } } -// Generated from example definition: 2025-04-01-preview/AutoUpgradeProfiles_Get.json +// Generated from example definition: 2025-08-01-preview/AutoUpgradeProfiles_Get.json func ExampleAutoUpgradeProfilesClient_Get_getsAnAutoUpgradeProfileResource() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -207,7 +207,7 @@ func ExampleAutoUpgradeProfilesClient_Get_getsAnAutoUpgradeProfileResource() { // } } -// Generated from example definition: 2025-04-01-preview/AutoUpgradeProfiles_Get_MaximumSet_Gen.json +// Generated from example definition: 2025-08-01-preview/AutoUpgradeProfiles_Get_MaximumSet_Gen.json func ExampleAutoUpgradeProfilesClient_Get_getsAnAutoUpgradeProfileResourceGeneratedByMaximumSetRule() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -252,7 +252,7 @@ func ExampleAutoUpgradeProfilesClient_Get_getsAnAutoUpgradeProfileResourceGenera // } } -// Generated from example definition: 2025-04-01-preview/AutoUpgradeProfiles_ListByFleet.json +// Generated from example definition: 2025-08-01-preview/AutoUpgradeProfiles_ListByFleet.json func ExampleAutoUpgradeProfilesClient_NewListByFleetPager_listsTheAutoUpgradeProfileResourcesByFleet() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -302,7 +302,7 @@ func ExampleAutoUpgradeProfilesClient_NewListByFleetPager_listsTheAutoUpgradePro } } -// Generated from example definition: 2025-04-01-preview/AutoUpgradeProfiles_ListByFleet_MaximumSet_Gen.json +// Generated from example definition: 2025-08-01-preview/AutoUpgradeProfiles_ListByFleet_MaximumSet_Gen.json func ExampleAutoUpgradeProfilesClient_NewListByFleetPager_listsTheAutoUpgradeProfileResourcesByFleetGeneratedByMaximumSetRule() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/client_factory.go b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/client_factory.go index 47eadee03076..d2f2ea17de9f 100644 --- a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/client_factory.go +++ b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/client_factory.go @@ -48,6 +48,14 @@ func (c *ClientFactory) NewAutoUpgradeProfilesClient() *AutoUpgradeProfilesClien } } +// NewFleetManagedNamespacesClient creates a new instance of FleetManagedNamespacesClient. +func (c *ClientFactory) NewFleetManagedNamespacesClient() *FleetManagedNamespacesClient { + return &FleetManagedNamespacesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + // NewFleetMembersClient creates a new instance of FleetMembersClient. func (c *ClientFactory) NewFleetMembersClient() *FleetMembersClient { return &FleetMembersClient{ diff --git a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/constants.go b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/constants.go index f9468253159d..b7a6601e8064 100644 --- a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/constants.go +++ b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/constants.go @@ -19,6 +19,27 @@ func PossibleActionTypeValues() []ActionType { } } +// AdoptionPolicy - Action if the Namespace with the same name already exists. +type AdoptionPolicy string + +const ( + // AdoptionPolicyAlways - Always take over the existing Namespace to be managed by ARM, even if it is not identical. + AdoptionPolicyAlways AdoptionPolicy = "Always" + // AdoptionPolicyIfIdentical - If there is an identical Namespace, take over the existing Namespace to be managed by ARM. + AdoptionPolicyIfIdentical AdoptionPolicy = "IfIdentical" + // AdoptionPolicyNever - If the Namespace already exists, do not take over the existing Namespace to be managed by ARM. + AdoptionPolicyNever AdoptionPolicy = "Never" +) + +// PossibleAdoptionPolicyValues returns the possible values for the AdoptionPolicy const type. +func PossibleAdoptionPolicyValues() []AdoptionPolicy { + return []AdoptionPolicy{ + AdoptionPolicyAlways, + AdoptionPolicyIfIdentical, + AdoptionPolicyNever, + } +} + // AutoUpgradeLastTriggerStatus - AutoUpgradeLastTriggerStatus is the status of the last AutoUpgrade trigger (attempt to automatically // create and start UpdateRun when there are new released versions) of an auto upgrade profile. type AutoUpgradeLastTriggerStatus string @@ -109,6 +130,54 @@ func PossibleCreatedByTypeValues() []CreatedByType { } } +// DeletePolicy - Delete options for the ARM managed namespace. +type DeletePolicy string + +const ( + // DeletePolicyDelete - Delete both ARM resource and Namespace. + DeletePolicyDelete DeletePolicy = "Delete" + // DeletePolicyKeep - Delete the ARM resource but keep the Namespace. + DeletePolicyKeep DeletePolicy = "Keep" +) + +// PossibleDeletePolicyValues returns the possible values for the DeletePolicy const type. +func PossibleDeletePolicyValues() []DeletePolicy { + return []DeletePolicy{ + DeletePolicyDelete, + DeletePolicyKeep, + } +} + +// FleetManagedNamespaceProvisioningState - The provisioning state of the fleet managed namespace resource +type FleetManagedNamespaceProvisioningState string + +const ( + // FleetManagedNamespaceProvisioningStateCanceled - Resource creation was canceled. + FleetManagedNamespaceProvisioningStateCanceled FleetManagedNamespaceProvisioningState = "Canceled" + // FleetManagedNamespaceProvisioningStateCreating - The provisioning state of a fleet managed namespace being created. + FleetManagedNamespaceProvisioningStateCreating FleetManagedNamespaceProvisioningState = "Creating" + // FleetManagedNamespaceProvisioningStateDeleting - The provisioning state of a fleet managed namespace being deleted. + FleetManagedNamespaceProvisioningStateDeleting FleetManagedNamespaceProvisioningState = "Deleting" + // FleetManagedNamespaceProvisioningStateFailed - Resource creation failed. + FleetManagedNamespaceProvisioningStateFailed FleetManagedNamespaceProvisioningState = "Failed" + // FleetManagedNamespaceProvisioningStateSucceeded - Resource has been created. + FleetManagedNamespaceProvisioningStateSucceeded FleetManagedNamespaceProvisioningState = "Succeeded" + // FleetManagedNamespaceProvisioningStateUpdating - The provisioning state of a fleet managed namespace being updated. + FleetManagedNamespaceProvisioningStateUpdating FleetManagedNamespaceProvisioningState = "Updating" +) + +// PossibleFleetManagedNamespaceProvisioningStateValues returns the possible values for the FleetManagedNamespaceProvisioningState const type. +func PossibleFleetManagedNamespaceProvisioningStateValues() []FleetManagedNamespaceProvisioningState { + return []FleetManagedNamespaceProvisioningState{ + FleetManagedNamespaceProvisioningStateCanceled, + FleetManagedNamespaceProvisioningStateCreating, + FleetManagedNamespaceProvisioningStateDeleting, + FleetManagedNamespaceProvisioningStateFailed, + FleetManagedNamespaceProvisioningStateSucceeded, + FleetManagedNamespaceProvisioningStateUpdating, + } +} + // FleetMemberProvisioningState - The provisioning state of the last accepted operation. type FleetMemberProvisioningState string @@ -247,6 +316,30 @@ func PossibleGateTypeValues() []GateType { } } +// LabelSelectorOperator - A label selector operator is the set of operators that can be used in a selector requirement. +type LabelSelectorOperator string + +const ( + // LabelSelectorOperatorDoesNotExist - Label Selector Operator DoesNotExist + LabelSelectorOperatorDoesNotExist LabelSelectorOperator = "DoesNotExist" + // LabelSelectorOperatorExists - Label Selector Operator Exists + LabelSelectorOperatorExists LabelSelectorOperator = "Exists" + // LabelSelectorOperatorIn - Label Selector Operator In + LabelSelectorOperatorIn LabelSelectorOperator = "In" + // LabelSelectorOperatorNotIn - Label Selector Operator NotIn + LabelSelectorOperatorNotIn LabelSelectorOperator = "NotIn" +) + +// PossibleLabelSelectorOperatorValues returns the possible values for the LabelSelectorOperator const type. +func PossibleLabelSelectorOperatorValues() []LabelSelectorOperator { + return []LabelSelectorOperator{ + LabelSelectorOperatorDoesNotExist, + LabelSelectorOperatorExists, + LabelSelectorOperatorIn, + LabelSelectorOperatorNotIn, + } +} + // ManagedClusterUpgradeType - The type of upgrade to perform when targeting ManagedClusters. type ManagedClusterUpgradeType string @@ -346,6 +439,113 @@ func PossibleOriginValues() []Origin { } } +// PlacementType - PlacementType identifies the type of placement. +type PlacementType string + +const ( + // PlacementTypePickAll - PickAll picks all clusters that satisfy the rules. + PlacementTypePickAll PlacementType = "PickAll" + // PlacementTypePickFixed - PickFixed picks a fixed set of clusters. + PlacementTypePickFixed PlacementType = "PickFixed" +) + +// PossiblePlacementTypeValues returns the possible values for the PlacementType const type. +func PossiblePlacementTypeValues() []PlacementType { + return []PlacementType{ + PlacementTypePickAll, + PlacementTypePickFixed, + } +} + +// PolicyRule - The possible values representing different network policy rules. +type PolicyRule string + +const ( + // PolicyRuleAllowAll - Allow all network traffic. + PolicyRuleAllowAll PolicyRule = "AllowAll" + // PolicyRuleAllowSameNamespace - Allow traffic within the same namespace. + PolicyRuleAllowSameNamespace PolicyRule = "AllowSameNamespace" + // PolicyRuleDenyAll - Deny all network traffic. + PolicyRuleDenyAll PolicyRule = "DenyAll" +) + +// PossiblePolicyRuleValues returns the possible values for the PolicyRule const type. +func PossiblePolicyRuleValues() []PolicyRule { + return []PolicyRule{ + PolicyRuleAllowAll, + PolicyRuleAllowSameNamespace, + PolicyRuleDenyAll, + } +} + +// PropagationType - How the namespace will be provisioned among the fleet members. +type PropagationType string + +const ( + // PropagationTypePlacement - Using ClusterResourcePlacement. + PropagationTypePlacement PropagationType = "Placement" +) + +// PossiblePropagationTypeValues returns the possible values for the PropagationType const type. +func PossiblePropagationTypeValues() []PropagationType { + return []PropagationType{ + PropagationTypePlacement, + } +} + +// PropertySelectorOperator - PropertySelectorOperator is the operator that can be used with PropertySelectorRequirements. +type PropertySelectorOperator string + +const ( + // PropertySelectorOperatorEq - Eq dictates Fleet to select cluster if its observed value of a given property is equal to + // the values specified in the requirement. + PropertySelectorOperatorEq PropertySelectorOperator = "Eq" + // PropertySelectorOperatorGe - Ge dictates Fleet to select cluster if its observed value of a given property is greater than + // or equal to the value specified in the requirement. + PropertySelectorOperatorGe PropertySelectorOperator = "Ge" + // PropertySelectorOperatorGt - Gt dictates Fleet to select cluster if its observed value of a given property is greater than + // the value specified in the requirement. + PropertySelectorOperatorGt PropertySelectorOperator = "Gt" + // PropertySelectorOperatorLe - Le dictates Fleet to select cluster if its observed value of a given property is less than + // or equal to the value specified in the requirement. + PropertySelectorOperatorLe PropertySelectorOperator = "Le" + // PropertySelectorOperatorLt - Lt dictates Fleet to select cluster if its observed value of a given property is less than + // the value specified in the requirement. + PropertySelectorOperatorLt PropertySelectorOperator = "Lt" + // PropertySelectorOperatorNe - Ne dictates Fleet to select cluster if its observed value of a given property is not equal + // to the values specified in the requirement. + PropertySelectorOperatorNe PropertySelectorOperator = "Ne" +) + +// PossiblePropertySelectorOperatorValues returns the possible values for the PropertySelectorOperator const type. +func PossiblePropertySelectorOperatorValues() []PropertySelectorOperator { + return []PropertySelectorOperator{ + PropertySelectorOperatorEq, + PropertySelectorOperatorGe, + PropertySelectorOperatorGt, + PropertySelectorOperatorLe, + PropertySelectorOperatorLt, + PropertySelectorOperatorNe, + } +} + +// TaintEffect - TaintEffect +type TaintEffect string + +const ( + // TaintEffectNoSchedule - Do not allow new pods to schedule onto the node unless they tolerate the taint, but allow all pods + // submitted to Kubelet without going through the scheduler to start, and allow all already-running pods to continue running. + // Enforced by the scheduler. + TaintEffectNoSchedule TaintEffect = "NoSchedule" +) + +// PossibleTaintEffectValues returns the possible values for the TaintEffect const type. +func PossibleTaintEffectValues() []TaintEffect { + return []TaintEffect{ + TaintEffectNoSchedule, + } +} + // TargetType - The target type of a skip request. type TargetType string @@ -388,6 +588,24 @@ func PossibleTimingValues() []Timing { } } +// TolerationOperator - A toleration operator is the set of operators that can be used in a toleration. +type TolerationOperator string + +const ( + // TolerationOperatorEqual - Toleration Operator Equal + TolerationOperatorEqual TolerationOperator = "Equal" + // TolerationOperatorExists - Toleration Operator Exists + TolerationOperatorExists TolerationOperator = "Exists" +) + +// PossibleTolerationOperatorValues returns the possible values for the TolerationOperator const type. +func PossibleTolerationOperatorValues() []TolerationOperator { + return []TolerationOperator{ + TolerationOperatorEqual, + TolerationOperatorExists, + } +} + // UpdateRunProvisioningState - The provisioning state of the UpdateRun resource. type UpdateRunProvisioningState string diff --git a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fake/fleetmanagednamespaces_server.go b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fake/fleetmanagednamespaces_server.go new file mode 100644 index 000000000000..22f90683ab6c --- /dev/null +++ b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fake/fleetmanagednamespaces_server.go @@ -0,0 +1,376 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/v3" + "net/http" + "net/url" + "regexp" +) + +// FleetManagedNamespacesServer is a fake server for instances of the armcontainerservicefleet.FleetManagedNamespacesClient type. +type FleetManagedNamespacesServer struct { + // BeginCreateOrUpdate is the fake for method FleetManagedNamespacesClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, fleetName string, managedNamespaceName string, resource armcontainerservicefleet.FleetManagedNamespace, options *armcontainerservicefleet.FleetManagedNamespacesClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armcontainerservicefleet.FleetManagedNamespacesClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method FleetManagedNamespacesClient.BeginDelete + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, fleetName string, managedNamespaceName string, options *armcontainerservicefleet.FleetManagedNamespacesClientBeginDeleteOptions) (resp azfake.PollerResponder[armcontainerservicefleet.FleetManagedNamespacesClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method FleetManagedNamespacesClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, fleetName string, managedNamespaceName string, options *armcontainerservicefleet.FleetManagedNamespacesClientGetOptions) (resp azfake.Responder[armcontainerservicefleet.FleetManagedNamespacesClientGetResponse], errResp azfake.ErrorResponder) + + // NewListByFleetPager is the fake for method FleetManagedNamespacesClient.NewListByFleetPager + // HTTP status codes to indicate success: http.StatusOK + NewListByFleetPager func(resourceGroupName string, fleetName string, options *armcontainerservicefleet.FleetManagedNamespacesClientListByFleetOptions) (resp azfake.PagerResponder[armcontainerservicefleet.FleetManagedNamespacesClientListByFleetResponse]) + + // BeginUpdate is the fake for method FleetManagedNamespacesClient.BeginUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginUpdate func(ctx context.Context, resourceGroupName string, fleetName string, managedNamespaceName string, properties armcontainerservicefleet.FleetManagedNamespacePatch, options *armcontainerservicefleet.FleetManagedNamespacesClientBeginUpdateOptions) (resp azfake.PollerResponder[armcontainerservicefleet.FleetManagedNamespacesClientUpdateResponse], errResp azfake.ErrorResponder) +} + +// NewFleetManagedNamespacesServerTransport creates a new instance of FleetManagedNamespacesServerTransport with the provided implementation. +// The returned FleetManagedNamespacesServerTransport instance is connected to an instance of armcontainerservicefleet.FleetManagedNamespacesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewFleetManagedNamespacesServerTransport(srv *FleetManagedNamespacesServer) *FleetManagedNamespacesServerTransport { + return &FleetManagedNamespacesServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armcontainerservicefleet.FleetManagedNamespacesClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armcontainerservicefleet.FleetManagedNamespacesClientDeleteResponse]](), + newListByFleetPager: newTracker[azfake.PagerResponder[armcontainerservicefleet.FleetManagedNamespacesClientListByFleetResponse]](), + beginUpdate: newTracker[azfake.PollerResponder[armcontainerservicefleet.FleetManagedNamespacesClientUpdateResponse]](), + } +} + +// FleetManagedNamespacesServerTransport connects instances of armcontainerservicefleet.FleetManagedNamespacesClient to instances of FleetManagedNamespacesServer. +// Don't use this type directly, use NewFleetManagedNamespacesServerTransport instead. +type FleetManagedNamespacesServerTransport struct { + srv *FleetManagedNamespacesServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armcontainerservicefleet.FleetManagedNamespacesClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armcontainerservicefleet.FleetManagedNamespacesClientDeleteResponse]] + newListByFleetPager *tracker[azfake.PagerResponder[armcontainerservicefleet.FleetManagedNamespacesClientListByFleetResponse]] + beginUpdate *tracker[azfake.PollerResponder[armcontainerservicefleet.FleetManagedNamespacesClientUpdateResponse]] +} + +// Do implements the policy.Transporter interface for FleetManagedNamespacesServerTransport. +func (f *FleetManagedNamespacesServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + return f.dispatchToMethodFake(req, method) +} + +func (f *FleetManagedNamespacesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if fleetManagedNamespacesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = fleetManagedNamespacesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "FleetManagedNamespacesClient.BeginCreateOrUpdate": + res.resp, res.err = f.dispatchBeginCreateOrUpdate(req) + case "FleetManagedNamespacesClient.BeginDelete": + res.resp, res.err = f.dispatchBeginDelete(req) + case "FleetManagedNamespacesClient.Get": + res.resp, res.err = f.dispatchGet(req) + case "FleetManagedNamespacesClient.NewListByFleetPager": + res.resp, res.err = f.dispatchNewListByFleetPager(req) + case "FleetManagedNamespacesClient.BeginUpdate": + res.resp, res.err = f.dispatchBeginUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } +} + +func (f *FleetManagedNamespacesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if f.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} + } + beginCreateOrUpdate := f.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ContainerService/fleets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/managedNamespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armcontainerservicefleet.FleetManagedNamespace](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + ifMatchParam := getOptional(getHeaderValue(req.Header, "If-Match")) + ifNoneMatchParam := getOptional(getHeaderValue(req.Header, "If-None-Match")) + fleetNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fleetName")]) + if err != nil { + return nil, err + } + managedNamespaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("managedNamespaceName")]) + if err != nil { + return nil, err + } + var options *armcontainerservicefleet.FleetManagedNamespacesClientBeginCreateOrUpdateOptions + if ifMatchParam != nil || ifNoneMatchParam != nil { + options = &armcontainerservicefleet.FleetManagedNamespacesClientBeginCreateOrUpdateOptions{ + IfMatch: ifMatchParam, + IfNoneMatch: ifNoneMatchParam, + } + } + respr, errRespr := f.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, fleetNameParam, managedNamespaceNameParam, body, options) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreateOrUpdate = &respr + f.beginCreateOrUpdate.add(req, beginCreateOrUpdate) + } + + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + f.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreateOrUpdate) { + f.beginCreateOrUpdate.remove(req) + } + + return resp, nil +} + +func (f *FleetManagedNamespacesServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if f.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := f.beginDelete.get(req) + if beginDelete == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ContainerService/fleets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/managedNamespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + ifMatchParam := getOptional(getHeaderValue(req.Header, "If-Match")) + fleetNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fleetName")]) + if err != nil { + return nil, err + } + managedNamespaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("managedNamespaceName")]) + if err != nil { + return nil, err + } + var options *armcontainerservicefleet.FleetManagedNamespacesClientBeginDeleteOptions + if ifMatchParam != nil { + options = &armcontainerservicefleet.FleetManagedNamespacesClientBeginDeleteOptions{ + IfMatch: ifMatchParam, + } + } + respr, errRespr := f.srv.BeginDelete(req.Context(), resourceGroupNameParam, fleetNameParam, managedNamespaceNameParam, options) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + f.beginDelete.add(req, beginDelete) + } + + resp, err := server.PollerResponderNext(beginDelete, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + f.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDelete) { + f.beginDelete.remove(req) + } + + return resp, nil +} + +func (f *FleetManagedNamespacesServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if f.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ContainerService/fleets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/managedNamespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + fleetNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fleetName")]) + if err != nil { + return nil, err + } + managedNamespaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("managedNamespaceName")]) + if err != nil { + return nil, err + } + respr, errRespr := f.srv.Get(req.Context(), resourceGroupNameParam, fleetNameParam, managedNamespaceNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).FleetManagedNamespace, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (f *FleetManagedNamespacesServerTransport) dispatchNewListByFleetPager(req *http.Request) (*http.Response, error) { + if f.srv.NewListByFleetPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListByFleetPager not implemented")} + } + newListByFleetPager := f.newListByFleetPager.get(req) + if newListByFleetPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ContainerService/fleets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/managedNamespaces` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + fleetNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fleetName")]) + if err != nil { + return nil, err + } + resp := f.srv.NewListByFleetPager(resourceGroupNameParam, fleetNameParam, nil) + newListByFleetPager = &resp + f.newListByFleetPager.add(req, newListByFleetPager) + server.PagerResponderInjectNextLinks(newListByFleetPager, req, func(page *armcontainerservicefleet.FleetManagedNamespacesClientListByFleetResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListByFleetPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + f.newListByFleetPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListByFleetPager) { + f.newListByFleetPager.remove(req) + } + return resp, nil +} + +func (f *FleetManagedNamespacesServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Response, error) { + if f.srv.BeginUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} + } + beginUpdate := f.beginUpdate.get(req) + if beginUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ContainerService/fleets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/managedNamespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armcontainerservicefleet.FleetManagedNamespacePatch](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + ifMatchParam := getOptional(getHeaderValue(req.Header, "If-Match")) + fleetNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fleetName")]) + if err != nil { + return nil, err + } + managedNamespaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("managedNamespaceName")]) + if err != nil { + return nil, err + } + var options *armcontainerservicefleet.FleetManagedNamespacesClientBeginUpdateOptions + if ifMatchParam != nil { + options = &armcontainerservicefleet.FleetManagedNamespacesClientBeginUpdateOptions{ + IfMatch: ifMatchParam, + } + } + respr, errRespr := f.srv.BeginUpdate(req.Context(), resourceGroupNameParam, fleetNameParam, managedNamespaceNameParam, body, options) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginUpdate = &respr + f.beginUpdate.add(req, beginUpdate) + } + + resp, err := server.PollerResponderNext(beginUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + f.beginUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginUpdate) { + f.beginUpdate.remove(req) + } + + return resp, nil +} + +// set this to conditionally intercept incoming requests to FleetManagedNamespacesServerTransport +var fleetManagedNamespacesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fake/server_factory.go b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fake/server_factory.go index c350da1ca95d..b78bfb73e4c3 100644 --- a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fake/server_factory.go +++ b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fake/server_factory.go @@ -21,6 +21,9 @@ type ServerFactory struct { // AutoUpgradeProfilesServer contains the fakes for client AutoUpgradeProfilesClient AutoUpgradeProfilesServer AutoUpgradeProfilesServer + // FleetManagedNamespacesServer contains the fakes for client FleetManagedNamespacesClient + FleetManagedNamespacesServer FleetManagedNamespacesServer + // FleetMembersServer contains the fakes for client FleetMembersClient FleetMembersServer FleetMembersServer @@ -56,6 +59,7 @@ type ServerFactoryTransport struct { trMu sync.Mutex trAutoUpgradeProfileOperationsServer *AutoUpgradeProfileOperationsServerTransport trAutoUpgradeProfilesServer *AutoUpgradeProfilesServerTransport + trFleetManagedNamespacesServer *FleetManagedNamespacesServerTransport trFleetMembersServer *FleetMembersServerTransport trFleetUpdateStrategiesServer *FleetUpdateStrategiesServerTransport trFleetsServer *FleetsServerTransport @@ -87,6 +91,11 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { return NewAutoUpgradeProfilesServerTransport(&s.srv.AutoUpgradeProfilesServer) }) resp, err = s.trAutoUpgradeProfilesServer.Do(req) + case "FleetManagedNamespacesClient": + initServer(s, &s.trFleetManagedNamespacesServer, func() *FleetManagedNamespacesServerTransport { + return NewFleetManagedNamespacesServerTransport(&s.srv.FleetManagedNamespacesServer) + }) + resp, err = s.trFleetManagedNamespacesServer.Do(req) case "FleetMembersClient": initServer(s, &s.trFleetMembersServer, func() *FleetMembersServerTransport { return NewFleetMembersServerTransport(&s.srv.FleetMembersServer) }) resp, err = s.trFleetMembersServer.Do(req) diff --git a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleetmanagednamespaces_client.go b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleetmanagednamespaces_client.go new file mode 100644 index 000000000000..c991b1f914fa --- /dev/null +++ b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleetmanagednamespaces_client.go @@ -0,0 +1,439 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. + +package armcontainerservicefleet + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// FleetManagedNamespacesClient contains the methods for the FleetManagedNamespaces group. +// Don't use this type directly, use NewFleetManagedNamespacesClient() instead. +type FleetManagedNamespacesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewFleetManagedNamespacesClient creates a new instance of FleetManagedNamespacesClient with the specified values. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - Contains optional client configuration. Pass nil to accept the default values. +func NewFleetManagedNamespacesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FleetManagedNamespacesClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &FleetManagedNamespacesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create a FleetManagedNamespace +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-08-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - fleetName - The name of the Fleet resource. +// - managedNamespaceName - The name of the fleet managed namespace resource. +// - resource - Resource create parameters. +// - options - FleetManagedNamespacesClientBeginCreateOrUpdateOptions contains the optional parameters for the FleetManagedNamespacesClient.BeginCreateOrUpdate +// method. +func (client *FleetManagedNamespacesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, fleetName string, managedNamespaceName string, resource FleetManagedNamespace, options *FleetManagedNamespacesClientBeginCreateOrUpdateOptions) (*runtime.Poller[FleetManagedNamespacesClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, fleetName, managedNamespaceName, resource, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FleetManagedNamespacesClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[FleetManagedNamespacesClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// CreateOrUpdate - Create a FleetManagedNamespace +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-08-01-preview +func (client *FleetManagedNamespacesClient) createOrUpdate(ctx context.Context, resourceGroupName string, fleetName string, managedNamespaceName string, resource FleetManagedNamespace, options *FleetManagedNamespacesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + const operationName = "FleetManagedNamespacesClient.BeginCreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, fleetName, managedNamespaceName, resource, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *FleetManagedNamespacesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, fleetName string, managedNamespaceName string, resource FleetManagedNamespace, options *FleetManagedNamespacesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/managedNamespaces/{managedNamespaceName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if fleetName == "" { + return nil, errors.New("parameter fleetName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{fleetName}", url.PathEscape(fleetName)) + if managedNamespaceName == "" { + return nil, errors.New("parameter managedNamespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedNamespaceName}", url.PathEscape(managedNamespaceName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-08-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if options != nil && options.IfMatch != nil { + req.Raw().Header["If-Match"] = []string{*options.IfMatch} + } + if options != nil && options.IfNoneMatch != nil { + req.Raw().Header["If-None-Match"] = []string{*options.IfNoneMatch} + } + req.Raw().Header["Content-Type"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, resource); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - Delete a FleetManagedNamespace +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-08-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - fleetName - The name of the Fleet resource. +// - managedNamespaceName - The name of the fleet managed namespace resource. +// - options - FleetManagedNamespacesClientBeginDeleteOptions contains the optional parameters for the FleetManagedNamespacesClient.BeginDelete +// method. +func (client *FleetManagedNamespacesClient) BeginDelete(ctx context.Context, resourceGroupName string, fleetName string, managedNamespaceName string, options *FleetManagedNamespacesClientBeginDeleteOptions) (*runtime.Poller[FleetManagedNamespacesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, fleetName, managedNamespaceName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FleetManagedNamespacesClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[FleetManagedNamespacesClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Delete a FleetManagedNamespace +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-08-01-preview +func (client *FleetManagedNamespacesClient) deleteOperation(ctx context.Context, resourceGroupName string, fleetName string, managedNamespaceName string, options *FleetManagedNamespacesClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "FleetManagedNamespacesClient.BeginDelete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, resourceGroupName, fleetName, managedNamespaceName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *FleetManagedNamespacesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, fleetName string, managedNamespaceName string, options *FleetManagedNamespacesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/managedNamespaces/{managedNamespaceName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if fleetName == "" { + return nil, errors.New("parameter fleetName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{fleetName}", url.PathEscape(fleetName)) + if managedNamespaceName == "" { + return nil, errors.New("parameter managedNamespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedNamespaceName}", url.PathEscape(managedNamespaceName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-08-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + if options != nil && options.IfMatch != nil { + req.Raw().Header["If-Match"] = []string{*options.IfMatch} + } + return req, nil +} + +// Get - Get a FleetManagedNamespace +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-08-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - fleetName - The name of the Fleet resource. +// - managedNamespaceName - The name of the fleet managed namespace resource. +// - options - FleetManagedNamespacesClientGetOptions contains the optional parameters for the FleetManagedNamespacesClient.Get +// method. +func (client *FleetManagedNamespacesClient) Get(ctx context.Context, resourceGroupName string, fleetName string, managedNamespaceName string, options *FleetManagedNamespacesClientGetOptions) (FleetManagedNamespacesClientGetResponse, error) { + var err error + const operationName = "FleetManagedNamespacesClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, fleetName, managedNamespaceName, options) + if err != nil { + return FleetManagedNamespacesClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return FleetManagedNamespacesClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return FleetManagedNamespacesClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *FleetManagedNamespacesClient) getCreateRequest(ctx context.Context, resourceGroupName string, fleetName string, managedNamespaceName string, _ *FleetManagedNamespacesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/managedNamespaces/{managedNamespaceName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if fleetName == "" { + return nil, errors.New("parameter fleetName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{fleetName}", url.PathEscape(fleetName)) + if managedNamespaceName == "" { + return nil, errors.New("parameter managedNamespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedNamespaceName}", url.PathEscape(managedNamespaceName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-08-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *FleetManagedNamespacesClient) getHandleResponse(resp *http.Response) (FleetManagedNamespacesClientGetResponse, error) { + result := FleetManagedNamespacesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.FleetManagedNamespace); err != nil { + return FleetManagedNamespacesClientGetResponse{}, err + } + return result, nil +} + +// NewListByFleetPager - List FleetManagedNamespace resources by Fleet +// +// Generated from API version 2025-08-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - fleetName - The name of the Fleet resource. +// - options - FleetManagedNamespacesClientListByFleetOptions contains the optional parameters for the FleetManagedNamespacesClient.NewListByFleetPager +// method. +func (client *FleetManagedNamespacesClient) NewListByFleetPager(resourceGroupName string, fleetName string, options *FleetManagedNamespacesClientListByFleetOptions) *runtime.Pager[FleetManagedNamespacesClientListByFleetResponse] { + return runtime.NewPager(runtime.PagingHandler[FleetManagedNamespacesClientListByFleetResponse]{ + More: func(page FleetManagedNamespacesClientListByFleetResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *FleetManagedNamespacesClientListByFleetResponse) (FleetManagedNamespacesClientListByFleetResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "FleetManagedNamespacesClient.NewListByFleetPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listByFleetCreateRequest(ctx, resourceGroupName, fleetName, options) + }, nil) + if err != nil { + return FleetManagedNamespacesClientListByFleetResponse{}, err + } + return client.listByFleetHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listByFleetCreateRequest creates the ListByFleet request. +func (client *FleetManagedNamespacesClient) listByFleetCreateRequest(ctx context.Context, resourceGroupName string, fleetName string, _ *FleetManagedNamespacesClientListByFleetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/managedNamespaces" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if fleetName == "" { + return nil, errors.New("parameter fleetName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{fleetName}", url.PathEscape(fleetName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-08-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByFleetHandleResponse handles the ListByFleet response. +func (client *FleetManagedNamespacesClient) listByFleetHandleResponse(resp *http.Response) (FleetManagedNamespacesClientListByFleetResponse, error) { + result := FleetManagedNamespacesClientListByFleetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.FleetManagedNamespaceListResult); err != nil { + return FleetManagedNamespacesClientListByFleetResponse{}, err + } + return result, nil +} + +// BeginUpdate - Update a FleetManagedNamespace +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-08-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - fleetName - The name of the Fleet resource. +// - managedNamespaceName - The name of the fleet managed namespace resource. +// - properties - The resource properties to be updated. +// - options - FleetManagedNamespacesClientBeginUpdateOptions contains the optional parameters for the FleetManagedNamespacesClient.BeginUpdate +// method. +func (client *FleetManagedNamespacesClient) BeginUpdate(ctx context.Context, resourceGroupName string, fleetName string, managedNamespaceName string, properties FleetManagedNamespacePatch, options *FleetManagedNamespacesClientBeginUpdateOptions) (*runtime.Poller[FleetManagedNamespacesClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, fleetName, managedNamespaceName, properties, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FleetManagedNamespacesClientUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[FleetManagedNamespacesClientUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Update - Update a FleetManagedNamespace +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-08-01-preview +func (client *FleetManagedNamespacesClient) update(ctx context.Context, resourceGroupName string, fleetName string, managedNamespaceName string, properties FleetManagedNamespacePatch, options *FleetManagedNamespacesClientBeginUpdateOptions) (*http.Response, error) { + var err error + const operationName = "FleetManagedNamespacesClient.BeginUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.updateCreateRequest(ctx, resourceGroupName, fleetName, managedNamespaceName, properties, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// updateCreateRequest creates the Update request. +func (client *FleetManagedNamespacesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, fleetName string, managedNamespaceName string, properties FleetManagedNamespacePatch, options *FleetManagedNamespacesClientBeginUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/managedNamespaces/{managedNamespaceName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if fleetName == "" { + return nil, errors.New("parameter fleetName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{fleetName}", url.PathEscape(fleetName)) + if managedNamespaceName == "" { + return nil, errors.New("parameter managedNamespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedNamespaceName}", url.PathEscape(managedNamespaceName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-08-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if options != nil && options.IfMatch != nil { + req.Raw().Header["If-Match"] = []string{*options.IfMatch} + } + req.Raw().Header["Content-Type"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, properties); err != nil { + return nil, err + } + return req, nil +} diff --git a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleetmanagednamespaces_client_example_test.go b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleetmanagednamespaces_client_example_test.go new file mode 100644 index 000000000000..9b72c05300b9 --- /dev/null +++ b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleetmanagednamespaces_client_example_test.go @@ -0,0 +1,613 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. + +package armcontainerservicefleet_test + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/v3" + "log" +) + +// Generated from example definition: 2025-08-01-preview/FleetManagedNamespaces_CreateOrUpdate.json +func ExampleFleetManagedNamespacesClient_BeginCreateOrUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcontainerservicefleet.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewFleetManagedNamespacesClient().BeginCreateOrUpdate(ctx, "rgfleets", "fleet1", "namespace1", armcontainerservicefleet.FleetManagedNamespace{ + Properties: &armcontainerservicefleet.FleetManagedNamespaceProperties{ + ManagedNamespaceProperties: &armcontainerservicefleet.ManagedNamespaceProperties{ + Labels: map[string]*string{ + "key1": to.Ptr("value1"), + }, + Annotations: map[string]*string{ + "key2": to.Ptr("value2"), + }, + DefaultResourceQuota: &armcontainerservicefleet.ResourceQuota{ + CPURequest: to.Ptr("1"), + CPULimit: to.Ptr("1"), + MemoryRequest: to.Ptr("10Gi"), + MemoryLimit: to.Ptr("32Gi"), + }, + DefaultNetworkPolicy: &armcontainerservicefleet.NetworkPolicy{ + Ingress: to.Ptr(armcontainerservicefleet.PolicyRuleAllowSameNamespace), + Egress: to.Ptr(armcontainerservicefleet.PolicyRuleAllowAll), + }, + }, + AdoptionPolicy: to.Ptr(armcontainerservicefleet.AdoptionPolicyNever), + DeletePolicy: to.Ptr(armcontainerservicefleet.DeletePolicyKeep), + PropagationPolicy: &armcontainerservicefleet.PropagationPolicy{ + Type: to.Ptr(armcontainerservicefleet.PropagationTypePlacement), + PlacementProfile: &armcontainerservicefleet.PlacementProfile{ + DefaultClusterResourcePlacement: &armcontainerservicefleet.ClusterResourcePlacementSpec{ + Policy: &armcontainerservicefleet.PlacementPolicy{ + PlacementType: to.Ptr(armcontainerservicefleet.PlacementTypePickAll), + Affinity: &armcontainerservicefleet.Affinity{ + ClusterAffinity: &armcontainerservicefleet.ClusterAffinity{ + RequiredDuringSchedulingIgnoredDuringExecution: &armcontainerservicefleet.ClusterSelector{ + ClusterSelectorTerms: []*armcontainerservicefleet.ClusterSelectorTerm{ + { + LabelSelector: &armcontainerservicefleet.LabelSelector{ + MatchLabels: map[string]*string{ + "gpu": to.Ptr("true"), + }, + MatchExpressions: []*armcontainerservicefleet.LabelSelectorRequirement{ + { + Key: to.Ptr("region"), + Operator: to.Ptr(armcontainerservicefleet.LabelSelectorOperatorIn), + Values: []*string{ + to.Ptr("production1"), + to.Ptr("production2"), + }, + }, + }, + }, + PropertySelector: &armcontainerservicefleet.PropertySelector{ + MatchExpressions: []*armcontainerservicefleet.PropertySelectorRequirement{ + { + Name: to.Ptr("zones"), + Operator: to.Ptr(armcontainerservicefleet.PropertySelectorOperatorGt), + Values: []*string{ + to.Ptr("1"), + }, + }, + }, + }, + }, + }, + }, + }, + }, + Tolerations: []*armcontainerservicefleet.Toleration{ + { + Key: to.Ptr("AIWorkloadOnly"), + Operator: to.Ptr(armcontainerservicefleet.TolerationOperatorExists), + Value: to.Ptr("true"), + Effect: to.Ptr(armcontainerservicefleet.TaintEffectNoSchedule), + }, + }, + }, + }, + }, + }, + Status: &armcontainerservicefleet.FleetManagedNamespaceStatus{ + LastOperationError: &armcontainerservicefleet.ErrorDetail{}, + }, + }, + Location: to.Ptr("eastus"), + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armcontainerservicefleet.FleetManagedNamespacesClientCreateOrUpdateResponse{ + // FleetManagedNamespace: &armcontainerservicefleet.FleetManagedNamespace{ + // Properties: &armcontainerservicefleet.FleetManagedNamespaceProperties{ + // ManagedNamespaceProperties: &armcontainerservicefleet.ManagedNamespaceProperties{ + // Labels: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // Annotations: map[string]*string{ + // "key2": to.Ptr("value2"), + // }, + // DefaultResourceQuota: &armcontainerservicefleet.ResourceQuota{ + // CPURequest: to.Ptr("1"), + // CPULimit: to.Ptr("1"), + // MemoryRequest: to.Ptr("10Gi"), + // MemoryLimit: to.Ptr("32Gi"), + // }, + // DefaultNetworkPolicy: &armcontainerservicefleet.NetworkPolicy{ + // Ingress: to.Ptr(armcontainerservicefleet.PolicyRuleAllowSameNamespace), + // Egress: to.Ptr(armcontainerservicefleet.PolicyRuleAllowAll), + // }, + // }, + // AdoptionPolicy: to.Ptr(armcontainerservicefleet.AdoptionPolicyNever), + // DeletePolicy: to.Ptr(armcontainerservicefleet.DeletePolicyKeep), + // PropagationPolicy: &armcontainerservicefleet.PropagationPolicy{ + // Type: to.Ptr(armcontainerservicefleet.PropagationTypePlacement), + // PlacementProfile: &armcontainerservicefleet.PlacementProfile{ + // DefaultClusterResourcePlacement: &armcontainerservicefleet.ClusterResourcePlacementSpec{ + // Policy: &armcontainerservicefleet.PlacementPolicy{ + // PlacementType: to.Ptr(armcontainerservicefleet.PlacementTypePickAll), + // Affinity: &armcontainerservicefleet.Affinity{ + // ClusterAffinity: &armcontainerservicefleet.ClusterAffinity{ + // RequiredDuringSchedulingIgnoredDuringExecution: &armcontainerservicefleet.ClusterSelector{ + // ClusterSelectorTerms: []*armcontainerservicefleet.ClusterSelectorTerm{ + // { + // LabelSelector: &armcontainerservicefleet.LabelSelector{ + // MatchLabels: map[string]*string{ + // "gpu": to.Ptr("true"), + // }, + // MatchExpressions: []*armcontainerservicefleet.LabelSelectorRequirement{ + // { + // Key: to.Ptr("region"), + // Operator: to.Ptr(armcontainerservicefleet.LabelSelectorOperatorIn), + // Values: []*string{ + // to.Ptr("production1"), + // to.Ptr("production2"), + // }, + // }, + // }, + // }, + // PropertySelector: &armcontainerservicefleet.PropertySelector{ + // MatchExpressions: []*armcontainerservicefleet.PropertySelectorRequirement{ + // { + // Name: to.Ptr("zones"), + // Operator: to.Ptr(armcontainerservicefleet.PropertySelectorOperatorGt), + // Values: []*string{ + // to.Ptr("1"), + // }, + // }, + // }, + // }, + // }, + // }, + // }, + // }, + // }, + // Tolerations: []*armcontainerservicefleet.Toleration{ + // { + // Key: to.Ptr("AIWorkloadOnly"), + // Operator: to.Ptr(armcontainerservicefleet.TolerationOperatorExists), + // Value: to.Ptr("true"), + // Effect: to.Ptr(armcontainerservicefleet.TaintEffectNoSchedule), + // }, + // }, + // }, + // }, + // }, + // }, + // Status: &armcontainerservicefleet.FleetManagedNamespaceStatus{ + // LastOperationError: &armcontainerservicefleet.ErrorDetail{ + // }, + // }, + // }, + // ETag: to.Ptr("\"EtagValue\""), + // Location: to.Ptr("eastus"), + // ID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/fleets/fleet1/managedNamespaces/namespace1"), + // Name: to.Ptr("namespace1"), + // Type: to.Ptr("Microsoft.ContainerService/fleets/managedNamespaces"), + // SystemData: &armcontainerservicefleet.SystemData{ + // CreatedBy: to.Ptr("someUser"), + // CreatedByType: to.Ptr(armcontainerservicefleet.CreatedByTypeUser), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-08-23T05:40:40.657Z"); return t}()), + // LastModifiedBy: to.Ptr("someOtherUser"), + // LastModifiedByType: to.Ptr(armcontainerservicefleet.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-08-23T05:40:40.657Z"); return t}()), + // }, + // }, + // } +} + +// Generated from example definition: 2025-08-01-preview/FleetManagedNamespaces_Delete.json +func ExampleFleetManagedNamespacesClient_BeginDelete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcontainerservicefleet.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewFleetManagedNamespacesClient().BeginDelete(ctx, "rgfleets", "fleet1", "namespace1", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } +} + +// Generated from example definition: 2025-08-01-preview/FleetManagedNamespaces_Get.json +func ExampleFleetManagedNamespacesClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcontainerservicefleet.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewFleetManagedNamespacesClient().Get(ctx, "rgfleets", "fleet1", "namespace1", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armcontainerservicefleet.FleetManagedNamespacesClientGetResponse{ + // FleetManagedNamespace: &armcontainerservicefleet.FleetManagedNamespace{ + // Properties: &armcontainerservicefleet.FleetManagedNamespaceProperties{ + // ManagedNamespaceProperties: &armcontainerservicefleet.ManagedNamespaceProperties{ + // Labels: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // Annotations: map[string]*string{ + // "key2": to.Ptr("value2"), + // }, + // DefaultResourceQuota: &armcontainerservicefleet.ResourceQuota{ + // CPURequest: to.Ptr("1"), + // CPULimit: to.Ptr("1"), + // MemoryRequest: to.Ptr("10Gi"), + // MemoryLimit: to.Ptr("32Gi"), + // }, + // DefaultNetworkPolicy: &armcontainerservicefleet.NetworkPolicy{ + // Ingress: to.Ptr(armcontainerservicefleet.PolicyRuleAllowSameNamespace), + // Egress: to.Ptr(armcontainerservicefleet.PolicyRuleAllowAll), + // }, + // }, + // AdoptionPolicy: to.Ptr(armcontainerservicefleet.AdoptionPolicyNever), + // DeletePolicy: to.Ptr(armcontainerservicefleet.DeletePolicyKeep), + // PropagationPolicy: &armcontainerservicefleet.PropagationPolicy{ + // Type: to.Ptr(armcontainerservicefleet.PropagationTypePlacement), + // PlacementProfile: &armcontainerservicefleet.PlacementProfile{ + // DefaultClusterResourcePlacement: &armcontainerservicefleet.ClusterResourcePlacementSpec{ + // Policy: &armcontainerservicefleet.PlacementPolicy{ + // PlacementType: to.Ptr(armcontainerservicefleet.PlacementTypePickAll), + // Affinity: &armcontainerservicefleet.Affinity{ + // ClusterAffinity: &armcontainerservicefleet.ClusterAffinity{ + // RequiredDuringSchedulingIgnoredDuringExecution: &armcontainerservicefleet.ClusterSelector{ + // ClusterSelectorTerms: []*armcontainerservicefleet.ClusterSelectorTerm{ + // { + // LabelSelector: &armcontainerservicefleet.LabelSelector{ + // MatchLabels: map[string]*string{ + // "gpu": to.Ptr("true"), + // }, + // MatchExpressions: []*armcontainerservicefleet.LabelSelectorRequirement{ + // { + // Key: to.Ptr("region"), + // Operator: to.Ptr(armcontainerservicefleet.LabelSelectorOperatorIn), + // Values: []*string{ + // to.Ptr("production1"), + // to.Ptr("production2"), + // }, + // }, + // }, + // }, + // PropertySelector: &armcontainerservicefleet.PropertySelector{ + // MatchExpressions: []*armcontainerservicefleet.PropertySelectorRequirement{ + // { + // Name: to.Ptr("zones"), + // Operator: to.Ptr(armcontainerservicefleet.PropertySelectorOperatorGt), + // Values: []*string{ + // to.Ptr("1"), + // }, + // }, + // }, + // }, + // }, + // }, + // }, + // }, + // }, + // Tolerations: []*armcontainerservicefleet.Toleration{ + // { + // Key: to.Ptr("AIWorkloadOnly"), + // Operator: to.Ptr(armcontainerservicefleet.TolerationOperatorExists), + // Value: to.Ptr("true"), + // Effect: to.Ptr(armcontainerservicefleet.TaintEffectNoSchedule), + // }, + // }, + // }, + // }, + // }, + // }, + // Status: &armcontainerservicefleet.FleetManagedNamespaceStatus{ + // LastOperationError: &armcontainerservicefleet.ErrorDetail{ + // }, + // }, + // PortalFqdn: to.Ptr("fleet1-namespace1-abc123.flt.eastus.azmk8s.io"), + // }, + // ETag: to.Ptr("\"EtagValue\""), + // Tags: map[string]*string{ + // "tag1": to.Ptr("tagValue1"), + // }, + // Location: to.Ptr("eastus"), + // ID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/fleets/fleet1/managedNamespaces/namespace1"), + // Name: to.Ptr("namespace1"), + // Type: to.Ptr("Microsoft.ContainerService/fleets/managedNamespaces"), + // SystemData: &armcontainerservicefleet.SystemData{ + // CreatedBy: to.Ptr("someUser"), + // CreatedByType: to.Ptr(armcontainerservicefleet.CreatedByTypeUser), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-08-23T05:40:40.657Z"); return t}()), + // LastModifiedBy: to.Ptr("someOtherUser"), + // LastModifiedByType: to.Ptr(armcontainerservicefleet.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-08-23T05:40:40.657Z"); return t}()), + // }, + // }, + // } +} + +// Generated from example definition: 2025-08-01-preview/FleetManagedNamespaces_ListByFleet.json +func ExampleFleetManagedNamespacesClient_NewListByFleetPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcontainerservicefleet.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewFleetManagedNamespacesClient().NewListByFleetPager("rgfleets", "fleet1", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page = armcontainerservicefleet.FleetManagedNamespacesClientListByFleetResponse{ + // FleetManagedNamespaceListResult: armcontainerservicefleet.FleetManagedNamespaceListResult{ + // Value: []*armcontainerservicefleet.FleetManagedNamespace{ + // { + // Properties: &armcontainerservicefleet.FleetManagedNamespaceProperties{ + // ProvisioningState: to.Ptr(armcontainerservicefleet.FleetManagedNamespaceProvisioningStateSucceeded), + // ManagedNamespaceProperties: &armcontainerservicefleet.ManagedNamespaceProperties{ + // Labels: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // Annotations: map[string]*string{ + // "key2": to.Ptr("value2"), + // }, + // DefaultResourceQuota: &armcontainerservicefleet.ResourceQuota{ + // CPURequest: to.Ptr("1"), + // CPULimit: to.Ptr("1"), + // MemoryRequest: to.Ptr("10Gi"), + // MemoryLimit: to.Ptr("32Gi"), + // }, + // DefaultNetworkPolicy: &armcontainerservicefleet.NetworkPolicy{ + // Ingress: to.Ptr(armcontainerservicefleet.PolicyRuleAllowSameNamespace), + // Egress: to.Ptr(armcontainerservicefleet.PolicyRuleAllowAll), + // }, + // }, + // AdoptionPolicy: to.Ptr(armcontainerservicefleet.AdoptionPolicyNever), + // DeletePolicy: to.Ptr(armcontainerservicefleet.DeletePolicyKeep), + // PropagationPolicy: &armcontainerservicefleet.PropagationPolicy{ + // Type: to.Ptr(armcontainerservicefleet.PropagationTypePlacement), + // PlacementProfile: &armcontainerservicefleet.PlacementProfile{ + // DefaultClusterResourcePlacement: &armcontainerservicefleet.ClusterResourcePlacementSpec{ + // Policy: &armcontainerservicefleet.PlacementPolicy{ + // PlacementType: to.Ptr(armcontainerservicefleet.PlacementTypePickAll), + // Affinity: &armcontainerservicefleet.Affinity{ + // ClusterAffinity: &armcontainerservicefleet.ClusterAffinity{ + // RequiredDuringSchedulingIgnoredDuringExecution: &armcontainerservicefleet.ClusterSelector{ + // ClusterSelectorTerms: []*armcontainerservicefleet.ClusterSelectorTerm{ + // { + // LabelSelector: &armcontainerservicefleet.LabelSelector{ + // MatchLabels: map[string]*string{ + // "gpu": to.Ptr("true"), + // }, + // MatchExpressions: []*armcontainerservicefleet.LabelSelectorRequirement{ + // { + // Key: to.Ptr("region"), + // Operator: to.Ptr(armcontainerservicefleet.LabelSelectorOperatorIn), + // Values: []*string{ + // to.Ptr("production1"), + // to.Ptr("production2"), + // }, + // }, + // }, + // }, + // PropertySelector: &armcontainerservicefleet.PropertySelector{ + // MatchExpressions: []*armcontainerservicefleet.PropertySelectorRequirement{ + // { + // Name: to.Ptr("zones"), + // Operator: to.Ptr(armcontainerservicefleet.PropertySelectorOperatorGt), + // Values: []*string{ + // to.Ptr("1"), + // }, + // }, + // }, + // }, + // }, + // }, + // }, + // }, + // }, + // Tolerations: []*armcontainerservicefleet.Toleration{ + // { + // Key: to.Ptr("AIWorkloadOnly"), + // Operator: to.Ptr(armcontainerservicefleet.TolerationOperatorExists), + // Value: to.Ptr("true"), + // Effect: to.Ptr(armcontainerservicefleet.TaintEffectNoSchedule), + // }, + // }, + // }, + // }, + // }, + // }, + // Status: &armcontainerservicefleet.FleetManagedNamespaceStatus{ + // LastOperationError: &armcontainerservicefleet.ErrorDetail{ + // }, + // }, + // PortalFqdn: to.Ptr("fleet1-namespace1-abc123.flt.eastus.azmk8s.io"), + // }, + // ETag: to.Ptr("\"EtagValue\""), + // Tags: map[string]*string{ + // "tag1": to.Ptr("tagValue1"), + // }, + // Location: to.Ptr("eastus"), + // ID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/fleets/fleet1/managedNamespaces/namespace1"), + // Name: to.Ptr("namespace1"), + // Type: to.Ptr("Microsoft.ContainerService/fleets/managedNamespaces"), + // SystemData: &armcontainerservicefleet.SystemData{ + // CreatedBy: to.Ptr("someUser"), + // CreatedByType: to.Ptr(armcontainerservicefleet.CreatedByTypeUser), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-08-23T05:40:40.657Z"); return t}()), + // LastModifiedBy: to.Ptr("someOtherUser"), + // LastModifiedByType: to.Ptr(armcontainerservicefleet.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-08-23T05:40:40.657Z"); return t}()), + // }, + // }, + // }, + // NextLink: to.Ptr("https://nextlink.sausage.com"), + // }, + // } + } +} + +// Generated from example definition: 2025-08-01-preview/FleetManagedNamespaces_Update.json +func ExampleFleetManagedNamespacesClient_BeginUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcontainerservicefleet.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewFleetManagedNamespacesClient().BeginUpdate(ctx, "rgfleets", "fleet1", "namespace1", armcontainerservicefleet.FleetManagedNamespacePatch{}, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armcontainerservicefleet.FleetManagedNamespacesClientUpdateResponse{ + // FleetManagedNamespace: &armcontainerservicefleet.FleetManagedNamespace{ + // Properties: &armcontainerservicefleet.FleetManagedNamespaceProperties{ + // ManagedNamespaceProperties: &armcontainerservicefleet.ManagedNamespaceProperties{ + // Labels: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // Annotations: map[string]*string{ + // "key2": to.Ptr("value2"), + // }, + // DefaultResourceQuota: &armcontainerservicefleet.ResourceQuota{ + // CPURequest: to.Ptr("1"), + // CPULimit: to.Ptr("1"), + // MemoryRequest: to.Ptr("10Gi"), + // MemoryLimit: to.Ptr("32Gi"), + // }, + // DefaultNetworkPolicy: &armcontainerservicefleet.NetworkPolicy{ + // Ingress: to.Ptr(armcontainerservicefleet.PolicyRuleAllowSameNamespace), + // Egress: to.Ptr(armcontainerservicefleet.PolicyRuleAllowAll), + // }, + // }, + // AdoptionPolicy: to.Ptr(armcontainerservicefleet.AdoptionPolicyNever), + // DeletePolicy: to.Ptr(armcontainerservicefleet.DeletePolicyKeep), + // PropagationPolicy: &armcontainerservicefleet.PropagationPolicy{ + // Type: to.Ptr(armcontainerservicefleet.PropagationTypePlacement), + // PlacementProfile: &armcontainerservicefleet.PlacementProfile{ + // DefaultClusterResourcePlacement: &armcontainerservicefleet.ClusterResourcePlacementSpec{ + // Policy: &armcontainerservicefleet.PlacementPolicy{ + // PlacementType: to.Ptr(armcontainerservicefleet.PlacementTypePickAll), + // Affinity: &armcontainerservicefleet.Affinity{ + // ClusterAffinity: &armcontainerservicefleet.ClusterAffinity{ + // RequiredDuringSchedulingIgnoredDuringExecution: &armcontainerservicefleet.ClusterSelector{ + // ClusterSelectorTerms: []*armcontainerservicefleet.ClusterSelectorTerm{ + // { + // LabelSelector: &armcontainerservicefleet.LabelSelector{ + // MatchLabels: map[string]*string{ + // "gpu": to.Ptr("true"), + // }, + // MatchExpressions: []*armcontainerservicefleet.LabelSelectorRequirement{ + // { + // Key: to.Ptr("region"), + // Operator: to.Ptr(armcontainerservicefleet.LabelSelectorOperatorIn), + // Values: []*string{ + // to.Ptr("production1"), + // to.Ptr("production2"), + // }, + // }, + // }, + // }, + // PropertySelector: &armcontainerservicefleet.PropertySelector{ + // MatchExpressions: []*armcontainerservicefleet.PropertySelectorRequirement{ + // { + // Name: to.Ptr("zones"), + // Operator: to.Ptr(armcontainerservicefleet.PropertySelectorOperatorGt), + // Values: []*string{ + // to.Ptr("1"), + // }, + // }, + // }, + // }, + // }, + // }, + // }, + // }, + // }, + // Tolerations: []*armcontainerservicefleet.Toleration{ + // { + // Key: to.Ptr("AIWorkloadOnly"), + // Operator: to.Ptr(armcontainerservicefleet.TolerationOperatorExists), + // Value: to.Ptr("true"), + // Effect: to.Ptr(armcontainerservicefleet.TaintEffectNoSchedule), + // }, + // }, + // }, + // }, + // }, + // }, + // Status: &armcontainerservicefleet.FleetManagedNamespaceStatus{ + // LastOperationError: &armcontainerservicefleet.ErrorDetail{ + // }, + // }, + // }, + // ETag: to.Ptr("\"EtagValue\""), + // Tags: map[string]*string{ + // "tag2": to.Ptr("tagValue2"), + // }, + // Location: to.Ptr("eastus"), + // ID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/fleets/fleet1/managedNamespaces/namespace1"), + // Name: to.Ptr("namespace1"), + // Type: to.Ptr("Microsoft.ContainerService/fleets/managedNamespaces"), + // SystemData: &armcontainerservicefleet.SystemData{ + // CreatedBy: to.Ptr("someUser"), + // CreatedByType: to.Ptr(armcontainerservicefleet.CreatedByTypeUser), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-08-23T05:40:40.657Z"); return t}()), + // LastModifiedBy: to.Ptr("someOtherUser"), + // LastModifiedByType: to.Ptr(armcontainerservicefleet.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-08-23T05:40:40.657Z"); return t}()), + // }, + // }, + // } +} diff --git a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleetmembers_client.go b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleetmembers_client.go index be16ac8a8bb3..7b1749500725 100644 --- a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleetmembers_client.go +++ b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleetmembers_client.go @@ -42,7 +42,7 @@ func NewFleetMembersClient(subscriptionID string, credential azcore.TokenCredent // BeginCreate - Create a FleetMember // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-04-01-preview +// Generated from API version 2025-08-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - fleetName - The name of the Fleet resource. // - fleetMemberName - The name of the Fleet member resource. @@ -70,7 +70,7 @@ func (client *FleetMembersClient) BeginCreate(ctx context.Context, resourceGroup // Create - Create a FleetMember // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-04-01-preview +// Generated from API version 2025-08-01-preview func (client *FleetMembersClient) create(ctx context.Context, resourceGroupName string, fleetName string, fleetMemberName string, resource FleetMember, options *FleetMembersClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "FleetMembersClient.BeginCreate" @@ -116,7 +116,7 @@ func (client *FleetMembersClient) createCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-04-01-preview") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.IfMatch != nil { @@ -135,7 +135,7 @@ func (client *FleetMembersClient) createCreateRequest(ctx context.Context, resou // BeginDelete - Delete a FleetMember // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-04-01-preview +// Generated from API version 2025-08-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - fleetName - The name of the Fleet resource. // - fleetMemberName - The name of the Fleet member resource. @@ -161,7 +161,7 @@ func (client *FleetMembersClient) BeginDelete(ctx context.Context, resourceGroup // Delete - Delete a FleetMember // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-04-01-preview +// Generated from API version 2025-08-01-preview func (client *FleetMembersClient) deleteOperation(ctx context.Context, resourceGroupName string, fleetName string, fleetMemberName string, options *FleetMembersClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "FleetMembersClient.BeginDelete" @@ -207,7 +207,7 @@ func (client *FleetMembersClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-04-01-preview") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -218,7 +218,7 @@ func (client *FleetMembersClient) deleteCreateRequest(ctx context.Context, resou // Get - Get a FleetMember // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-04-01-preview +// Generated from API version 2025-08-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - fleetName - The name of the Fleet resource. // - fleetMemberName - The name of the Fleet member resource. @@ -269,7 +269,7 @@ func (client *FleetMembersClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-04-01-preview") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -286,7 +286,7 @@ func (client *FleetMembersClient) getHandleResponse(resp *http.Response) (FleetM // NewListByFleetPager - List FleetMember resources by Fleet // -// Generated from API version 2025-04-01-preview +// Generated from API version 2025-08-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - fleetName - The name of the Fleet resource. // - options - FleetMembersClientListByFleetOptions contains the optional parameters for the FleetMembersClient.NewListByFleetPager @@ -334,7 +334,7 @@ func (client *FleetMembersClient) listByFleetCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-04-01-preview") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -352,7 +352,7 @@ func (client *FleetMembersClient) listByFleetHandleResponse(resp *http.Response) // BeginUpdateAsync - Update a FleetMember // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-04-01-preview +// Generated from API version 2025-08-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - fleetName - The name of the Fleet resource. // - fleetMemberName - The name of the Fleet member resource. @@ -379,7 +379,7 @@ func (client *FleetMembersClient) BeginUpdateAsync(ctx context.Context, resource // UpdateAsync - Update a FleetMember // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-04-01-preview +// Generated from API version 2025-08-01-preview func (client *FleetMembersClient) updateAsync(ctx context.Context, resourceGroupName string, fleetName string, fleetMemberName string, properties FleetMemberUpdate, options *FleetMembersClientBeginUpdateAsyncOptions) (*http.Response, error) { var err error const operationName = "FleetMembersClient.BeginUpdateAsync" @@ -425,7 +425,7 @@ func (client *FleetMembersClient) updateAsyncCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-04-01-preview") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.IfMatch != nil { diff --git a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleetmembers_client_example_test.go b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleetmembers_client_example_test.go index 4affed116c5d..2edf4820696b 100644 --- a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleetmembers_client_example_test.go +++ b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleetmembers_client_example_test.go @@ -12,7 +12,7 @@ import ( "log" ) -// Generated from example definition: 2025-04-01-preview/FleetMembers_Create.json +// Generated from example definition: 2025-08-01-preview/FleetMembers_Create.json func ExampleFleetMembersClient_BeginCreate_createsAFleetMemberResourceWithALongRunningOperation() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -67,7 +67,7 @@ func ExampleFleetMembersClient_BeginCreate_createsAFleetMemberResourceWithALongR // } } -// Generated from example definition: 2025-04-01-preview/FleetMembers_Create_MaximumSet_Gen.json +// Generated from example definition: 2025-08-01-preview/FleetMembers_Create_MaximumSet_Gen.json func ExampleFleetMembersClient_BeginCreate_createsAFleetMemberResourceWithALongRunningOperationGeneratedByMaximumSetRule() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -119,7 +119,7 @@ func ExampleFleetMembersClient_BeginCreate_createsAFleetMemberResourceWithALongR // } } -// Generated from example definition: 2025-04-01-preview/FleetMembers_Delete.json +// Generated from example definition: 2025-08-01-preview/FleetMembers_Delete.json func ExampleFleetMembersClient_BeginDelete_deletesAFleetMemberResourceAsynchronouslyWithALongRunningOperation() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -145,7 +145,7 @@ func ExampleFleetMembersClient_BeginDelete_deletesAFleetMemberResourceAsynchrono // } } -// Generated from example definition: 2025-04-01-preview/FleetMembers_Delete_MaximumSet_Gen.json +// Generated from example definition: 2025-08-01-preview/FleetMembers_Delete_MaximumSet_Gen.json func ExampleFleetMembersClient_BeginDelete_deletesAFleetMemberResourceAsynchronouslyWithALongRunningOperationGeneratedByMaximumSetRule() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -172,7 +172,7 @@ func ExampleFleetMembersClient_BeginDelete_deletesAFleetMemberResourceAsynchrono // } } -// Generated from example definition: 2025-04-01-preview/FleetMembers_Get.json +// Generated from example definition: 2025-08-01-preview/FleetMembers_Get.json func ExampleFleetMembersClient_Get_getsAFleetMemberResource() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -219,7 +219,7 @@ func ExampleFleetMembersClient_Get_getsAFleetMemberResource() { // } } -// Generated from example definition: 2025-04-01-preview/FleetMembers_Get_MaximumSet_Gen.json +// Generated from example definition: 2025-08-01-preview/FleetMembers_Get_MaximumSet_Gen.json func ExampleFleetMembersClient_Get_getsAFleetMemberResourceGeneratedByMaximumSetRule() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -260,7 +260,7 @@ func ExampleFleetMembersClient_Get_getsAFleetMemberResourceGeneratedByMaximumSet // } } -// Generated from example definition: 2025-04-01-preview/FleetMembers_ListByFleet.json +// Generated from example definition: 2025-08-01-preview/FleetMembers_ListByFleet.json func ExampleFleetMembersClient_NewListByFleetPager_listsTheMembersOfAFleet() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -316,7 +316,7 @@ func ExampleFleetMembersClient_NewListByFleetPager_listsTheMembersOfAFleet() { } } -// Generated from example definition: 2025-04-01-preview/FleetMembers_ListByFleet_MaximumSet_Gen.json +// Generated from example definition: 2025-08-01-preview/FleetMembers_ListByFleet_MaximumSet_Gen.json func ExampleFleetMembersClient_NewListByFleetPager_listsTheMembersOfAFleetGeneratedByMaximumSetRule() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -367,7 +367,7 @@ func ExampleFleetMembersClient_NewListByFleetPager_listsTheMembersOfAFleetGenera } } -// Generated from example definition: 2025-04-01-preview/FleetMembers_Update.json +// Generated from example definition: 2025-08-01-preview/FleetMembers_Update.json func ExampleFleetMembersClient_BeginUpdateAsync_updatesAFleetMemberResourceSynchronously() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -423,7 +423,7 @@ func ExampleFleetMembersClient_BeginUpdateAsync_updatesAFleetMemberResourceSynch // } } -// Generated from example definition: 2025-04-01-preview/FleetMembers_Update_MaximumSet_Gen.json +// Generated from example definition: 2025-08-01-preview/FleetMembers_Update_MaximumSet_Gen.json func ExampleFleetMembersClient_BeginUpdateAsync_updatesAFleetMemberResourceSynchronouslyGeneratedByMaximumSetRule() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleets_client.go b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleets_client.go index ab588ec1cd3d..33dcc4d0434c 100644 --- a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleets_client.go +++ b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleets_client.go @@ -42,7 +42,7 @@ func NewFleetsClient(subscriptionID string, credential azcore.TokenCredential, o // BeginCreate - Creates or updates a Fleet. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-04-01-preview +// Generated from API version 2025-08-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - fleetName - The name of the Fleet resource. // - resource - Resource create parameters. @@ -68,7 +68,7 @@ func (client *FleetsClient) BeginCreate(ctx context.Context, resourceGroupName s // Create - Creates or updates a Fleet. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-04-01-preview +// Generated from API version 2025-08-01-preview func (client *FleetsClient) create(ctx context.Context, resourceGroupName string, fleetName string, resource Fleet, options *FleetsClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "FleetsClient.BeginCreate" @@ -110,7 +110,7 @@ func (client *FleetsClient) createCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-04-01-preview") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.IfMatch != nil { @@ -129,7 +129,7 @@ func (client *FleetsClient) createCreateRequest(ctx context.Context, resourceGro // BeginDelete - Delete a Fleet // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-04-01-preview +// Generated from API version 2025-08-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - fleetName - The name of the Fleet resource. // - options - FleetsClientBeginDeleteOptions contains the optional parameters for the FleetsClient.BeginDelete method. @@ -153,7 +153,7 @@ func (client *FleetsClient) BeginDelete(ctx context.Context, resourceGroupName s // Delete - Delete a Fleet // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-04-01-preview +// Generated from API version 2025-08-01-preview func (client *FleetsClient) deleteOperation(ctx context.Context, resourceGroupName string, fleetName string, options *FleetsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "FleetsClient.BeginDelete" @@ -195,7 +195,7 @@ func (client *FleetsClient) deleteCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-04-01-preview") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -206,7 +206,7 @@ func (client *FleetsClient) deleteCreateRequest(ctx context.Context, resourceGro // Get - Gets a Fleet. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-04-01-preview +// Generated from API version 2025-08-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - fleetName - The name of the Fleet resource. // - options - FleetsClientGetOptions contains the optional parameters for the FleetsClient.Get method. @@ -252,7 +252,7 @@ func (client *FleetsClient) getCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-04-01-preview") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -269,7 +269,7 @@ func (client *FleetsClient) getHandleResponse(resp *http.Response) (FleetsClient // NewListByResourceGroupPager - Lists fleets in the specified subscription and resource group. // -// Generated from API version 2025-04-01-preview +// Generated from API version 2025-08-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - FleetsClientListByResourceGroupOptions contains the optional parameters for the FleetsClient.NewListByResourceGroupPager // method. @@ -312,7 +312,7 @@ func (client *FleetsClient) listByResourceGroupCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-04-01-preview") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -329,7 +329,7 @@ func (client *FleetsClient) listByResourceGroupHandleResponse(resp *http.Respons // NewListBySubscriptionPager - Lists fleets in the specified subscription. // -// Generated from API version 2025-04-01-preview +// Generated from API version 2025-08-01-preview // - options - FleetsClientListBySubscriptionOptions contains the optional parameters for the FleetsClient.NewListBySubscriptionPager // method. func (client *FleetsClient) NewListBySubscriptionPager(options *FleetsClientListBySubscriptionOptions) *runtime.Pager[FleetsClientListBySubscriptionResponse] { @@ -367,7 +367,7 @@ func (client *FleetsClient) listBySubscriptionCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-04-01-preview") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -385,7 +385,7 @@ func (client *FleetsClient) listBySubscriptionHandleResponse(resp *http.Response // ListCredentials - Lists the user credentials of a Fleet. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-04-01-preview +// Generated from API version 2025-08-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - fleetName - The name of the Fleet resource. // - options - FleetsClientListCredentialsOptions contains the optional parameters for the FleetsClient.ListCredentials method. @@ -431,7 +431,7 @@ func (client *FleetsClient) listCredentialsCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-04-01-preview") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -449,7 +449,7 @@ func (client *FleetsClient) listCredentialsHandleResponse(resp *http.Response) ( // BeginUpdateAsync - Update a Fleet // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-04-01-preview +// Generated from API version 2025-08-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - fleetName - The name of the Fleet resource. // - properties - The resource properties to be updated. @@ -474,7 +474,7 @@ func (client *FleetsClient) BeginUpdateAsync(ctx context.Context, resourceGroupN // UpdateAsync - Update a Fleet // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-04-01-preview +// Generated from API version 2025-08-01-preview func (client *FleetsClient) updateAsync(ctx context.Context, resourceGroupName string, fleetName string, properties FleetPatch, options *FleetsClientBeginUpdateAsyncOptions) (*http.Response, error) { var err error const operationName = "FleetsClient.BeginUpdateAsync" @@ -516,7 +516,7 @@ func (client *FleetsClient) updateAsyncCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-04-01-preview") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.IfMatch != nil { diff --git a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleets_client_example_test.go b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleets_client_example_test.go index dd23667f95a6..760ff7b3ba43 100644 --- a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleets_client_example_test.go +++ b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleets_client_example_test.go @@ -12,7 +12,7 @@ import ( "log" ) -// Generated from example definition: 2025-04-01-preview/Fleets_CreateOrUpdate.json +// Generated from example definition: 2025-08-01-preview/Fleets_CreateOrUpdate.json func ExampleFleetsClient_BeginCreate_createsAFleetResourceWithALongRunningOperation() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -90,7 +90,7 @@ func ExampleFleetsClient_BeginCreate_createsAFleetResourceWithALongRunningOperat // } } -// Generated from example definition: 2025-04-01-preview/Fleets_CreateOrUpdate_MaximumSet_Gen.json +// Generated from example definition: 2025-08-01-preview/Fleets_CreateOrUpdate_MaximumSet_Gen.json func ExampleFleetsClient_BeginCreate_createsAFleetResourceWithALongRunningOperationGeneratedByMaximumSetRule() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -187,7 +187,7 @@ func ExampleFleetsClient_BeginCreate_createsAFleetResourceWithALongRunningOperat // } } -// Generated from example definition: 2025-04-01-preview/Fleets_Delete.json +// Generated from example definition: 2025-08-01-preview/Fleets_Delete.json func ExampleFleetsClient_BeginDelete_deletesAFleetResourceAsynchronouslyWithALongRunningOperation() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -213,7 +213,7 @@ func ExampleFleetsClient_BeginDelete_deletesAFleetResourceAsynchronouslyWithALon // } } -// Generated from example definition: 2025-04-01-preview/Fleets_Delete_MaximumSet_Gen.json +// Generated from example definition: 2025-08-01-preview/Fleets_Delete_MaximumSet_Gen.json func ExampleFleetsClient_BeginDelete_deletesAFleetResourceAsynchronouslyWithALongRunningOperationGeneratedByMaximumSetRule() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -240,7 +240,7 @@ func ExampleFleetsClient_BeginDelete_deletesAFleetResourceAsynchronouslyWithALon // } } -// Generated from example definition: 2025-04-01-preview/Fleets_Get.json +// Generated from example definition: 2025-08-01-preview/Fleets_Get.json func ExampleFleetsClient_Get_getsAFleetResource() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -300,7 +300,7 @@ func ExampleFleetsClient_Get_getsAFleetResource() { // } } -// Generated from example definition: 2025-04-01-preview/Fleets_Get_MaximumSet_Gen.json +// Generated from example definition: 2025-08-01-preview/Fleets_Get_MaximumSet_Gen.json func ExampleFleetsClient_Get_getsAFleetResourceGeneratedByMaximumSetRule() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -368,7 +368,7 @@ func ExampleFleetsClient_Get_getsAFleetResourceGeneratedByMaximumSetRule() { // } } -// Generated from example definition: 2025-04-01-preview/Fleets_ListByResourceGroup.json +// Generated from example definition: 2025-08-01-preview/Fleets_ListByResourceGroup.json func ExampleFleetsClient_NewListByResourceGroupPager_listsTheFleetResourcesInAResourceGroup() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -437,7 +437,7 @@ func ExampleFleetsClient_NewListByResourceGroupPager_listsTheFleetResourcesInARe } } -// Generated from example definition: 2025-04-01-preview/Fleets_ListByResourceGroup_MaximumSet_Gen.json +// Generated from example definition: 2025-08-01-preview/Fleets_ListByResourceGroup_MaximumSet_Gen.json func ExampleFleetsClient_NewListByResourceGroupPager_listsTheFleetResourcesInAResourceGroupGeneratedByMaximumSetRule() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -515,7 +515,7 @@ func ExampleFleetsClient_NewListByResourceGroupPager_listsTheFleetResourcesInARe } } -// Generated from example definition: 2025-04-01-preview/Fleets_ListBySub.json +// Generated from example definition: 2025-08-01-preview/Fleets_ListBySub.json func ExampleFleetsClient_NewListBySubscriptionPager_listsTheFleetResourcesInASubscription() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -584,7 +584,7 @@ func ExampleFleetsClient_NewListBySubscriptionPager_listsTheFleetResourcesInASub } } -// Generated from example definition: 2025-04-01-preview/Fleets_ListBySubscription_MaximumSet_Gen.json +// Generated from example definition: 2025-08-01-preview/Fleets_ListBySubscription_MaximumSet_Gen.json func ExampleFleetsClient_NewListBySubscriptionPager_listsTheFleetResourcesInASubscriptionGeneratedByMaximumSetRule() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -662,7 +662,7 @@ func ExampleFleetsClient_NewListBySubscriptionPager_listsTheFleetResourcesInASub } } -// Generated from example definition: 2025-04-01-preview/Fleets_ListCredentialsResult.json +// Generated from example definition: 2025-08-01-preview/Fleets_ListCredentialsResult.json func ExampleFleetsClient_ListCredentials_listsTheUserCredentialsOfAFleet() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -692,7 +692,7 @@ func ExampleFleetsClient_ListCredentials_listsTheUserCredentialsOfAFleet() { // } } -// Generated from example definition: 2025-04-01-preview/Fleets_ListCredentials_MaximumSet_Gen.json +// Generated from example definition: 2025-08-01-preview/Fleets_ListCredentials_MaximumSet_Gen.json func ExampleFleetsClient_ListCredentials_listsTheUserCredentialsOfAFleetGeneratedByMaximumSetRule() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -722,7 +722,7 @@ func ExampleFleetsClient_ListCredentials_listsTheUserCredentialsOfAFleetGenerate // } } -// Generated from example definition: 2025-04-01-preview/Fleets_PatchTags.json +// Generated from example definition: 2025-08-01-preview/Fleets_PatchTags.json func ExampleFleetsClient_BeginUpdateAsync_updateAFleet() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -792,7 +792,7 @@ func ExampleFleetsClient_BeginUpdateAsync_updateAFleet() { // } } -// Generated from example definition: 2025-04-01-preview/Fleets_Update_MaximumSet_Gen.json +// Generated from example definition: 2025-08-01-preview/Fleets_Update_MaximumSet_Gen.json func ExampleFleetsClient_BeginUpdateAsync_updateAFleetGeneratedByMaximumSetRule() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleetupdatestrategies_client.go b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleetupdatestrategies_client.go index 6c10b8482202..85ca9a07b236 100644 --- a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleetupdatestrategies_client.go +++ b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleetupdatestrategies_client.go @@ -42,7 +42,7 @@ func NewFleetUpdateStrategiesClient(subscriptionID string, credential azcore.Tok // BeginCreateOrUpdate - Create a FleetUpdateStrategy // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-04-01-preview +// Generated from API version 2025-08-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - fleetName - The name of the Fleet resource. // - updateStrategyName - The name of the UpdateStrategy resource. @@ -70,7 +70,7 @@ func (client *FleetUpdateStrategiesClient) BeginCreateOrUpdate(ctx context.Conte // CreateOrUpdate - Create a FleetUpdateStrategy // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-04-01-preview +// Generated from API version 2025-08-01-preview func (client *FleetUpdateStrategiesClient) createOrUpdate(ctx context.Context, resourceGroupName string, fleetName string, updateStrategyName string, resource FleetUpdateStrategy, options *FleetUpdateStrategiesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "FleetUpdateStrategiesClient.BeginCreateOrUpdate" @@ -116,7 +116,7 @@ func (client *FleetUpdateStrategiesClient) createOrUpdateCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-04-01-preview") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.IfMatch != nil { @@ -135,7 +135,7 @@ func (client *FleetUpdateStrategiesClient) createOrUpdateCreateRequest(ctx conte // BeginDelete - Delete a FleetUpdateStrategy // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-04-01-preview +// Generated from API version 2025-08-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - fleetName - The name of the Fleet resource. // - updateStrategyName - The name of the UpdateStrategy resource. @@ -161,7 +161,7 @@ func (client *FleetUpdateStrategiesClient) BeginDelete(ctx context.Context, reso // Delete - Delete a FleetUpdateStrategy // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-04-01-preview +// Generated from API version 2025-08-01-preview func (client *FleetUpdateStrategiesClient) deleteOperation(ctx context.Context, resourceGroupName string, fleetName string, updateStrategyName string, options *FleetUpdateStrategiesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "FleetUpdateStrategiesClient.BeginDelete" @@ -207,7 +207,7 @@ func (client *FleetUpdateStrategiesClient) deleteCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-04-01-preview") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -218,7 +218,7 @@ func (client *FleetUpdateStrategiesClient) deleteCreateRequest(ctx context.Conte // Get - Get a FleetUpdateStrategy // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-04-01-preview +// Generated from API version 2025-08-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - fleetName - The name of the Fleet resource. // - updateStrategyName - The name of the UpdateStrategy resource. @@ -270,7 +270,7 @@ func (client *FleetUpdateStrategiesClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-04-01-preview") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -287,7 +287,7 @@ func (client *FleetUpdateStrategiesClient) getHandleResponse(resp *http.Response // NewListByFleetPager - List FleetUpdateStrategy resources by Fleet // -// Generated from API version 2025-04-01-preview +// Generated from API version 2025-08-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - fleetName - The name of the Fleet resource. // - options - FleetUpdateStrategiesClientListByFleetOptions contains the optional parameters for the FleetUpdateStrategiesClient.NewListByFleetPager @@ -335,7 +335,7 @@ func (client *FleetUpdateStrategiesClient) listByFleetCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-04-01-preview") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleetupdatestrategies_client_example_test.go b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleetupdatestrategies_client_example_test.go index c11f97cc66d7..28f7a871eb5b 100644 --- a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleetupdatestrategies_client_example_test.go +++ b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleetupdatestrategies_client_example_test.go @@ -12,7 +12,7 @@ import ( "log" ) -// Generated from example definition: 2025-04-01-preview/FleetUpdateStrategies_CreateOrUpdate_MaximumSet_Gen.json +// Generated from example definition: 2025-08-01-preview/FleetUpdateStrategies_CreateOrUpdate_MaximumSet_Gen.json func ExampleFleetUpdateStrategiesClient_BeginCreateOrUpdate_createAFleetUpdateStrategyGeneratedByMaximumSetRule() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -86,7 +86,7 @@ func ExampleFleetUpdateStrategiesClient_BeginCreateOrUpdate_createAFleetUpdateSt // } } -// Generated from example definition: 2025-04-01-preview/UpdateStrategies_CreateOrUpdate.json +// Generated from example definition: 2025-08-01-preview/UpdateStrategies_CreateOrUpdate.json func ExampleFleetUpdateStrategiesClient_BeginCreateOrUpdate_createAFleetUpdateStrategy() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -206,7 +206,7 @@ func ExampleFleetUpdateStrategiesClient_BeginCreateOrUpdate_createAFleetUpdateSt // } } -// Generated from example definition: 2025-04-01-preview/FleetUpdateStrategies_Delete_MaximumSet_Gen.json +// Generated from example definition: 2025-08-01-preview/FleetUpdateStrategies_Delete_MaximumSet_Gen.json func ExampleFleetUpdateStrategiesClient_BeginDelete_deleteAFleetUpdateStrategyResourceGeneratedByMaximumSetRule() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -233,7 +233,7 @@ func ExampleFleetUpdateStrategiesClient_BeginDelete_deleteAFleetUpdateStrategyRe // } } -// Generated from example definition: 2025-04-01-preview/UpdateStrategies_Delete.json +// Generated from example definition: 2025-08-01-preview/UpdateStrategies_Delete.json func ExampleFleetUpdateStrategiesClient_BeginDelete_deleteAFleetUpdateStrategyResource() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -259,7 +259,7 @@ func ExampleFleetUpdateStrategiesClient_BeginDelete_deleteAFleetUpdateStrategyRe // } } -// Generated from example definition: 2025-04-01-preview/FleetUpdateStrategies_Get_MaximumSet_Gen.json +// Generated from example definition: 2025-08-01-preview/FleetUpdateStrategies_Get_MaximumSet_Gen.json func ExampleFleetUpdateStrategiesClient_Get_getAFleetUpdateStrategyResourceGeneratedByMaximumSetRule() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -311,7 +311,7 @@ func ExampleFleetUpdateStrategiesClient_Get_getAFleetUpdateStrategyResourceGener // } } -// Generated from example definition: 2025-04-01-preview/UpdateStrategies_Get.json +// Generated from example definition: 2025-08-01-preview/UpdateStrategies_Get.json func ExampleFleetUpdateStrategiesClient_Get_getAFleetUpdateStrategyResource() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -387,7 +387,7 @@ func ExampleFleetUpdateStrategiesClient_Get_getAFleetUpdateStrategyResource() { // } } -// Generated from example definition: 2025-04-01-preview/FleetUpdateStrategies_ListByFleet_MaximumSet_Gen.json +// Generated from example definition: 2025-08-01-preview/FleetUpdateStrategies_ListByFleet_MaximumSet_Gen.json func ExampleFleetUpdateStrategiesClient_NewListByFleetPager_listTheFleetUpdateStrategyResourcesByFleetGeneratedByMaximumSetRule() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -449,7 +449,7 @@ func ExampleFleetUpdateStrategiesClient_NewListByFleetPager_listTheFleetUpdateSt } } -// Generated from example definition: 2025-04-01-preview/UpdateStrategies_ListByFleet.json +// Generated from example definition: 2025-08-01-preview/UpdateStrategies_ListByFleet.json func ExampleFleetUpdateStrategiesClient_NewListByFleetPager_listTheFleetUpdateStrategyResourcesByFleet() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/gates_client.go b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/gates_client.go index 0e156dbf54ce..6beac9c11b51 100644 --- a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/gates_client.go +++ b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/gates_client.go @@ -42,7 +42,7 @@ func NewGatesClient(subscriptionID string, credential azcore.TokenCredential, op // Get - Get a Gate // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-04-01-preview +// Generated from API version 2025-08-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - fleetName - The name of the Fleet resource. // - gateName - The name of the Gate resource, a GUID. @@ -93,7 +93,7 @@ func (client *GatesClient) getCreateRequest(ctx context.Context, resourceGroupNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-04-01-preview") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -110,7 +110,7 @@ func (client *GatesClient) getHandleResponse(resp *http.Response) (GatesClientGe // NewListByFleetPager - List Gate resources by Fleet // -// Generated from API version 2025-04-01-preview +// Generated from API version 2025-08-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - fleetName - The name of the Fleet resource. // - options - GatesClientListByFleetOptions contains the optional parameters for the GatesClient.NewListByFleetPager method. @@ -157,7 +157,7 @@ func (client *GatesClient) listByFleetCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-04-01-preview") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -175,7 +175,7 @@ func (client *GatesClient) listByFleetHandleResponse(resp *http.Response) (Gates // BeginUpdate - Update a Gate // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-04-01-preview +// Generated from API version 2025-08-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - fleetName - The name of the Fleet resource. // - gateName - The name of the Gate resource, a GUID. @@ -202,7 +202,7 @@ func (client *GatesClient) BeginUpdate(ctx context.Context, resourceGroupName st // Update - Update a Gate // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-04-01-preview +// Generated from API version 2025-08-01-preview func (client *GatesClient) update(ctx context.Context, resourceGroupName string, fleetName string, gateName string, properties GatePatch, options *GatesClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "GatesClient.BeginUpdate" @@ -248,7 +248,7 @@ func (client *GatesClient) updateCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-04-01-preview") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.IfMatch != nil { diff --git a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/gates_client_example_test.go b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/gates_client_example_test.go index 9fdd0b0f46cd..faa98224eb8f 100644 --- a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/gates_client_example_test.go +++ b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/gates_client_example_test.go @@ -12,8 +12,8 @@ import ( "log" ) -// Generated from example definition: 2025-04-01-preview/Gates_Get.json -func ExampleGatesClient_Get() { +// Generated from example definition: 2025-08-01-preview/Gates_Get.json +func ExampleGatesClient_Get_getsAGateResource() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -63,8 +63,59 @@ func ExampleGatesClient_Get() { // } } -// Generated from example definition: 2025-04-01-preview/Gates_ListByFleet.json -func ExampleGatesClient_NewListByFleetPager() { +// Generated from example definition: 2025-08-01-preview/Gates_Get_MaximumSet_Gen.json +func ExampleGatesClient_Get_gatesGetMaximumSet() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcontainerservicefleet.NewClientFactory("A5DFED4F-5511-4753-B6C8-3ACC54B370E3", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewGatesClient().Get(ctx, "rgfleets", "fleet-1", "12345678-910a-bcde-f000-000000000000", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armcontainerservicefleet.GatesClientGetResponse{ + // Gate: &armcontainerservicefleet.Gate{ + // Properties: &armcontainerservicefleet.GateProperties{ + // ProvisioningState: to.Ptr(armcontainerservicefleet.GateProvisioningStateSucceeded), + // DisplayName: to.Ptr("ohoncqhjnqlnpgqhidtmlwqitzujqvyvidoibym"), + // GateType: to.Ptr(armcontainerservicefleet.GateTypeApproval), + // Target: &armcontainerservicefleet.GateTarget{ + // ID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/fleets/fleet-1/gates/12345678-910a-bcde-f000-000000000000"), + // UpdateRunProperties: &armcontainerservicefleet.UpdateRunGateTargetProperties{ + // Name: to.Ptr("run1"), + // Stage: to.Ptr("stage1"), + // Group: to.Ptr("group1"), + // Timing: to.Ptr(armcontainerservicefleet.TimingAfter), + // }, + // }, + // State: to.Ptr(armcontainerservicefleet.GateStatePending), + // }, + // ETag: to.Ptr("zk"), + // ID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/fleets/fleet-1/updateRuns/run1"), + // Name: to.Ptr("12345678-910a-bcde-f000-000000000000"), + // Type: to.Ptr("xttejjiwuk"), + // SystemData: &armcontainerservicefleet.SystemData{ + // CreatedBy: to.Ptr("afnyxgutytkmyjqwvebhdh"), + // CreatedByType: to.Ptr(armcontainerservicefleet.CreatedByTypeUser), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-07-21T20:36:49.685Z"); return t}()), + // LastModifiedBy: to.Ptr("ecpoq"), + // LastModifiedByType: to.Ptr(armcontainerservicefleet.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-07-21T20:36:49.685Z"); return t}()), + // }, + // }, + // } +} + +// Generated from example definition: 2025-08-01-preview/Gates_ListByFleet.json +func ExampleGatesClient_NewListByFleetPager_listsTheGatesOfAFleet() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -123,8 +174,69 @@ func ExampleGatesClient_NewListByFleetPager() { } } -// Generated from example definition: 2025-04-01-preview/Gates_Update.json -func ExampleGatesClient_BeginUpdate() { +// Generated from example definition: 2025-08-01-preview/Gates_ListByFleet_MaximumSet_Gen.json +func ExampleGatesClient_NewListByFleetPager_gatesListByFleetMaximumSet() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcontainerservicefleet.NewClientFactory("A5DFED4F-5511-4753-B6C8-3ACC54B370E3", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewGatesClient().NewListByFleetPager("rgfleets", "fleet-1", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page = armcontainerservicefleet.GatesClientListByFleetResponse{ + // GateListResult: armcontainerservicefleet.GateListResult{ + // Value: []*armcontainerservicefleet.Gate{ + // { + // Properties: &armcontainerservicefleet.GateProperties{ + // ProvisioningState: to.Ptr(armcontainerservicefleet.GateProvisioningStateSucceeded), + // DisplayName: to.Ptr("ohoncqhjnqlnpgqhidtmlwqitzujqvyvidoibym"), + // GateType: to.Ptr(armcontainerservicefleet.GateTypeApproval), + // Target: &armcontainerservicefleet.GateTarget{ + // ID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/fleets/fleet-1/gates/12345678-910a-bcde-f000-000000000000"), + // UpdateRunProperties: &armcontainerservicefleet.UpdateRunGateTargetProperties{ + // Name: to.Ptr("run1"), + // Stage: to.Ptr("stage1"), + // Group: to.Ptr("group1"), + // Timing: to.Ptr(armcontainerservicefleet.TimingAfter), + // }, + // }, + // State: to.Ptr(armcontainerservicefleet.GateStatePending), + // }, + // ETag: to.Ptr("zk"), + // ID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/fleets/fleet-1/updateRuns/run1"), + // Name: to.Ptr("tvpzzhsokcrigcrjnqyjhhdmsrm"), + // Type: to.Ptr("xttejjiwuk"), + // SystemData: &armcontainerservicefleet.SystemData{ + // CreatedBy: to.Ptr("afnyxgutytkmyjqwvebhdh"), + // CreatedByType: to.Ptr(armcontainerservicefleet.CreatedByTypeUser), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-07-21T20:36:49.685Z"); return t}()), + // LastModifiedBy: to.Ptr("ecpoq"), + // LastModifiedByType: to.Ptr(armcontainerservicefleet.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-07-21T20:36:49.685Z"); return t}()), + // }, + // }, + // }, + // NextLink: to.Ptr("https://microsoft.com/a"), + // }, + // } + } +} + +// Generated from example definition: 2025-08-01-preview/Gates_Update.json +func ExampleGatesClient_BeginUpdate_updatesAGateResource() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -181,3 +293,64 @@ func ExampleGatesClient_BeginUpdate() { // }, // } } + +// Generated from example definition: 2025-08-01-preview/Gates_Update_MaximumSet_Gen.json +func ExampleGatesClient_BeginUpdate_gatesUpdateMaximumSet() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcontainerservicefleet.NewClientFactory("A5DFED4F-5511-4753-B6C8-3ACC54B370E3", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewGatesClient().BeginUpdate(ctx, "rgfleets", "fleet-1", "12345678-910a-bcde-f000-000000000000", armcontainerservicefleet.GatePatch{ + Properties: &armcontainerservicefleet.GatePatchProperties{ + State: to.Ptr(armcontainerservicefleet.GateStatePending), + }, + }, &armcontainerservicefleet.GatesClientBeginUpdateOptions{ + IfMatch: to.Ptr("jqongzwjguenncptggiqzxxycakgrj"), + IfNoneMatch: to.Ptr("fsyp")}) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armcontainerservicefleet.GatesClientUpdateResponse{ + // Gate: &armcontainerservicefleet.Gate{ + // Properties: &armcontainerservicefleet.GateProperties{ + // ProvisioningState: to.Ptr(armcontainerservicefleet.GateProvisioningStateSucceeded), + // DisplayName: to.Ptr("ohoncqhjnqlnpgqhidtmlwqitzujqvyvidoibym"), + // GateType: to.Ptr(armcontainerservicefleet.GateTypeApproval), + // Target: &armcontainerservicefleet.GateTarget{ + // ID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/fleets/fleet-1/gates/12345678-910a-bcde-f000-000000000000"), + // UpdateRunProperties: &armcontainerservicefleet.UpdateRunGateTargetProperties{ + // Name: to.Ptr("run1"), + // Stage: to.Ptr("stage1"), + // Group: to.Ptr("group1"), + // Timing: to.Ptr(armcontainerservicefleet.TimingAfter), + // }, + // }, + // State: to.Ptr(armcontainerservicefleet.GateStatePending), + // }, + // ETag: to.Ptr("zk"), + // ID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/fleets/fleet-1/updateRuns/run1"), + // Name: to.Ptr("12345678-910a-bcde-f000-000000000000"), + // Type: to.Ptr("xttejjiwuk"), + // SystemData: &armcontainerservicefleet.SystemData{ + // CreatedBy: to.Ptr("afnyxgutytkmyjqwvebhdh"), + // CreatedByType: to.Ptr(armcontainerservicefleet.CreatedByTypeUser), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-07-21T20:36:49.685Z"); return t}()), + // LastModifiedBy: to.Ptr("ecpoq"), + // LastModifiedByType: to.Ptr(armcontainerservicefleet.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-07-21T20:36:49.685Z"); return t}()), + // }, + // }, + // } +} diff --git a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/models.go b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/models.go index a36abc1bf539..38ff4277d238 100644 --- a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/models.go +++ b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/models.go @@ -18,6 +18,12 @@ type APIServerAccessProfile struct { SubnetID *string } +// Affinity is a group of cluster affinity scheduling rules. More to be added. +type Affinity struct { + // ClusterAffinity contains cluster affinity scheduling rules for the selected resources. + ClusterAffinity *ClusterAffinity +} + // AgentProfile - Agent profile for the Fleet hub. type AgentProfile struct { // The ID of the subnet which the Fleet hub node will join on startup. If this is not specified, a vnet and subnet will be @@ -122,6 +128,40 @@ type AutoUpgradeProfileStatus struct { LastTriggeredAt *time.Time } +// ClusterAffinity contains cluster affinity scheduling rules for the selected resources. +type ClusterAffinity struct { + // If the affinity requirements specified by this field are not met at scheduling time, the resource will not be scheduled + // onto the cluster. If the affinity requirements specified by this field cease to be met at some point after the placement + // (e.g. due to an update), the system may or may not try to eventually remove the resource from the cluster. + RequiredDuringSchedulingIgnoredDuringExecution *ClusterSelector +} + +// ClusterResourcePlacementSpec defines the desired state of ClusterResourcePlacement. +type ClusterResourcePlacementSpec struct { + // Policy defines how to select member clusters to place the selected resources. If unspecified, all the joined member clusters + // are selected. + Policy *PlacementPolicy +} + +// ClusterSelector +type ClusterSelector struct { + // REQUIRED; ClusterSelectorTerms is a list of cluster selector terms. The terms are `ORed`. + ClusterSelectorTerms []*ClusterSelectorTerm +} + +// ClusterSelectorTerm +type ClusterSelectorTerm struct { + // LabelSelector is a label query over all the joined member clusters. Clusters matching the query are selected. If you specify + // both label and property selectors in the same term, the results are AND'd. + LabelSelector *LabelSelector + + // PropertySelector is a property query over all joined member clusters. Clusters matching the query are selected. If you + // specify both label and property selectors in the same term, the results are AND'd. At this moment, PropertySelector can + // only be used with `RequiredDuringSchedulingIgnoredDuringExecution` affinity terms. This field is beta-level; it is for + // the property-based scheduling feature and is only functional when a property provider is enabled in the deployment. + PropertySelector *PropertySelector +} + // ErrorAdditionalInfo - The resource management error additional info. type ErrorAdditionalInfo struct { // READ-ONLY; The additional info. @@ -227,6 +267,84 @@ type FleetListResult struct { NextLink *string } +// FleetManagedNamespace - A fleet managed namespace. +type FleetManagedNamespace struct { + // REQUIRED; The geo-location where the resource lives + Location *string + + // The resource-specific properties for this resource. + Properties *FleetManagedNamespaceProperties + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; If eTag is provided in the response body, it may also be provided as a header per the normal etag convention. + // Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in + // the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header + // fields. + ETag *string + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// FleetManagedNamespaceListResult - The response of a FleetManagedNamespace list operation. +type FleetManagedNamespaceListResult struct { + // REQUIRED; The FleetManagedNamespace items on this page + Value []*FleetManagedNamespace + + // The link to the next page of items + NextLink *string +} + +// FleetManagedNamespacePatch - The properties of a fleet managed namespace that can be patched. +type FleetManagedNamespacePatch struct { + // Resource tags. + Tags map[string]*string +} + +// FleetManagedNamespaceProperties - The properties of a fleet managed namespace. +type FleetManagedNamespaceProperties struct { + // REQUIRED; Action if the managed namespace with the same name already exists. Default is Never. + AdoptionPolicy *AdoptionPolicy + + // REQUIRED; Delete options of a fleet managed namespace. Default is Keep. + DeletePolicy *DeletePolicy + + // The namespace properties for the fleet managed namespace. + ManagedNamespaceProperties *ManagedNamespaceProperties + + // The profile of the propagation to create the namespace. + PropagationPolicy *PropagationPolicy + + // READ-ONLY; The Azure Portal FQDN of the Fleet hub. + PortalFqdn *string + + // READ-ONLY; The status of the last operation. + ProvisioningState *FleetManagedNamespaceProvisioningState + + // READ-ONLY; Status information of the last operation for fleet managed namespace. + Status *FleetManagedNamespaceStatus +} + +// FleetManagedNamespaceStatus - Status information for the fleet managed namespace. +type FleetManagedNamespaceStatus struct { + // READ-ONLY; The last operation error of the fleet managed namespace + LastOperationError *ErrorDetail + + // READ-ONLY; The last operation ID for the fleet managed namespace + LastOperationID *string +} + // FleetMember - A member of the Fleet. It contains a reference to an existing Kubernetes cluster on Azure. type FleetMember struct { // The resource-specific properties for this resource. @@ -462,6 +580,31 @@ type GenerateResponse struct { ID *string } +// LabelSelector - A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions +// are ANDed. An empty label selector matches all objects. A null label selector matches no objects. +type LabelSelector struct { + // matchExpressions is a list of label selector requirements. The requirements are ANDed. + MatchExpressions []*LabelSelectorRequirement + + // matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, + // whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + MatchLabels map[string]*string +} + +// LabelSelectorRequirement - A label selector requirement is a selector that contains values, a key, and an operator that +// relates the key and values. +type LabelSelectorRequirement struct { + // REQUIRED; key is the label key that the selector applies to. + Key *string + + // REQUIRED; operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + Operator *LabelSelectorOperator + + // values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator + // is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + Values []*string +} + // ManagedClusterUpdate - The update to be applied to the ManagedClusters. type ManagedClusterUpdate struct { // REQUIRED; The upgrade to apply to the ManagedClusters. @@ -480,6 +623,21 @@ type ManagedClusterUpgradeSpec struct { KubernetesVersion *string } +// ManagedNamespaceProperties - The namespace properties for the fleet managed namespace. +type ManagedNamespaceProperties struct { + // The annotations for the fleet managed namespace. + Annotations map[string]*string + + // The default network policy for the fleet managed namespace. + DefaultNetworkPolicy *NetworkPolicy + + // The default resource quota for the fleet managed namespace. + DefaultResourceQuota *ResourceQuota + + // The labels for the fleet managed namespace. + Labels map[string]*string +} + // ManagedServiceIdentity - Managed service identity (system assigned and/or user assigned identities) type ManagedServiceIdentity struct { // REQUIRED; The type of managed identity assigned to this resource. @@ -514,6 +672,15 @@ type MemberUpdateStatus struct { Status *UpdateStatus } +// NetworkPolicy - The network policy for the managed namespace. +type NetworkPolicy struct { + // The egress policy for the managed namespace. + Egress *PolicyRule + + // The ingress policy for the managed namespace. + Ingress *PolicyRule +} + // NodeImageSelection - The node image upgrade to be applied to the target nodes in update run. type NodeImageSelection struct { // REQUIRED; The node image upgrade type. @@ -589,6 +756,79 @@ type OperationListResult struct { NextLink *string } +// PlacementPolicy contains the rules to select target member clusters to place the selected resources. Note that only clusters +// that are both joined and satisfying the rules will be selected. You can only specify at most one of the two fields: ClusterNames +// and Affinity. If none is specified, all the joined clusters are selected. +type PlacementPolicy struct { + // Affinity contains cluster affinity scheduling rules. Defines which member clusters to place the selected resources. Only + // valid if the placement type is "PickAll" or "PickN". + Affinity *Affinity + + // ClusterNames contains a list of names of MemberCluster to place the selected resources. Only valid if the placement type + // is "PickFixed" + ClusterNames []*string + + // Type of placement. Can be "PickAll", "PickN" or "PickFixed". Default is PickAll. + PlacementType *PlacementType + + // If specified, the ClusterResourcePlacement's Tolerations. Tolerations cannot be updated or deleted. This field is beta-level + // and is for the taints and tolerations feature. + Tolerations []*Toleration +} + +// PlacementProfile - The configuration profile for default ClusterResourcePlacement for placement. +type PlacementProfile struct { + // The default ClusterResourcePlacement policy configuration. + DefaultClusterResourcePlacement *ClusterResourcePlacementSpec +} + +// PropagationPolicy - The propagation to be used for provisioning the namespace among the fleet. +type PropagationPolicy struct { + // REQUIRED; The type of the policy to be used. Default is Placement. + Type *PropagationType + + // The profile to be used for propagation via placement. + PlacementProfile *PlacementProfile +} + +// PropertySelector helps user specify property requirements when picking clusters for resource placement. +type PropertySelector struct { + // REQUIRED; MatchExpressions is an array of PropertySelectorRequirements. The requirements are AND'd. + MatchExpressions []*PropertySelectorRequirement +} + +// PropertySelectorRequirement is a specific property requirement when picking clusters for resource placement. +type PropertySelectorRequirement struct { + // REQUIRED; Name is the name of the property; it should be a Kubernetes label name. + Name *string + + // REQUIRED; Operator specifies the relationship between a cluster's observed value of the specified property and the values + // given in the requirement. + Operator *PropertySelectorOperator + + // REQUIRED; Values are a list of values of the specified property which Fleet will compare against the observed values of + // individual member clusters in accordance with the given operator. At this moment, each value should be a Kubernetes quantity. + // For more information, see https://pkg.go.dev/k8s.io/apimachinery/pkg/api/resource#Quantity. If the operator is Gt (greater + // than), Ge (greater than or equal to), Lt (less than), or `Le` (less than or equal to), Eq (equal to), or Ne (ne), exactly + // one value must be specified in the list. + Values []*string +} + +// ResourceQuota - The resource quota for the managed namespace. +type ResourceQuota struct { + // The CPU limit for the managed namespace. See more at https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu + CPULimit *string + + // The CPU request for the managed namespace. See more at https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu + CPURequest *string + + // The memory limit for the managed namespace. See more at https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-memory + MemoryLimit *string + + // The memory request for the managed namespace. See more at https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-memory + MemoryRequest *string +} + // SkipProperties - The properties of a skip operation containing multiple skip requests. type SkipProperties struct { // REQUIRED; The targets to skip. @@ -627,6 +867,26 @@ type SystemData struct { LastModifiedByType *CreatedByType } +// Toleration allows ClusterResourcePlacement to tolerate any taint that matches the triple using the matching +// operator . +type Toleration struct { + // Effect indicates the taint effect to match. Empty means match all taint effects. When specified, only allowed value is + // NoSchedule. + Effect *TaintEffect + + // Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must + // be Exists; this combination means to match all values and all keys. + Key *string + + // Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists + // is equivalent to wildcard for value, so that a ClusterResourcePlacement can tolerate all taints of a particular category. + Operator *TolerationOperator + + // Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just + // a regular string. + Value *string +} + // UpdateGroup - A group to be updated. type UpdateGroup struct { // REQUIRED; Name of the group. diff --git a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/models_serde.go b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/models_serde.go index 77e0e5e6e5d8..3a0da4a942ef 100644 --- a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/models_serde.go +++ b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/models_serde.go @@ -47,6 +47,33 @@ func (a *APIServerAccessProfile) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type Affinity. +func (a Affinity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clusterAffinity", a.ClusterAffinity) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Affinity. +func (a *Affinity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "clusterAffinity": + err = unpopulate(val, "ClusterAffinity", &a.ClusterAffinity) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type AgentProfile. func (a AgentProfile) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -277,6 +304,118 @@ func (a *AutoUpgradeProfileStatus) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ClusterAffinity. +func (c ClusterAffinity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "requiredDuringSchedulingIgnoredDuringExecution", c.RequiredDuringSchedulingIgnoredDuringExecution) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterAffinity. +func (c *ClusterAffinity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "requiredDuringSchedulingIgnoredDuringExecution": + err = unpopulate(val, "RequiredDuringSchedulingIgnoredDuringExecution", &c.RequiredDuringSchedulingIgnoredDuringExecution) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ClusterResourcePlacementSpec. +func (c ClusterResourcePlacementSpec) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "policy", c.Policy) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterResourcePlacementSpec. +func (c *ClusterResourcePlacementSpec) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "policy": + err = unpopulate(val, "Policy", &c.Policy) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ClusterSelector. +func (c ClusterSelector) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clusterSelectorTerms", c.ClusterSelectorTerms) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterSelector. +func (c *ClusterSelector) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "clusterSelectorTerms": + err = unpopulate(val, "ClusterSelectorTerms", &c.ClusterSelectorTerms) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ClusterSelectorTerm. +func (c ClusterSelectorTerm) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "labelSelector", c.LabelSelector) + populate(objectMap, "propertySelector", c.PropertySelector) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterSelectorTerm. +func (c *ClusterSelectorTerm) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "labelSelector": + err = unpopulate(val, "LabelSelector", &c.LabelSelector) + delete(rawMsg, key) + case "propertySelector": + err = unpopulate(val, "PropertySelector", &c.PropertySelector) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo. func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -550,6 +689,201 @@ func (f *FleetListResult) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type FleetManagedNamespace. +func (f FleetManagedNamespace) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "eTag", f.ETag) + populate(objectMap, "id", f.ID) + populate(objectMap, "location", f.Location) + populate(objectMap, "name", f.Name) + populate(objectMap, "properties", f.Properties) + populate(objectMap, "systemData", f.SystemData) + populate(objectMap, "tags", f.Tags) + populate(objectMap, "type", f.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FleetManagedNamespace. +func (f *FleetManagedNamespace) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "eTag": + err = unpopulate(val, "ETag", &f.ETag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &f.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &f.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &f.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &f.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &f.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &f.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &f.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FleetManagedNamespaceListResult. +func (f FleetManagedNamespaceListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", f.NextLink) + populate(objectMap, "value", f.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FleetManagedNamespaceListResult. +func (f *FleetManagedNamespaceListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &f.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &f.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FleetManagedNamespacePatch. +func (f FleetManagedNamespacePatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "tags", f.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FleetManagedNamespacePatch. +func (f *FleetManagedNamespacePatch) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "tags": + err = unpopulate(val, "Tags", &f.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FleetManagedNamespaceProperties. +func (f FleetManagedNamespaceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "adoptionPolicy", f.AdoptionPolicy) + populate(objectMap, "deletePolicy", f.DeletePolicy) + populate(objectMap, "managedNamespaceProperties", f.ManagedNamespaceProperties) + populate(objectMap, "portalFqdn", f.PortalFqdn) + populate(objectMap, "propagationPolicy", f.PropagationPolicy) + populate(objectMap, "provisioningState", f.ProvisioningState) + populate(objectMap, "status", f.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FleetManagedNamespaceProperties. +func (f *FleetManagedNamespaceProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "adoptionPolicy": + err = unpopulate(val, "AdoptionPolicy", &f.AdoptionPolicy) + delete(rawMsg, key) + case "deletePolicy": + err = unpopulate(val, "DeletePolicy", &f.DeletePolicy) + delete(rawMsg, key) + case "managedNamespaceProperties": + err = unpopulate(val, "ManagedNamespaceProperties", &f.ManagedNamespaceProperties) + delete(rawMsg, key) + case "portalFqdn": + err = unpopulate(val, "PortalFqdn", &f.PortalFqdn) + delete(rawMsg, key) + case "propagationPolicy": + err = unpopulate(val, "PropagationPolicy", &f.PropagationPolicy) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &f.ProvisioningState) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &f.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FleetManagedNamespaceStatus. +func (f FleetManagedNamespaceStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "lastOperationError", f.LastOperationError) + populate(objectMap, "lastOperationId", f.LastOperationID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FleetManagedNamespaceStatus. +func (f *FleetManagedNamespaceStatus) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "lastOperationError": + err = unpopulate(val, "LastOperationError", &f.LastOperationError) + delete(rawMsg, key) + case "lastOperationId": + err = unpopulate(val, "LastOperationID", &f.LastOperationID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type FleetMember. func (f FleetMember) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1230,6 +1564,72 @@ func (g *GenerateResponse) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type LabelSelector. +func (l LabelSelector) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "matchExpressions", l.MatchExpressions) + populate(objectMap, "matchLabels", l.MatchLabels) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LabelSelector. +func (l *LabelSelector) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "matchExpressions": + err = unpopulate(val, "MatchExpressions", &l.MatchExpressions) + delete(rawMsg, key) + case "matchLabels": + err = unpopulate(val, "MatchLabels", &l.MatchLabels) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LabelSelectorRequirement. +func (l LabelSelectorRequirement) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "key", l.Key) + populate(objectMap, "operator", l.Operator) + populate(objectMap, "values", l.Values) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LabelSelectorRequirement. +func (l *LabelSelectorRequirement) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "key": + err = unpopulate(val, "Key", &l.Key) + delete(rawMsg, key) + case "operator": + err = unpopulate(val, "Operator", &l.Operator) + delete(rawMsg, key) + case "values": + err = unpopulate(val, "Values", &l.Values) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ManagedClusterUpdate. func (m ManagedClusterUpdate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1292,6 +1692,45 @@ func (m *ManagedClusterUpgradeSpec) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ManagedNamespaceProperties. +func (m ManagedNamespaceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "annotations", m.Annotations) + populate(objectMap, "defaultNetworkPolicy", m.DefaultNetworkPolicy) + populate(objectMap, "defaultResourceQuota", m.DefaultResourceQuota) + populate(objectMap, "labels", m.Labels) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedNamespaceProperties. +func (m *ManagedNamespaceProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "annotations": + err = unpopulate(val, "Annotations", &m.Annotations) + delete(rawMsg, key) + case "defaultNetworkPolicy": + err = unpopulate(val, "DefaultNetworkPolicy", &m.DefaultNetworkPolicy) + delete(rawMsg, key) + case "defaultResourceQuota": + err = unpopulate(val, "DefaultResourceQuota", &m.DefaultResourceQuota) + delete(rawMsg, key) + case "labels": + err = unpopulate(val, "Labels", &m.Labels) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ManagedServiceIdentity. func (m ManagedServiceIdentity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1374,6 +1813,37 @@ func (m *MemberUpdateStatus) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type NetworkPolicy. +func (n NetworkPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "egress", n.Egress) + populate(objectMap, "ingress", n.Ingress) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkPolicy. +func (n *NetworkPolicy) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "egress": + err = unpopulate(val, "Egress", &n.Egress) + delete(rawMsg, key) + case "ingress": + err = unpopulate(val, "Ingress", &n.Ingress) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type NodeImageSelection. func (n NodeImageSelection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1572,6 +2042,204 @@ func (o *OperationListResult) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type PlacementPolicy. +func (p PlacementPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "affinity", p.Affinity) + populate(objectMap, "clusterNames", p.ClusterNames) + populate(objectMap, "placementType", p.PlacementType) + populate(objectMap, "tolerations", p.Tolerations) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PlacementPolicy. +func (p *PlacementPolicy) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "affinity": + err = unpopulate(val, "Affinity", &p.Affinity) + delete(rawMsg, key) + case "clusterNames": + err = unpopulate(val, "ClusterNames", &p.ClusterNames) + delete(rawMsg, key) + case "placementType": + err = unpopulate(val, "PlacementType", &p.PlacementType) + delete(rawMsg, key) + case "tolerations": + err = unpopulate(val, "Tolerations", &p.Tolerations) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PlacementProfile. +func (p PlacementProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "defaultClusterResourcePlacement", p.DefaultClusterResourcePlacement) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PlacementProfile. +func (p *PlacementProfile) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "defaultClusterResourcePlacement": + err = unpopulate(val, "DefaultClusterResourcePlacement", &p.DefaultClusterResourcePlacement) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PropagationPolicy. +func (p PropagationPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "placementProfile", p.PlacementProfile) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PropagationPolicy. +func (p *PropagationPolicy) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "placementProfile": + err = unpopulate(val, "PlacementProfile", &p.PlacementProfile) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PropertySelector. +func (p PropertySelector) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "matchExpressions", p.MatchExpressions) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PropertySelector. +func (p *PropertySelector) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "matchExpressions": + err = unpopulate(val, "MatchExpressions", &p.MatchExpressions) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PropertySelectorRequirement. +func (p PropertySelectorRequirement) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", p.Name) + populate(objectMap, "operator", p.Operator) + populate(objectMap, "values", p.Values) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PropertySelectorRequirement. +func (p *PropertySelectorRequirement) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "operator": + err = unpopulate(val, "Operator", &p.Operator) + delete(rawMsg, key) + case "values": + err = unpopulate(val, "Values", &p.Values) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceQuota. +func (r ResourceQuota) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "cpuLimit", r.CPULimit) + populate(objectMap, "cpuRequest", r.CPURequest) + populate(objectMap, "memoryLimit", r.MemoryLimit) + populate(objectMap, "memoryRequest", r.MemoryRequest) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceQuota. +func (r *ResourceQuota) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "cpuLimit": + err = unpopulate(val, "CPULimit", &r.CPULimit) + delete(rawMsg, key) + case "cpuRequest": + err = unpopulate(val, "CPURequest", &r.CPURequest) + delete(rawMsg, key) + case "memoryLimit": + err = unpopulate(val, "MemoryLimit", &r.MemoryLimit) + delete(rawMsg, key) + case "memoryRequest": + err = unpopulate(val, "MemoryRequest", &r.MemoryRequest) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type SkipProperties. func (s SkipProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1677,6 +2345,45 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type Toleration. +func (t Toleration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "effect", t.Effect) + populate(objectMap, "key", t.Key) + populate(objectMap, "operator", t.Operator) + populate(objectMap, "value", t.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Toleration. +func (t *Toleration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "effect": + err = unpopulate(val, "Effect", &t.Effect) + delete(rawMsg, key) + case "key": + err = unpopulate(val, "Key", &t.Key) + delete(rawMsg, key) + case "operator": + err = unpopulate(val, "Operator", &t.Operator) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &t.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type UpdateGroup. func (u UpdateGroup) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) diff --git a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/operations_client.go b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/operations_client.go index 06fccba1cddc..a85419479b3f 100644 --- a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/operations_client.go +++ b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/operations_client.go @@ -35,7 +35,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - List the operations for the provider // -// Generated from API version 2025-04-01-preview +// Generated from API version 2025-08-01-preview // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -68,7 +68,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, _ *Operat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-04-01-preview") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/operations_client_example_test.go b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/operations_client_example_test.go index 080a694dd659..21793910489a 100644 --- a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/operations_client_example_test.go +++ b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/operations_client_example_test.go @@ -11,7 +11,7 @@ import ( "log" ) -// Generated from example definition: 2025-04-01-preview/Operations_List.json +// Generated from example definition: 2025-08-01-preview/Operations_List.json func ExampleOperationsClient_NewListPager_listTheOperationsForTheProvider() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -52,7 +52,7 @@ func ExampleOperationsClient_NewListPager_listTheOperationsForTheProvider() { } } -// Generated from example definition: 2025-04-01-preview/Operations_List_MaximumSet_Gen.json +// Generated from example definition: 2025-08-01-preview/Operations_List_MaximumSet_Gen.json func ExampleOperationsClient_NewListPager_listTheOperationsForTheProviderGeneratedByMaximumSetRule() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -96,7 +96,7 @@ func ExampleOperationsClient_NewListPager_listTheOperationsForTheProviderGenerat } } -// Generated from example definition: 2025-04-01-preview/Operations_List_MinimumSet_Gen.json +// Generated from example definition: 2025-08-01-preview/Operations_List_MinimumSet_Gen.json func ExampleOperationsClient_NewListPager_listTheOperationsForTheProviderGeneratedByMinimumSetRule() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/options.go b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/options.go index 8ec18e78aef5..a711aa86fcbf 100644 --- a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/options.go +++ b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/options.go @@ -45,6 +45,50 @@ type AutoUpgradeProfilesClientListByFleetOptions struct { // placeholder for future optional parameters } +// FleetManagedNamespacesClientBeginCreateOrUpdateOptions contains the optional parameters for the FleetManagedNamespacesClient.BeginCreateOrUpdate +// method. +type FleetManagedNamespacesClientBeginCreateOrUpdateOptions struct { + // The request should only proceed if an entity matches this string. + IfMatch *string + + // The request should only proceed if no entity matches this string. + IfNoneMatch *string + + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// FleetManagedNamespacesClientBeginDeleteOptions contains the optional parameters for the FleetManagedNamespacesClient.BeginDelete +// method. +type FleetManagedNamespacesClientBeginDeleteOptions struct { + // The request should only proceed if an entity matches this string. + IfMatch *string + + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// FleetManagedNamespacesClientBeginUpdateOptions contains the optional parameters for the FleetManagedNamespacesClient.BeginUpdate +// method. +type FleetManagedNamespacesClientBeginUpdateOptions struct { + // The request should only proceed if an entity matches this string. + IfMatch *string + + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// FleetManagedNamespacesClientGetOptions contains the optional parameters for the FleetManagedNamespacesClient.Get method. +type FleetManagedNamespacesClientGetOptions struct { + // placeholder for future optional parameters +} + +// FleetManagedNamespacesClientListByFleetOptions contains the optional parameters for the FleetManagedNamespacesClient.NewListByFleetPager +// method. +type FleetManagedNamespacesClientListByFleetOptions struct { + // placeholder for future optional parameters +} + // FleetMembersClientBeginCreateOptions contains the optional parameters for the FleetMembersClient.BeginCreate method. type FleetMembersClientBeginCreateOptions struct { // The request should only proceed if an entity matches this string. diff --git a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/responses.go b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/responses.go index 77c04fb47af1..a8257ed800c7 100644 --- a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/responses.go +++ b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/responses.go @@ -36,6 +36,35 @@ type AutoUpgradeProfilesClientListByFleetResponse struct { AutoUpgradeProfileListResult } +// FleetManagedNamespacesClientCreateOrUpdateResponse contains the response from method FleetManagedNamespacesClient.BeginCreateOrUpdate. +type FleetManagedNamespacesClientCreateOrUpdateResponse struct { + // A fleet managed namespace. + FleetManagedNamespace +} + +// FleetManagedNamespacesClientDeleteResponse contains the response from method FleetManagedNamespacesClient.BeginDelete. +type FleetManagedNamespacesClientDeleteResponse struct { + // placeholder for future response values +} + +// FleetManagedNamespacesClientGetResponse contains the response from method FleetManagedNamespacesClient.Get. +type FleetManagedNamespacesClientGetResponse struct { + // A fleet managed namespace. + FleetManagedNamespace +} + +// FleetManagedNamespacesClientListByFleetResponse contains the response from method FleetManagedNamespacesClient.NewListByFleetPager. +type FleetManagedNamespacesClientListByFleetResponse struct { + // The response of a FleetManagedNamespace list operation. + FleetManagedNamespaceListResult +} + +// FleetManagedNamespacesClientUpdateResponse contains the response from method FleetManagedNamespacesClient.BeginUpdate. +type FleetManagedNamespacesClientUpdateResponse struct { + // A fleet managed namespace. + FleetManagedNamespace +} + // FleetMembersClientCreateResponse contains the response from method FleetMembersClient.BeginCreate. type FleetMembersClientCreateResponse struct { // A member of the Fleet. It contains a reference to an existing Kubernetes cluster on Azure. diff --git a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/testdata/_metadata.json b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/testdata/_metadata.json index 8771712d4d21..386b459fd488 100644 --- a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/testdata/_metadata.json +++ b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/testdata/_metadata.json @@ -1,4 +1,4 @@ { - "apiVersion": "2025-04-01-preview", - "emitterVersion": "0.8.3" + "apiVersion": "2025-08-01-preview", + "emitterVersion": "0.8.6" } \ No newline at end of file diff --git a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/tsp-location.yaml b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/tsp-location.yaml index 7bec80384f6a..e556ecdb5c14 100644 --- a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/tsp-location.yaml +++ b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/containerservice/Fleet.Management -commit: 6fb604853ab1c56f2adbe6e4922c31e772425cba +commit: d0cd556bd91d2dda700e983c0d253fa025b324c0 repo: Azure/azure-rest-api-specs additionalDirectories: diff --git a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/updateruns_client.go b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/updateruns_client.go index afb8a3c421c7..357a8c9ae182 100644 --- a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/updateruns_client.go +++ b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/updateruns_client.go @@ -42,7 +42,7 @@ func NewUpdateRunsClient(subscriptionID string, credential azcore.TokenCredentia // BeginCreateOrUpdate - Create a UpdateRun // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-04-01-preview +// Generated from API version 2025-08-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - fleetName - The name of the Fleet resource. // - updateRunName - The name of the UpdateRun resource. @@ -70,7 +70,7 @@ func (client *UpdateRunsClient) BeginCreateOrUpdate(ctx context.Context, resourc // CreateOrUpdate - Create a UpdateRun // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-04-01-preview +// Generated from API version 2025-08-01-preview func (client *UpdateRunsClient) createOrUpdate(ctx context.Context, resourceGroupName string, fleetName string, updateRunName string, resource UpdateRun, options *UpdateRunsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "UpdateRunsClient.BeginCreateOrUpdate" @@ -116,7 +116,7 @@ func (client *UpdateRunsClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-04-01-preview") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.IfMatch != nil { @@ -135,7 +135,7 @@ func (client *UpdateRunsClient) createOrUpdateCreateRequest(ctx context.Context, // BeginDelete - Delete a UpdateRun // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-04-01-preview +// Generated from API version 2025-08-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - fleetName - The name of the Fleet resource. // - updateRunName - The name of the UpdateRun resource. @@ -160,7 +160,7 @@ func (client *UpdateRunsClient) BeginDelete(ctx context.Context, resourceGroupNa // Delete - Delete a UpdateRun // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-04-01-preview +// Generated from API version 2025-08-01-preview func (client *UpdateRunsClient) deleteOperation(ctx context.Context, resourceGroupName string, fleetName string, updateRunName string, options *UpdateRunsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "UpdateRunsClient.BeginDelete" @@ -206,7 +206,7 @@ func (client *UpdateRunsClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-04-01-preview") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -217,7 +217,7 @@ func (client *UpdateRunsClient) deleteCreateRequest(ctx context.Context, resourc // Get - Get a UpdateRun // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-04-01-preview +// Generated from API version 2025-08-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - fleetName - The name of the Fleet resource. // - updateRunName - The name of the UpdateRun resource. @@ -268,7 +268,7 @@ func (client *UpdateRunsClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-04-01-preview") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -285,7 +285,7 @@ func (client *UpdateRunsClient) getHandleResponse(resp *http.Response) (UpdateRu // NewListByFleetPager - List UpdateRun resources by Fleet // -// Generated from API version 2025-04-01-preview +// Generated from API version 2025-08-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - fleetName - The name of the Fleet resource. // - options - UpdateRunsClientListByFleetOptions contains the optional parameters for the UpdateRunsClient.NewListByFleetPager @@ -333,7 +333,7 @@ func (client *UpdateRunsClient) listByFleetCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-04-01-preview") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -351,7 +351,7 @@ func (client *UpdateRunsClient) listByFleetHandleResponse(resp *http.Response) ( // BeginSkip - Skips one or a combination of member/group/stage/afterStageWait(s) of an update run. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-04-01-preview +// Generated from API version 2025-08-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - fleetName - The name of the Fleet resource. // - updateRunName - The name of the UpdateRun resource. @@ -377,7 +377,7 @@ func (client *UpdateRunsClient) BeginSkip(ctx context.Context, resourceGroupName // Skip - Skips one or a combination of member/group/stage/afterStageWait(s) of an update run. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-04-01-preview +// Generated from API version 2025-08-01-preview func (client *UpdateRunsClient) skip(ctx context.Context, resourceGroupName string, fleetName string, updateRunName string, body SkipProperties, options *UpdateRunsClientBeginSkipOptions) (*http.Response, error) { var err error const operationName = "UpdateRunsClient.BeginSkip" @@ -423,7 +423,7 @@ func (client *UpdateRunsClient) skipCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-04-01-preview") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.IfMatch != nil { @@ -439,7 +439,7 @@ func (client *UpdateRunsClient) skipCreateRequest(ctx context.Context, resourceG // BeginStart - Starts an UpdateRun. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-04-01-preview +// Generated from API version 2025-08-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - fleetName - The name of the Fleet resource. // - updateRunName - The name of the UpdateRun resource. @@ -464,7 +464,7 @@ func (client *UpdateRunsClient) BeginStart(ctx context.Context, resourceGroupNam // Start - Starts an UpdateRun. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-04-01-preview +// Generated from API version 2025-08-01-preview func (client *UpdateRunsClient) start(ctx context.Context, resourceGroupName string, fleetName string, updateRunName string, options *UpdateRunsClientBeginStartOptions) (*http.Response, error) { var err error const operationName = "UpdateRunsClient.BeginStart" @@ -510,7 +510,7 @@ func (client *UpdateRunsClient) startCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-04-01-preview") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.IfMatch != nil { @@ -522,7 +522,7 @@ func (client *UpdateRunsClient) startCreateRequest(ctx context.Context, resource // BeginStop - Stops an UpdateRun. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-04-01-preview +// Generated from API version 2025-08-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - fleetName - The name of the Fleet resource. // - updateRunName - The name of the UpdateRun resource. @@ -547,7 +547,7 @@ func (client *UpdateRunsClient) BeginStop(ctx context.Context, resourceGroupName // Stop - Stops an UpdateRun. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-04-01-preview +// Generated from API version 2025-08-01-preview func (client *UpdateRunsClient) stop(ctx context.Context, resourceGroupName string, fleetName string, updateRunName string, options *UpdateRunsClientBeginStopOptions) (*http.Response, error) { var err error const operationName = "UpdateRunsClient.BeginStop" @@ -593,7 +593,7 @@ func (client *UpdateRunsClient) stopCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-04-01-preview") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.IfMatch != nil { diff --git a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/updateruns_client_example_test.go b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/updateruns_client_example_test.go index 6fecec9889fa..889d5bd80109 100644 --- a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/updateruns_client_example_test.go +++ b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/updateruns_client_example_test.go @@ -12,7 +12,7 @@ import ( "log" ) -// Generated from example definition: 2025-04-01-preview/UpdateRuns_CreateOrUpdate.json +// Generated from example definition: 2025-08-01-preview/UpdateRuns_CreateOrUpdate.json func ExampleUpdateRunsClient_BeginCreateOrUpdate_createAnUpdateRun() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -221,7 +221,7 @@ func ExampleUpdateRunsClient_BeginCreateOrUpdate_createAnUpdateRun() { // } } -// Generated from example definition: 2025-04-01-preview/UpdateRuns_CreateOrUpdate_MaximumSet_Gen.json +// Generated from example definition: 2025-08-01-preview/UpdateRuns_CreateOrUpdate_MaximumSet_Gen.json func ExampleUpdateRunsClient_BeginCreateOrUpdate_createAnUpdateRunGeneratedByMaximumSetRule() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -457,7 +457,7 @@ func ExampleUpdateRunsClient_BeginCreateOrUpdate_createAnUpdateRunGeneratedByMax // } } -// Generated from example definition: 2025-04-01-preview/UpdateRuns_Delete.json +// Generated from example definition: 2025-08-01-preview/UpdateRuns_Delete.json func ExampleUpdateRunsClient_BeginDelete_deleteAnUpdateRunResource() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -483,7 +483,7 @@ func ExampleUpdateRunsClient_BeginDelete_deleteAnUpdateRunResource() { // } } -// Generated from example definition: 2025-04-01-preview/UpdateRuns_Delete_MaximumSet_Gen.json +// Generated from example definition: 2025-08-01-preview/UpdateRuns_Delete_MaximumSet_Gen.json func ExampleUpdateRunsClient_BeginDelete_deleteAnUpdateRunResourceGeneratedByMaximumSetRule() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -510,7 +510,7 @@ func ExampleUpdateRunsClient_BeginDelete_deleteAnUpdateRunResourceGeneratedByMax // } } -// Generated from example definition: 2025-04-01-preview/UpdateRuns_Get.json +// Generated from example definition: 2025-08-01-preview/UpdateRuns_Get.json func ExampleUpdateRunsClient_Get_getsAnUpdateRunResource() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -664,7 +664,7 @@ func ExampleUpdateRunsClient_Get_getsAnUpdateRunResource() { // } } -// Generated from example definition: 2025-04-01-preview/UpdateRuns_Get_MaximumSet_Gen.json +// Generated from example definition: 2025-08-01-preview/UpdateRuns_Get_MaximumSet_Gen.json func ExampleUpdateRunsClient_Get_getsAnUpdateRunResourceGeneratedByMaximumSetRule() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -857,7 +857,7 @@ func ExampleUpdateRunsClient_Get_getsAnUpdateRunResourceGeneratedByMaximumSetRul // } } -// Generated from example definition: 2025-04-01-preview/UpdateRuns_ListByFleet.json +// Generated from example definition: 2025-08-01-preview/UpdateRuns_ListByFleet.json func ExampleUpdateRunsClient_NewListByFleetPager_listsTheUpdateRunResourcesByFleet() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1021,7 +1021,7 @@ func ExampleUpdateRunsClient_NewListByFleetPager_listsTheUpdateRunResourcesByFle } } -// Generated from example definition: 2025-04-01-preview/UpdateRuns_ListByFleet_MaximumSet_Gen.json +// Generated from example definition: 2025-08-01-preview/UpdateRuns_ListByFleet_MaximumSet_Gen.json func ExampleUpdateRunsClient_NewListByFleetPager_listsTheUpdateRunResourcesByFleetGeneratedByMaximumSetRule() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1224,7 +1224,7 @@ func ExampleUpdateRunsClient_NewListByFleetPager_listsTheUpdateRunResourcesByFle } } -// Generated from example definition: 2025-04-01-preview/UpdateRuns_Skip.json +// Generated from example definition: 2025-08-01-preview/UpdateRuns_Skip.json func ExampleUpdateRunsClient_BeginSkip_skipsOneOrMoreMemberGroupStageAfterStageWaitSOfAnUpdateRun() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1358,7 +1358,7 @@ func ExampleUpdateRunsClient_BeginSkip_skipsOneOrMoreMemberGroupStageAfterStageW // } } -// Generated from example definition: 2025-04-01-preview/UpdateRuns_Skip_MaximumSet_Gen.json +// Generated from example definition: 2025-08-01-preview/UpdateRuns_Skip_MaximumSet_Gen.json func ExampleUpdateRunsClient_BeginSkip_skipsOneOrMoreMemberGroupStageAfterStageWaitSOfAnUpdateRunGeneratedByMaximumSetRule() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1567,7 +1567,7 @@ func ExampleUpdateRunsClient_BeginSkip_skipsOneOrMoreMemberGroupStageAfterStageW // } } -// Generated from example definition: 2025-04-01-preview/UpdateRuns_Start.json +// Generated from example definition: 2025-08-01-preview/UpdateRuns_Start.json func ExampleUpdateRunsClient_BeginStart_startsAnUpdateRun() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1671,7 +1671,7 @@ func ExampleUpdateRunsClient_BeginStart_startsAnUpdateRun() { // } } -// Generated from example definition: 2025-04-01-preview/UpdateRuns_Start_MaximumSet_Gen.json +// Generated from example definition: 2025-08-01-preview/UpdateRuns_Start_MaximumSet_Gen.json func ExampleUpdateRunsClient_BeginStart_startsAnUpdateRunGeneratedByMaximumSetRule() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1869,7 +1869,7 @@ func ExampleUpdateRunsClient_BeginStart_startsAnUpdateRunGeneratedByMaximumSetRu // } } -// Generated from example definition: 2025-04-01-preview/UpdateRuns_Stop.json +// Generated from example definition: 2025-08-01-preview/UpdateRuns_Stop.json func ExampleUpdateRunsClient_BeginStop_stopsAnUpdateRun() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1973,7 +1973,7 @@ func ExampleUpdateRunsClient_BeginStop_stopsAnUpdateRun() { // } } -// Generated from example definition: 2025-04-01-preview/UpdateRuns_Stop_MaximumSet_Gen.json +// Generated from example definition: 2025-08-01-preview/UpdateRuns_Stop_MaximumSet_Gen.json func ExampleUpdateRunsClient_BeginStop_stopsAnUpdateRunGeneratedByMaximumSetRule() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/version.go b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/version.go index 18b180366e11..d35525bc7fab 100644 --- a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/version.go +++ b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/version.go @@ -6,5 +6,5 @@ package armcontainerservicefleet const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet" - moduleVersion = "v3.0.0-beta.1" + moduleVersion = "v3.0.0-beta.2" )