Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding New GA Version #26953

Merged
merged 16 commits into from
Jan 10, 2024
42 changes: 41 additions & 1 deletion specification/sphere/Sphere.Management/catalog.tsp
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import "@typespec/rest";
import "@typespec/openapi";
import "@typespec/versioning";
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";

using TypeSpec.Http;
using TypeSpec.OpenAPI;
using TypeSpec.Rest;
using TypeSpec.Versioning;
using Azure.ResourceManager.Foundations;
Expand All @@ -25,6 +27,11 @@ model Catalog is TrackedResource<CatalogProperties> {

@doc("Catalog properties")
model CatalogProperties {
@visibility("read")
@doc("The Azure Sphere tenant ID associated with the catalog.")
@added(Microsoft.AzureSphere.Versions.v2024_04_01)
tenantId?: string;

@visibility("read")
@doc("The status of the last operation.")
provisioningState?: ProvisioningState;
Expand Down Expand Up @@ -68,14 +75,28 @@ interface Catalogs
Catalog,
CatalogProperties
> {
@removed(Versions.v2024_04_01)
@autoRoute
@doc("Counts devices in catalog.")
@armResourceAction(Catalog)
@action("countDevices")
@renamedFrom(Versions.v2024_04_01, "countDevices")
@post
countDevices(
deprecated(
...ResourceInstanceParameters<Catalog>,
): ArmResponse<CountDeviceResponse> | ErrorResponse;

#suppress "@azure-tools/typespec-providerhub/non-breaking-versioning" "preview api"
@added(Versions.v2024_04_01)
@sharedRoute
@autoRoute
@doc("Counts devices in catalog.")
@armResourceAction(Catalog)
@post
countDevices(
...ResourceInstanceParameters<Catalog>,
): ArmResponse<CountDevicesResponse> | ErrorResponse;

@autoRoute
@doc("Lists device insights for catalog.")
@armResourceAction(Catalog)
Expand Down Expand Up @@ -115,4 +136,23 @@ interface Catalogs
@body
listDeviceGroupsRequest: ListDeviceGroupsRequest,
): ArmResponse<ResourceListResult<DeviceGroup>> | ErrorResponse;

@autoRoute
@armResourceAction(Catalog)
@added(Versions.v2024_04_01)
@doc("Creates an image. Use this action when the image ID is unknown.")
@extension("x-ms-long-running-operation", true)
@extension(
"x-ms-long-running-operation-options",
{
`final-state-via`: "location",
}
)
uploadImage(
...ResourceInstanceParameters<Catalog>,

@doc("Image upload request body.")
@body
uploadImageRequest: Image,
): ArmAcceptedLroResponse | ErrorResponse;
}
6 changes: 5 additions & 1 deletion specification/sphere/Sphere.Management/common.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ interface Operations extends Azure.ResourceManager.Operations {}

// Common models
/** Provisioning state of the resource. */
@doc("Provisioning state of resource.")
@lroStatus
enum ProvisioningState {
...ResourceProvisioningState,
Expand Down Expand Up @@ -103,9 +104,12 @@ alias StandardListQueryParametersWithCorrectNames = {
...CustomMaxPageSizeQueryParameter;
};

@doc("Response to the action call for count devices in a catalog.")
@doc("Response to the action call for count devices in a catalog (preview API).")
model CountDeviceResponse extends CountElementsResponse {}

@doc("Response to the action call for count devices in a catalog.")
model CountDevicesResponse extends CountElementsResponse {}

@doc("Response of the count for elements.")
model CountElementsResponse {
@doc("Number of children resources in parent resource.")
Expand Down
27 changes: 26 additions & 1 deletion specification/sphere/Sphere.Management/device.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ interface ProxyResourceOperationsDevice<
@armResourceOperations
interface Devices extends ProxyResourceOperationsDevice<Device> {
@autoRoute
@removed(Versions.v2024_04_01)
@renamedFrom(Versions.v2024_04_01, "generateCapabilityImage")
@armResourceAction(Device)
@action("generateCapabilityImage")
@post
@doc("Generates the capability image for the device. Use '.unassigned' or '.default' for the device group and product names to generate the image for a device that does not belong to a specific device group and product.")
@extension("x-ms-long-running-operation", true)
Expand All @@ -57,13 +60,35 @@ interface Devices extends ProxyResourceOperationsDevice<Device> {
`final-state-via`: "location",
}
)
generateCapabilityImage(
deprecatedGenerateCapabilityImage(
...ResourceInstanceParameters<Device>,

@doc("Generate capability image request body.")
@body
generateDeviceCapabilityRequest: GenerateCapabilityImageRequest,
): ArmResponse<SignedCapabilityImageResponse> | ArmAcceptedResponse | ErrorResponse;

#suppress "@azure-tools/typespec-providerhub/non-breaking-versioning" "preview api"
@autoRoute
@sharedRoute
@added(Versions.v2024_04_01)
@armResourceAction(Device)
@post
@doc("Generates the capability image for the device. Use '.unassigned' or '.default' for the device group and product names to generate the image for a device that does not belong to a specific device group and product.")
@extension("x-ms-long-running-operation", true)
@extension(
"x-ms-long-running-operation-options",
{
`final-state-via`: "location",
}
)
generateCapabilityImage(
...ResourceInstanceParameters<Device>,

@doc("Generate capability image request body.")
@body
generateDeviceCapabilityRequest: GenerateCapabilityImageRequest,
): ArmResponse<SignedCapabilityImageResponse> | ArmAcceptedLroResponse | ErrorResponse;
}

@doc("The properties of device")
Expand Down
43 changes: 41 additions & 2 deletions specification/sphere/Sphere.Management/deviceGroup.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,33 @@ interface DeviceGroups
DeviceGroup,
ListQueryParameters
> {
@doc("Counts devices in device group. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name.")
@removed(Versions.v2024_04_01)
@autoRoute
@renamedFrom(Versions.v2024_04_01, "countDevices")
@armResourceAction(DeviceGroup)
@action("countDevices")
@post
deprecatedCountDevices(
...ResourceInstanceParameters<DeviceGroup>,
): ArmResponse<CountDeviceResponse> | ErrorResponse;

#suppress "@azure-tools/typespec-providerhub/non-breaking-versioning" "preview api"
@doc("Counts devices in device group. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name.")
@added(Versions.v2024_04_01)
@autoRoute
@sharedRoute
@armResourceAction(DeviceGroup)
@post
countDevices(
...ResourceInstanceParameters<DeviceGroup>,
): ArmResponse<CountDeviceResponse> | ErrorResponse;
): ArmResponse<CountDevicesResponse> | ErrorResponse;

@autoRoute
@armResourceAction(DeviceGroup)
@action("claimDevices")
@removed(Versions.v2024_04_01)
@renamedFrom(Versions.v2024_04_01, "claimDevices")
@doc("Bulk claims the devices. Use '.unassigned' or '.default' for the device group and product names when bulk claiming devices to a catalog only.")
@extension("x-ms-long-running-operation", true)
@extension(
Expand All @@ -69,13 +86,35 @@ interface DeviceGroups
}
)
@post
claimDevices(
deprecatedClaimDevices(
...ResourceInstanceParameters<DeviceGroup>,

@doc("Bulk claim devices request body.")
@body
claimDevicesRequest: ClaimDevicesRequest,
): ArmAcceptedResponse | ErrorResponse;

#suppress "@azure-tools/typespec-providerhub/non-breaking-versioning" "preview api"
@autoRoute
@sharedRoute
@added(Versions.v2024_04_01)
@armResourceAction(DeviceGroup)
@doc("Bulk claims the devices. Use '.unassigned' or '.default' for the device group and product names when bulk claiming devices to a catalog only.")
@extension("x-ms-long-running-operation", true)
@extension(
"x-ms-long-running-operation-options",
{
`final-state-via`: "location",
}
)
@post
claimDevices(
...ResourceInstanceParameters<DeviceGroup>,

@doc("Bulk claim devices request body.")
@body
claimDevicesRequest: ClaimDevicesRequest,
): ArmAcceptedLroResponse | ErrorResponse;
}

@doc("The properties of deviceGroup")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"resourceGroupName": "MyResourceGroup1",
"catalogName": "MyCatalog1",
"imageName": "imageID",
"imageName": "00000000-0000-0000-0000-000000000000",
"api-version": "2022-09-01-preview"
},
"responses": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"resourceGroupName": "MyResourceGroup1",
"catalogName": "MyCatalog1",
"imageName": "myImageId",
"imageName": "00000000-0000-0000-0000-000000000000",
"api-version": "2022-09-01-preview"
},
"responses": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"resourceGroupName": "MyResourceGroup1",
"catalogName": "MyCatalog1",
"imageName": "default",
"imageName": ".default",
"resource": {
"properties": {
"image": "bXliYXNlNjRzdHJpbmc="
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"operationId": "Catalogs_Delete",
"title": "Catalogs_Delete",
"parameters": {
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"resourceGroupName": "MyResourceGroup1",
"catalogName": "MyCatalog1",
"api-version": "2024-04-01"
},
"responses": {
"200": {
"description": "Resource deleted successfully."
},
"202": {
"description": "Resource deletion accepted.",
"headers": {
"Azure-AsyncOperation": "https://foo.com/operationstatus"
}
},
"204": {
"description": "Resource deleted successfully."
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"operationId": "Deployments_Delete",
"title": "Deployments_Delete",
"parameters": {
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"resourceGroupName": "MyResourceGroup1",
"catalogName": "MyCatalog1",
"productName": "MyProductName1",
"deviceGroupName": "DeviceGroupName1",
"deploymentName": "MyDeploymentName1",
"api-version": "2024-04-01"
},
"responses": {
"200": {
"description": "Resource deleted successfully."
},
"202": {
"description": "Resource deletion accepted.",
"headers": {
"Azure-AsyncOperation": "https://foo.com/operationstatus"
}
},
"204": {
"description": "Resource deleted successfully."
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"operationId": "Devices_Delete",
"title": "Devices_Delete",
"parameters": {
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"resourceGroupName": "MyResourceGroup1",
"catalogName": "MyCatalog1",
"productName": "MyProductName1",
"deviceGroupName": "DeviceGroupName1",
"deviceName": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"api-version": "2024-04-01"
},
"responses": {
"200": {
"description": "Resource deleted successfully."
},
"202": {
"description": "Resource deletion accepted.",
"headers": {
"Azure-AsyncOperation": "https://foo.com/operationstatus"
}
},
"204": {
"description": "Resource deleted successfully."
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"operationId": "DeviceGroups_Delete",
"title": "DeviceGroups_Delete",
"parameters": {
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"resourceGroupName": "MyResourceGroup1",
"catalogName": "MyCatalog1",
"productName": "MyProduct1",
"deviceGroupName": "MyDeviceGroup1",
"api-version": "2024-04-01"
},
"responses": {
"200": {
"description": "Resource deleted successfully."
},
"202": {
"description": "Resource deletion accepted.",
"headers": {
"Azure-AsyncOperation": "https://foo.com/operationstatus"
}
},
"204": {
"description": "Resource deleted successfully."
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"operationId": "Images_Delete",
"title": "Images_Delete",
"parameters": {
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"resourceGroupName": "MyResourceGroup1",
"catalogName": "MyCatalog1",
"imageName": "00000000-0000-0000-0000-000000000000",
"api-version": "2024-04-01"
},
"responses": {
"200": {
"description": "Resource deleted successfully."
},
"202": {
"description": "Resource deletion accepted.",
"headers": {
"Azure-AsyncOperation": "https://foo.com/operationstatus"
}
},
"204": {
"description": "Resource deleted successfully."
}
}
}
Loading