Skip to content

Commit

Permalink
Fixing arm deprecations in 0.56 (#29015)
Browse files Browse the repository at this point in the history
* Fixing 0.56 ARM deprecations.

* Fixed apicenter/ApiCenter.Management

* Fixing AzureLargeInstance.Management

* Fixing CodeSigning.Management

* Fixing Fleet.Management

* Fixing ContainerStorage.Management

* Fixing EdgeZone.Management

* Fixing LoadTestService.Management

* Fixing MobilePacketCore

* Fixing MPCNetworkFunction.Management

* Fixing CopilotSettings.Management

* Fixing Extension.Management

* Fixing Sphere.Management

* Fixing vmware/Microsoft.AVS

* Fixing workloads/SAPDiscoverySite

* Revert head change for APICenter.
  • Loading branch information
allenjzhang committed May 8, 2024
1 parent 7a586a9 commit 4f0723b
Show file tree
Hide file tree
Showing 63 changed files with 125 additions and 405 deletions.
3 changes: 1 addition & 2 deletions specification/apicenter/ApiCenter.Management/Api.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import "./Workspace.tsp";

using TypeSpec.Rest;
using Azure.ResourceManager;
using Azure.ResourceManager.Foundations;
using TypeSpec.Http;

namespace Microsoft.ApiCenter;
Expand All @@ -30,7 +29,7 @@ interface Apis {
@doc("Checks if specified API exists.")
@head
head(
...ResourceInstanceParameters<Api, BaseParameters<Api>>,
...ResourceInstanceParameters<Api, Foundations.BaseParameters<Api>>,
): OkResponse | ErrorResponse;
@doc("Creates new or updates existing API.")
createOrUpdate is ArmResourceCreateOrReplaceSync<Api>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import "./ApiVersion.tsp";

using TypeSpec.Rest;
using Azure.ResourceManager;
using Azure.ResourceManager.Foundations;
using TypeSpec.Http;

namespace Microsoft.ApiCenter;
Expand All @@ -30,7 +29,10 @@ interface ApiDefinitions {
@doc("Checks if specified API definition exists.")
@head
head(
...ResourceInstanceParameters<ApiDefinition, BaseParameters<ApiDefinition>>,
...ResourceInstanceParameters<
ApiDefinition,
Foundations.BaseParameters<ApiDefinition>
>,
): OkResponse | ErrorResponse;
@doc("Creates new or updates existing API definition.")
createOrUpdate is ArmResourceCreateOrReplaceSync<ApiDefinition>;
Expand Down
6 changes: 4 additions & 2 deletions specification/apicenter/ApiCenter.Management/ApiVersion.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import "./Api.tsp";

using TypeSpec.Rest;
using Azure.ResourceManager;
using Azure.ResourceManager.Foundations;
using TypeSpec.Http;

namespace Microsoft.ApiCenter;
Expand All @@ -30,7 +29,10 @@ interface ApiVersions {
@doc("Checks if specified API version exists.")
@head
head(
...ResourceInstanceParameters<ApiVersion, BaseParameters<ApiVersion>>,
...ResourceInstanceParameters<
ApiVersion,
Foundations.BaseParameters<ApiVersion>
>,
): OkResponse | ErrorResponse;
@doc("Creates new or updates existing API version.")
createOrUpdate is ArmResourceCreateOrReplaceSync<ApiVersion>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import "./Service.tsp";
using TypeSpec.Rest;
using TypeSpec.Versioning;
using Azure.ResourceManager;
using Azure.ResourceManager.Foundations;
using TypeSpec.Http;

namespace Microsoft.ApiCenter;
Expand Down
6 changes: 4 additions & 2 deletions specification/apicenter/ApiCenter.Management/Deployment.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import "./Api.tsp";

using TypeSpec.Rest;
using Azure.ResourceManager;
using Azure.ResourceManager.Foundations;
using TypeSpec.Http;

namespace Microsoft.ApiCenter;
Expand All @@ -30,7 +29,10 @@ interface Deployments {
@doc("Checks if specified API deployment exists.")
@head
head(
...ResourceInstanceParameters<Deployment, BaseParameters<Deployment>>,
...ResourceInstanceParameters<
Deployment,
Foundations.BaseParameters<Deployment>
>,
): OkResponse | ErrorResponse;
@doc("Creates new or updates existing API deployment.")
createOrUpdate is ArmResourceCreateOrReplaceSync<Deployment>;
Expand Down
6 changes: 4 additions & 2 deletions specification/apicenter/ApiCenter.Management/Environment.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import "./Workspace.tsp";

using TypeSpec.Rest;
using Azure.ResourceManager;
using Azure.ResourceManager.Foundations;
using TypeSpec.Http;

namespace Microsoft.ApiCenter;
Expand All @@ -30,7 +29,10 @@ interface Environments {
@doc("Checks if specified environment exists.")
@head
head(
...ResourceInstanceParameters<Environment, BaseParameters<Environment>>,
...ResourceInstanceParameters<
Environment,
Foundations.BaseParameters<Environment>
>,
): OkResponse | ErrorResponse;
@doc("Creates new or updates existing environment.")
createOrUpdate is ArmResourceCreateOrReplaceSync<Environment>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import "./Service.tsp";

using TypeSpec.Rest;
using Azure.ResourceManager;
using Azure.ResourceManager.Foundations;
using TypeSpec.Http;

namespace Microsoft.ApiCenter;
Expand All @@ -32,7 +31,7 @@ interface MetadataSchemas {
head(
...ResourceInstanceParameters<
MetadataSchema,
BaseParameters<MetadataSchema>
Foundations.BaseParameters<MetadataSchema>
>,
): OkResponse | ErrorResponse;
@doc("Creates new or updates existing metadata schema.")
Expand Down
3 changes: 1 addition & 2 deletions specification/apicenter/ApiCenter.Management/Service.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import "./models.tsp";

using TypeSpec.Rest;
using Azure.ResourceManager;
using Azure.ResourceManager.Foundations;
using TypeSpec.Http;

namespace Microsoft.ApiCenter;
Expand All @@ -20,7 +19,7 @@ model Service is TrackedResource<ServiceProperties> {
@segment("services")
name: string;

...Azure.ResourceManager.ManagedServiceIdentity;
...ManagedServiceIdentityProperty;
}

@armResourceOperations
Expand Down
6 changes: 4 additions & 2 deletions specification/apicenter/ApiCenter.Management/Workspace.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import "./Service.tsp";

using TypeSpec.Rest;
using Azure.ResourceManager;
using Azure.ResourceManager.Foundations;
using TypeSpec.Http;

namespace Microsoft.ApiCenter;
Expand All @@ -30,7 +29,10 @@ interface Workspaces {
@doc("Checks if specified workspace exists.")
@head
head(
...ResourceInstanceParameters<Workspace, BaseParameters<Workspace>>,
...ResourceInstanceParameters<
Workspace,
Foundations.BaseParameters<Workspace>
>,
): OkResponse | ErrorResponse;
@doc("Creates new or updates existing workspace.")
createOrUpdate is ArmResourceCreateOrReplaceSync<Workspace>;
Expand Down
11 changes: 5 additions & 6 deletions specification/apicenter/ApiCenter.Management/main.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import "./Environment.tsp";
using TypeSpec.Rest;
using TypeSpec.Http;
using Azure.ResourceManager.Foundations;
using Azure.Core;
using Azure.ResourceManager;
using TypeSpec.Versioning;
using Azure.ClientGenerator.Core;
Expand Down Expand Up @@ -130,7 +129,7 @@ enum Versions {
@segmentOf(TResource)
@armResourceList(TResource)
op ArmResourceListByParent<
TResource extends ArmResource,
TResource extends Azure.ResourceManager.Foundations.Resource,
TBaseParameters = BaseParameters<TResource>,
TParentName extends valueof string = "",
TParentFriendlyName extends valueof string = ""
Expand All @@ -151,7 +150,7 @@ op ArmResourceListByParent<
@get
@armResourceRead(TResource)
op ArmResourceRead<
TResource extends ArmResource,
TResource extends Foundations.Resource,
TBaseParameters = BaseParameters<TResource>
>(
...ResourceInstanceParameters<TResource, TBaseParameters>,
Expand All @@ -169,7 +168,7 @@ op ArmResourceRead<
@armResourceCreateOrUpdate(TResource)
@put
op ArmResourceCreateOrReplaceSync<
TResource extends ArmResource,
TResource extends Foundations.Resource,
TBaseParameters = BaseParameters<TResource>
>(
...ResourceInstanceParameters<TResource, TBaseParameters>,
Expand All @@ -180,14 +179,14 @@ op ArmResourceCreateOrReplaceSync<
): ArmResourceUpdatedResponseWithEtag<TResource> | ArmResourceCreatedSyncResponseWithEtag<TResource> | ErrorResponse;

@doc("Resource '{name}' create operation succeeded", TResource)
model ArmResourceCreatedSyncResponseWithEtag<TResource extends Azure.ResourceManager.Foundations.ArmResource>
model ArmResourceCreatedSyncResponseWithEtag<TResource extends Foundations.Resource>
is Body<TResource> {
...CreatedResponse;
...Azure.Core.EtagResponseEnvelope;
}

@doc("Resource '{name}' update operation succeeded", TResource)
model ArmResourceUpdatedResponseWithEtag<TResource extends Azure.ResourceManager.Foundations.ArmResource>
model ArmResourceUpdatedResponseWithEtag<TResource extends Foundations.Resource>
is ArmResponseWithEtag<TResource>;

@doc("Azure operation completed successfully.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import "./models.tsp";

using TypeSpec.Rest;
using Azure.ResourceManager;
using Azure.ResourceManager.Foundations;
using TypeSpec.Http;
using Azure.ClientGenerator.Core;

Expand Down Expand Up @@ -52,10 +51,10 @@ operations returns various properties of each Azure Large Instance.
listBySubscription is ArmListBySubscription<AzureLargeInstance>;

@doc("The operation to start an Azure Large Instance (only for compute instances)")
start is ArmResourceActionNoBody<
start is ArmResourceActionAsync<
AzureLargeInstance,
{},
OperationStatusResult
void,
Foundations.OperationStatusResult
>;

@doc("The operation to restart an Azure Large Instance (only for compute instances)")
Expand All @@ -65,14 +64,14 @@ operations returns various properties of each Azure Large Instance.
/** When set to 'active', this parameter empowers the server with the ability to forcefully terminate and halt any existing processes that may be running on the server */
@bodyRoot forceParameter?: ForceState;
},
OperationStatusResult
Foundations.OperationStatusResult
>;

@doc("The operation to shutdown an Azure Large Instance (only for compute instances)")
shutdown is ArmResourceActionNoBody<
shutdown is ArmResourceActionAsync<
AzureLargeInstance,
{},
OperationStatusResult
void,
Foundations.OperationStatusResult
>;
}

Expand All @@ -95,7 +94,7 @@ operations returns various properties of each Azure Large Instance.
@armResourceAction(TResource)
@post
op ArmResourceActionNoBody<
TResource extends Azure.ResourceManager.Foundations.ArmResource,
TResource extends Azure.ResourceManager.Foundations.Resource,
TRequest extends TypeSpec.Reflection.Model,
TResponse extends TypeSpec.Reflection.Model | void,
TBaseParameters extends TypeSpec.Reflection.Model = Azure.ResourceManager.Foundations.BaseParameters<AzureLargeInstance>
Expand All @@ -108,3 +107,8 @@ op ArmResourceActionNoBody<
"application/json",
"tagsParameter"
);

// model ForceParameter {
// /** When set to 'active', this parameter empowers the server with the ability to forcefully terminate and halt any existing processes that may be running on the server */
// forceParameter?: ForceState;
// }
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import "./models.tsp";

using TypeSpec.Rest;
using Azure.ResourceManager;
using Azure.ResourceManager.Foundations;
using TypeSpec.Http;
using Azure.ClientGenerator.Core;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@
],
"responses": {
"200": {
"description": "The request has succeeded.",
"description": "Azure operation completed successfully.",
"schema": {
"$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/OperationStatusResult"
}
Expand Down Expand Up @@ -478,7 +478,7 @@
],
"responses": {
"200": {
"description": "The request has succeeded.",
"description": "Azure operation completed successfully.",
"schema": {
"$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/OperationStatusResult"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import "./CodeSigningAccount.tsp";

using TypeSpec.Rest;
using Azure.ResourceManager;
using Azure.ResourceManager.Foundations;
using TypeSpec.Http;
using TypeSpec.OpenAPI;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import "./models.tsp";

using TypeSpec.Rest;
using Azure.ResourceManager;
using Azure.ResourceManager.Foundations;
using TypeSpec.Http;
using TypeSpec.OpenAPI;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ model CommunityTraining is TrackedResource<CommunityTrainingProperties> {
@path
name: string;

...ResourceSku;
...ResourceSkuProperty;
}

@doc("The status of the current operation.")
Expand Down

0 comments on commit 4f0723b

Please sign in to comment.