Skip to content

Commit

Permalink
Prepare the api for ARM
Browse files Browse the repository at this point in the history
Move swagger to subfolder and create autorest
config readme files.

The folder structure is selected to match the
structure of the azure repository.
  • Loading branch information
petrkotas committed May 29, 2024
1 parent 87bbe9f commit 5f3c381
Show file tree
Hide file tree
Showing 56 changed files with 764 additions and 375 deletions.
2 changes: 1 addition & 1 deletion api/autorest-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
input-file: redhatopenshift/resource-manager/Microsoft.RedHatOpenshift/preview/2024-06-10-preview/openapi.json
input-file: redhatopenshift/resource-manager/Microsoft.RedHatOpenshift/hcpclusters/preview/2024-06-10-preview/openapi.json
use:
# TODO: This is an old version. We should fix incompatibilities and remove this later
- "@autorest/[email protected]"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"title": "HcpClusterVersionOperations_ListByLocation_Maximum",
"operationId": "HcpClusterVersionOperations_ListByLocation",
"title": "HcpClusterVersions_ListByLocation_Maximum",
"operationId": "HcpClusterVersions_ListByLocation",
"parameters": {
"api-version": "2024-06-10-preview",
"subscriptionId": "FDEA43EA-0230-4A7D-BDEE-F3AFF2183B1D",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"title": "HcpClusterVersionOperations_ListByLocation_Minimum",
"operationId": "HcpClusterVersionOperations_ListByLocation",
"title": "HcpClusterVersions_ListByLocation_Minimum",
"operationId": "HcpClusterVersions_ListByLocation",
"parameters": {
"api-version": "2024-06-10-preview",
"subscriptionId": "FDEA43EA-0230-4A7D-BDEE-F3AFF2183B1D",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"api-version": "2024-06-10-preview",
"subscriptionId": "FDEA43EA-0230-4A7D-BDEE-F3AFF2183B1D",
"resourceGroupName": "rgopenapi",
"hcpOpenShiftClusterName": "Replace this value with a string matching RegExp ^[a-zA-Z0-9-]{3,24}$"
"hcpOpenShiftClusterName": "hcpCluster-name"
},
"responses": {
"200": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"api-version": "2024-06-10-preview",
"subscriptionId": "FDEA43EA-0230-4A7D-BDEE-F3AFF2183B1D",
"resourceGroupName": "rgopenapi",
"hcpOpenShiftClusterName": "Replace this value with a string matching RegExp ^[a-zA-Z0-9-]{3,24}$",
"hcpOpenShiftClusterName": "hcpCluster-name",
"resource": {
"properties": {
"spec": {
Expand Down Expand Up @@ -152,13 +152,13 @@
}
},
"identity": {
"principalId": "xlswu",
"tenantId": "xfqisd",
"principalId": "00000000-0000-0000-0000-000000000000",
"tenantId": "00000000-0000-0000-0000-000000000000",
"type": "None",
"userAssignedIdentities": {
"key4794": {
"principalId": "uctdckatfraombzrbkdltewc",
"clientId": "auud"
"principalId": "00000000-0000-0000-0000-000000000000",
"clientId": "00000000-0000-0000-0000-000000000000"
}
}
},
Expand Down Expand Up @@ -268,13 +268,13 @@
}
},
"identity": {
"principalId": "xlswu",
"tenantId": "xfqisd",
"principalId": "00000000-0000-0000-0000-000000000000",
"tenantId": "00000000-0000-0000-0000-000000000000",
"type": "None",
"userAssignedIdentities": {
"key4794": {
"principalId": "uctdckatfraombzrbkdltewc",
"clientId": "auud"
"principalId": "00000000-0000-0000-0000-000000000000",
"clientId": "00000000-0000-0000-0000-000000000000"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"api-version": "2024-06-10-preview",
"subscriptionId": "FDEA43EA-0230-4A7D-BDEE-F3AFF2183B1D",
"resourceGroupName": "rgopenapi",
"hcpOpenShiftClusterName": "Replace this value with a string matching RegExp ^[a-zA-Z0-9-]{3,24}$"
"hcpOpenShiftClusterName": "hcpCluster-name"
},
"responses": {
"202": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"api-version": "2024-06-10-preview",
"subscriptionId": "FDEA43EA-0230-4A7D-BDEE-F3AFF2183B1D",
"resourceGroupName": "rgopenapi",
"hcpOpenShiftClusterName": "Replace this value with a string matching RegExp ^[a-zA-Z0-9-]{3,24}$"
"hcpOpenShiftClusterName": "hcpCluster-name"
},
"responses": {
"200": {
Expand Down Expand Up @@ -94,13 +94,13 @@
}
},
"identity": {
"principalId": "xlswu",
"tenantId": "xfqisd",
"principalId": "00000000-0000-0000-0000-000000000000",
"tenantId": "00000000-0000-0000-0000-000000000000",
"type": "None",
"userAssignedIdentities": {
"key4794": {
"principalId": "uctdckatfraombzrbkdltewc",
"clientId": "auud"
"principalId": "00000000-0000-0000-0000-000000000000",
"clientId": "00000000-0000-0000-0000-000000000000"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"api-version": "2024-06-10-preview",
"subscriptionId": "FDEA43EA-0230-4A7D-BDEE-F3AFF2183B1D",
"resourceGroupName": "rgopenapi",
"hcpOpenShiftClusterName": "Replace this value with a string matching RegExp ^[a-zA-Z0-9-]{3,24}$"
"hcpOpenShiftClusterName": "hcpCluster-name"
},
"responses": {
"200": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,13 @@
}
},
"identity": {
"principalId": "xlswu",
"tenantId": "xfqisd",
"principalId": "00000000-0000-0000-0000-000000000000",
"tenantId": "00000000-0000-0000-0000-000000000000",
"type": "None",
"userAssignedIdentities": {
"key4794": {
"principalId": "uctdckatfraombzrbkdltewc",
"clientId": "auud"
"principalId": "00000000-0000-0000-0000-000000000000",
"clientId": "00000000-0000-0000-0000-000000000000"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@
}
},
"identity": {
"principalId": "xlswu",
"tenantId": "xfqisd",
"principalId": "00000000-0000-0000-0000-000000000000",
"tenantId": "00000000-0000-0000-0000-000000000000",
"type": "None",
"userAssignedIdentities": {
"key4794": {
"principalId": "uctdckatfraombzrbkdltewc",
"clientId": "auud"
"principalId": "00000000-0000-0000-0000-000000000000",
"clientId": "00000000-0000-0000-0000-000000000000"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"api-version": "2024-06-10-preview",
"subscriptionId": "FDEA43EA-0230-4A7D-BDEE-F3AFF2183B1D",
"resourceGroupName": "rgopenapi",
"hcpOpenShiftClusterName": "Replace this value with a string matching RegExp ^[a-zA-Z0-9-]{3,24}$",
"hcpOpenShiftClusterName": "hcpCluster-name",
"properties": {
"identity": {
"type": "None",
Expand Down Expand Up @@ -120,13 +120,13 @@
}
},
"identity": {
"principalId": "xlswu",
"tenantId": "xfqisd",
"principalId": "00000000-0000-0000-0000-000000000000",
"tenantId": "00000000-0000-0000-0000-000000000000",
"type": "None",
"userAssignedIdentities": {
"key4794": {
"principalId": "uctdckatfraombzrbkdltewc",
"clientId": "auud"
"principalId": "00000000-0000-0000-0000-000000000000",
"clientId": "00000000-0000-0000-0000-000000000000"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"api-version": "2024-06-10-preview",
"subscriptionId": "F64FF5E2-2AD0-4E4D-A9D5-6E88511247A7",
"resourceGroupName": "rgopenapi",
"hcpOpenShiftClusterName": "Replace this value with a string matching RegExp ^[a-zA-Z0-9-]{3,24}$",
"nodePoolName": "Replace this value with a string matching RegExp ^[a-zA-Z0-9-]{3,24}$",
"hcpOpenShiftClusterName": "hcpCluster-name",
"nodePoolName": "nodePool-name",
"resource": {
"properties": {
"spec": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"api-version": "2024-06-10-preview",
"subscriptionId": "F64FF5E2-2AD0-4E4D-A9D5-6E88511247A7",
"resourceGroupName": "rgopenapi",
"hcpOpenShiftClusterName": "Replace this value with a string matching RegExp ^[a-zA-Z0-9-]{3,24}$",
"nodePoolName": "Replace this value with a string matching RegExp ^[a-zA-Z0-9-]{3,24}$"
"hcpOpenShiftClusterName": "hcpCluster-name",
"nodePoolName": "nodePool-name"
},
"responses": {
"202": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"api-version": "2024-06-10-preview",
"subscriptionId": "F64FF5E2-2AD0-4E4D-A9D5-6E88511247A7",
"resourceGroupName": "rgopenapi",
"hcpOpenShiftClusterName": "Replace this value with a string matching RegExp ^[a-zA-Z0-9-]{3,24}$",
"nodePoolName": "Replace this value with a string matching RegExp ^[a-zA-Z0-9-]{3,24}$"
"hcpOpenShiftClusterName": "hcpCluster-name",
"nodePoolName": "nodepool-name"
},
"responses": {
"200": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"api-version": "2024-06-10-preview",
"subscriptionId": "F64FF5E2-2AD0-4E4D-A9D5-6E88511247A7",
"resourceGroupName": "rgopenapi",
"hcpOpenShiftClusterName": "Replace this value with a string matching RegExp ^[a-zA-Z0-9-]{3,24}$"
"hcpOpenShiftClusterName": "hcpCluster-name"
},
"responses": {
"200": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"api-version": "2024-06-10-preview",
"subscriptionId": "F64FF5E2-2AD0-4E4D-A9D5-6E88511247A7",
"resourceGroupName": "rgopenapi",
"hcpOpenShiftClusterName": "Replace this value with a string matching RegExp ^[a-zA-Z0-9-]{3,24}$",
"nodePoolName": "Replace this value with a string matching RegExp ^[a-zA-Z0-9-]{3,24}$",
"hcpOpenShiftClusterName": "hcpCluster-name",
"nodePoolName": "nodePool-name",
"properties": {
"tags": {
"key3313": "aciaohrpspozhrvwvbdtpqliezchbn"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"actionType": "Internal"
}
],
"nextLink": "mmxaxttmjsusvyx"
"nextLink": "https://microsoft.com/a"
}
}
}
Expand Down
18 changes: 9 additions & 9 deletions api/redhatopenshift/HcpCluster/hcpCluster-models.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ using TypeSpec.Http;
using Azure.Core;
using Azure.ResourceManager;

namespace Microsoft.RedHatOpenshift;
namespace Microsoft.RedHatOpenShift;

/*
* ===================================
Expand Down Expand Up @@ -56,9 +56,9 @@ model HcpOpenShiftClusterProperties {
@visibility("read")
provisioningState?: ProvisioningState;

/** The cluster resouce specification. */
/** The cluster resource specification. */
@visibility("create", "update")
spec: ClusterSpec;
spec?: ClusterSpec;
}

/** The cluster resource specification */
Expand Down Expand Up @@ -104,7 +104,7 @@ model ClusterSpec {

/** Azure platform configuration */
@visibility("create")
platform: PlatformProfile;
platform?: PlatformProfile;

/** URL for the OIDC provider to be used for authentication
* to authenticate against user Azure cloud account
Expand Down Expand Up @@ -370,10 +370,10 @@ model TokenClaimMappingsProfile {

/** External auth claim profile */
model ClaimProfile {
/** Claim */
/** Claim name of the external profile */
claim: string;

/** Prefix */
/** Prefix for the claim external profile */
prefix: string;

/** Prefix policy */
Expand All @@ -382,7 +382,7 @@ model ClaimProfile {

/** External auth claim validation rule */
model TokenClaimValidationRuleProfile {
/** Claim */
/** Claim name for the validation profile */
claim: string;

/** Required value */
Expand Down Expand Up @@ -489,7 +489,7 @@ model NodePoolSpec {
@visibility("create", "update")
replicas?: int32;

/** Autorepair */
/** Auto-repair */
@visibility("create")
autoRepair?: boolean = false;

Expand Down Expand Up @@ -572,7 +572,7 @@ model NodePoolPlatformProfile {
/** Whether the worker machines should be encrypted at host */
encryptionAtHost?: boolean;

/** Disk Encryption Set ID that will be used for ecnryption the Nodes disks
/** Disk Encryption Set ID that will be used for encryption the Nodes disks
* - https://learn.microsoft.com/en-us/azure/virtual-machines/disk-encryption-overview
* - https://learn.microsoft.com/en-us/azure/virtual-machines/disk-encryption
*/
Expand Down
6 changes: 2 additions & 4 deletions api/redhatopenshift/HcpCluster/hcpCluster.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ using TypeSpec.Http;
using Azure.Core;
using Azure.ResourceManager;

namespace Microsoft.RedHatOpenshift;

interface Operations extends Azure.ResourceManager.Operations {}
namespace Microsoft.RedHatOpenShift;

/** HCP cluster operations */
@armResourceOperations(HcpOpenShiftClusterResource)
Expand Down Expand Up @@ -51,7 +49,7 @@ interface NodePools {
createOrUpdate is ArmResourceCreateOrReplaceAsync<HcpOpenShiftClusterNodePoolResource>;
update is ArmResourcePatchAsync<
HcpOpenShiftClusterNodePoolResource,
NodePoolSpec
NodePoolProperties
>;
delete is ArmResourceDeleteWithoutOkAsync<HcpOpenShiftClusterNodePoolResource>;
listByParent is ArmResourceListByParent<HcpOpenShiftClusterNodePoolResource>;
Expand Down
11 changes: 6 additions & 5 deletions api/redhatopenshift/HcpCluster/hcpVersions.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ using TypeSpec.Http;
using Azure.Core;
using Azure.ResourceManager;

namespace Microsoft.RedHatOpenshift;
namespace Microsoft.RedHatOpenShift;

/** HcpOpenShiftVersions represents a location based available HCP cluster versions */
@locationResource
model HcpOpenShiftVersions is ProxyResource<HcpOpenShiftVersionsProperties> {
model HcpOpenShiftVersionResource
is ProxyResource<HcpOpenShiftVersionsProperties> {
/** The name of the resource */
@pattern("^[a-zA-Z0-9-]{3,24}$")
@segment("hcpOpenShiftVersions")
Expand All @@ -31,7 +32,7 @@ model HcpOpenShiftVersionsProperties {
clusterVersion: string;
}

@armResourceOperations(HcpOpenShiftVersions)
interface HcpClusterVersionOperations {
list is ArmResourceListByParent<HcpOpenShiftVersions>;
@armResourceOperations(HcpOpenShiftVersionResource)
interface HcpClusterVersions {
list is ArmResourceListByParent<HcpOpenShiftVersionResource>;
}
11 changes: 4 additions & 7 deletions api/redhatopenshift/HcpCluster/main.tsp
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
import "@typespec/http";
import "@typespec/rest";
import "@typespec/versioning";
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";

import "./hcpCluster.tsp";
import "./hcpVersions.tsp";

using TypeSpec.Http;
using TypeSpec.Rest;
using TypeSpec.Versioning;
using Azure.Core;
using Azure.ResourceManager;

/** Microsoft.RedHatOpenshift Resource Provider management API. */
@armProviderNamespace
@service({
title: "Microsoft.RedHatOpenshift management service",
})
@versioned(Microsoft.RedHatOpenshift.Versions)
namespace Microsoft.RedHatOpenshift;
@versioned(Microsoft.RedHatOpenShift.Versions)
namespace Microsoft.RedHatOpenShift;

interface Operations extends Azure.ResourceManager.Operations {}

/** The available API versions. */
enum Versions {
Expand Down
Loading

0 comments on commit 5f3c381

Please sign in to comment.