Skip to content

Commit fd14567

Browse files
authored
Update the Nginx Typespec (#36473)
1 parent 457a3dc commit fd14567

File tree

227 files changed

+2591
-527
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

227 files changed

+2591
-527
lines changed

specification/nginx/Nginx.Management/ApiKeys.tsp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ using Rest;
77
using Http;
88
using Azure.ResourceManager;
99

10-
namespace NGINX.NGINXPLUS;
10+
namespace Nginx.NginxPlus;
1111

1212
/**
1313
* API key resource returned by the service.
@@ -44,7 +44,7 @@ model ApiKeyResponseProperties {
4444
/**
4545
* Expiry of the key in UTC date-time format.
4646
*/
47-
endDateTime: string;
47+
endDateTime?: string;
4848
}
4949

5050
/**
@@ -61,7 +61,7 @@ model ApiKeyRequestProperties {
6161
/**
6262
* Expiry of the key in UTC date-time format.
6363
*/
64-
endDateTime: string;
64+
endDateTime?: string;
6565
}
6666

6767
/**

specification/nginx/Nginx.Management/Certificates.tsp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,16 @@ import "@azure-tools/typespec-azure-resource-manager";
66
using Rest;
77
using Azure.ResourceManager;
88

9-
namespace NGINX.NGINXPLUS;
9+
namespace Nginx.NginxPlus;
1010

1111
/** NginxCertificate resource */
1212
@parentResource(NginxDeployment)
1313
model Certificate is ProxyResource<NginxCertificateProperties> {
1414
...ResourceNameParameter<Certificate>;
15+
16+
/** Gets or sets the location. */
17+
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property"
18+
location?: string;
1519
}
1620

1721
/**
@@ -37,7 +41,7 @@ model NginxCertificateProperties {
3741
/**
3842
* The Key Vault secret ID. Example: `https://myvault.vault.azure.net/secrets/mysecret/1234567890abcdef1234567890abcdef`.
3943
*/
40-
keyVaultSecretId?: url;
44+
keyVaultSecretId?: string;
4145

4246
/**
4347
* The SHA1 thumbprint of the certificate.

specification/nginx/Nginx.Management/Configurations.tsp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ using Rest;
77
using Http;
88
using Azure.ResourceManager;
99

10-
namespace NGINX.NGINXPLUS;
10+
namespace Nginx.NginxPlus;
1111

1212
/**
1313
* Represents an Nginx configuration resource.
@@ -160,9 +160,9 @@ model NginxConfigurationRequestProperties {
160160
}
161161

162162
/**
163-
* The request body for creating an analysis for an NGINX configuration.
163+
* The request body for creating an analysis for an Nginx configuration.
164164
*/
165-
@doc("The request body for creating an analysis for an NGINX configuration.")
165+
@doc("The request body for creating an analysis for an Nginx configuration.")
166166
model AnalysisCreate {
167167
/**
168168
* Configuration details for analysis.
@@ -175,7 +175,7 @@ model AnalysisCreate {
175175
*/
176176
model AnalysisConfig {
177177
/**
178-
* The root file of the NGINX config file(s). It must match one of the files' filepath.
178+
* The root file of the Nginx config file(s). It must match one of the files' filepath.
179179
*/
180180
rootFile?: string;
181181

@@ -228,7 +228,7 @@ model AnalysisResultContent {
228228
}
229229

230230
/**
231-
* An error object found during the analysis of an NGINX configuration.
231+
* An error object found during the analysis of an Nginx configuration.
232232
*/
233233
model AnalysisDiagnostic {
234234
/**
@@ -268,7 +268,7 @@ model AnalysisDiagnostic {
268268
}
269269

270270
/**
271-
* A diagnostic is a message associated with an NGINX config. The Analyzer returns diagnostics with a level indicating the importance of the diagnostic with optional category.
271+
* A diagnostic is a message associated with an Nginx config. The Analyzer returns diagnostics with a level indicating the importance of the diagnostic with optional category.
272272
*/
273273
model DiagnosticItem {
274274
/**

specification/nginx/Nginx.Management/NginxDeployments.tsp

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,29 @@ using Rest;
77
using Http;
88
using Azure.ResourceManager;
99

10-
namespace NGINX.NGINXPLUS;
10+
namespace Nginx.NginxPlus;
1111

1212
/**
1313
* Represents an Nginx deployment resource.
1414
*/
15-
model NginxDeployment is TrackedResource<NginxDeploymentProperties> {
15+
#suppress "@azure-tools/typespec-azure-core/no-private-usage"
16+
#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance"
17+
@Azure.ResourceManager.Private.armResourceInternal(NginxDeploymentProperties)
18+
@TypeSpec.Http.Private.includeInapplicableMetadataInPayload(false)
19+
model NginxDeployment extends Foundations.TrackedResource {
1620
/** The name of the Nginx deployment resource. */
1721
@pattern("^([a-z0-9A-Z][a-z0-9A-Z-]{0,28}[a-z0-9A-Z]|[a-z0-9A-Z])$")
18-
@key("nginxDeploymentName")
22+
@key("deploymentName")
1923
@segment("nginxDeployments")
2024
@path
2125
name: string;
2226

2327
...ManagedServiceIdentityProperty;
28+
29+
/** The resource-specific properties for this resource. */
30+
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property"
31+
properties?: NginxDeploymentProperties;
32+
2433
...ResourceSkuProperty;
2534
}
2635

@@ -168,7 +177,7 @@ model NginxDeploymentProperties {
168177
/**
169178
* Whether diagnostics support is enabled.
170179
*/
171-
enableDiagnosticsSupport: boolean;
180+
enableDiagnosticsSupport?: boolean;
172181

173182
/**
174183
* Logging configuration.

specification/nginx/Nginx.Management/WafPolicies.tsp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import "@azure-tools/typespec-azure-resource-manager";
66
using Rest;
77
using Azure.ResourceManager;
88

9-
namespace NGINX.NGINXPLUS;
9+
namespace Nginx.NginxPlus;
1010

1111
/**
1212
* Represents a WAF policy resource under a given Nginx deployment.

specification/nginx/Nginx.Management/client.tsp

Lines changed: 71 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,24 @@ import "./main.tsp";
22
import "@azure-tools/typespec-client-generator-core";
33

44
using Azure.ClientGenerator.Core;
5-
using NGINX.NGINXPLUS;
5+
using Nginx.NginxPlus;
66

7-
@@clientName(NGINX.NGINXPLUS, "NginxManagementClient", "javascript");
8-
9-
// Method name overrides
10-
@@clientName(Configurations.analyze, "analysis", "!csharp");
7+
@@clientName(Nginx.NginxPlus, "NginxManagementClient", "javascript");
118

129
// Model name overrides
13-
@@clientName(Certificate, "NginxCertificate", "!csharp");
14-
@@clientName(ApiKey, "NginxDeploymentApiKeyResponse", "!csharp");
10+
@@clientName(Certificate, "NginxCertificate");
11+
@@clientName(ApiKeyRequestProperties, "NginxDeploymentApiKeyRequestProperties");
12+
1513
@@clientName(ApiKeyResponseProperties,
1614
"NginxDeploymentApiKeyResponseProperties",
1715
"!csharp"
1816
);
17+
@@clientName(ApiKey, "NginxDeploymentApiKeyResponse", "!csharp");
1918
@@clientName(ApiKeyRequest, "NginxDeploymentApiKeyRequest", "!csharp");
20-
@@clientName(ApiKeyRequestProperties,
21-
"NginxDeploymentApiKeyRequestProperties",
22-
"!csharp"
23-
);
19+
@@clientName(AnalysisConfig, "AnalysisCreateConfig", "!csharp");
20+
@@clientName(AnalysisResultContent, "AnalysisResultData", "!csharp");
2421
@@clientName(Configuration, "NginxConfigurationResponse", "!csharp");
22+
@@clientName(DiagnosticLevel, "Level", "!csharp");
2523
@@clientName(NginxConfigurationProtectedFileResult,
2624
"NginxConfigurationProtectedFileResponse",
2725
"!csharp"
@@ -30,9 +28,6 @@ using NGINX.NGINXPLUS;
3028
"NginxConfigurationProtectedFileRequest",
3129
"!csharp"
3230
);
33-
@@clientName(AnalysisConfig, "AnalysisCreateConfig", "!csharp");
34-
@@clientName(AnalysisResultContent, "AnalysisResultData", "!csharp");
35-
@@clientName(DiagnosticLevel, "Level", "!csharp");
3631

3732
// CommonTypes
3833
@@clientName(Azure.ResourceManager.CommonTypes.ManagedServiceIdentity,
@@ -49,7 +44,6 @@ using NGINX.NGINXPLUS;
4944
);
5045
// Sku has many more properties than ResourceSku
5146
@@clientName(Azure.ResourceManager.CommonTypes.Sku, "ResourceSku", "!csharp");
52-
5347
// Anonymous model named by m4
5448
@@clientName(NginxAppProtect,
5549
"NginxDeploymentPropertiesNginxAppProtect",
@@ -75,6 +69,8 @@ using NGINX.NGINXPLUS;
7569
"!csharp"
7670
);
7771

72+
// Method name overrides
73+
@@clientName(Configurations.analyze, "analysis", "!csharp");
7874
// Client name for list operations
7975
@@clientName(NginxDeployments.listBySubscription, "list", "!csharp");
8076
@@clientName(ApiKeys.listByDeployment, "list", "!csharp");
@@ -114,3 +110,63 @@ using NGINX.NGINXPLUS;
114110
"privateIpAllocationMethod",
115111
"java"
116112
);
113+
114+
@@alternateType(Certificate.location, Azure.Core.azureLocation, "csharp");
115+
@@alternateType(NginxNetworkInterfaceConfiguration.subnetId,
116+
Azure.Core.armResourceIdentifier,
117+
"csharp"
118+
);
119+
@@alternateType(NginxPrivateIPAddress.privateIPAddress,
120+
Azure.Core.ipV4Address,
121+
"csharp"
122+
);
123+
@@alternateType(NginxPrivateIPAddress.subnetId,
124+
Azure.Core.armResourceIdentifier,
125+
"csharp"
126+
);
127+
@@alternateType(NginxCertificateProperties.keyVaultSecretCreated,
128+
utcDateTime,
129+
"csharp"
130+
);
131+
@@alternateType(ApiKeyResponseProperties.endDateTime, utcDateTime, "csharp");
132+
@@alternateType(ApiKeyRequestProperties.endDateTime, utcDateTime, "csharp");
133+
@@clientName(ApiKeyResponseProperties,
134+
"NginxDeploymentApiKeyProperties",
135+
"csharp"
136+
);
137+
@@clientName(AnalysisCreate, "NginxAnalysisContent", "csharp");
138+
@@clientName(AnalysisConfig, "NginxAnalysisConfig", "csharp");
139+
@@clientName(NginxCertificateErrorResponseBody,
140+
"NginxCertificateError",
141+
"csharp"
142+
);
143+
@@clientName(ActivationState, "NginxWafActivationState", "csharp");
144+
@@clientName(AnalysisResultContent, "NginxAnalysisResultDetails", "csharp");
145+
@@clientName(DiagnosticLevel, "NginxDiagnosticLevel", "csharp");
146+
@@clientName(Configuration, "NginxConfiguration", "csharp");
147+
@@clientName(NginxConfigurationResponseProperties,
148+
"NginxConfigurationProperties",
149+
"csharp"
150+
);
151+
@@clientName(ApiKey, "NginxDeploymentApiKey", "csharp");
152+
@@clientName(NginxConfigurationRequestProperties,
153+
"NginxConfigurationCreateOrUpdateProperties",
154+
"csharp"
155+
);
156+
157+
@@clientName(AnalysisResult, "NginxAnalysisResult", "csharp");
158+
@@clientName(WafPolicy, "NginxDeploymentWafPolicy", "csharp");
159+
@@clientName(AnalysisDiagnostic, "NginxAnalysisDiagnostic", "csharp");
160+
@@clientName(DiagnosticItem, "NginxDiagnosticItem", "csharp");
161+
@@clientName(ProvisioningState, "NginxProvisioningState", "csharp");
162+
@@clientName(AutoScaleSettings, "NginxDeploymentAutoScaleSettings", "csharp");
163+
@@clientName(AutoUpgradeProfile, "NginxDeploymentAutoUpgradeProfile", "csharp");
164+
@@clientName(ScaleProfile, "NginxScaleProfile", "csharp");
165+
@@clientName(ScaleProfileCapacity, "NginxScaleProfileCapacity", "csharp");
166+
@@clientName(WebApplicationFirewallSettings, "NginxWafSettings", "csharp");
167+
@@clientName(WebApplicationFirewallStatus, "NginxWafStatus", "csharp");
168+
@@clientName(WebApplicationFirewallPackage, "NginxWafPackage", "csharp");
169+
@@clientName(WebApplicationFirewallComponentVersions,
170+
"NginxWafComponentVersions",
171+
"csharp"
172+
);

specification/nginx/Nginx.Management/examples/2025-03-01-preview/ApiKeys_CreateOrUpdate_MaximumSet_Gen.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"api-version": "2025-03-01-preview",
66
"subscriptionId": "333F7B80-063D-40E5-975B-6E3C3CAC8296",
77
"resourceGroupName": "rgopenapi",
8-
"nginxDeploymentName": "myDeployment",
8+
"deploymentName": "myDeployment",
99
"apiKeyName": "myApiKey",
1010
"resource": {
1111
"properties": {
@@ -21,7 +21,7 @@
2121
"hint": "my secret API key hint",
2222
"endDateTime": "2025-05-28T20:01:03.647Z"
2323
},
24-
"id": "/subscriptions/333F7B80-063D-40E5-975B-6E3C3CAC8296/resourceGroups/rgopenapi/providers/NGINX.NGINXPLUS/nginxDeployments/myDeployment/apiKeys/otvmugiwezqyit",
24+
"id": "/subscriptions/333F7B80-063D-40E5-975B-6E3C3CAC8296/resourceGroups/rgopenapi/providers/Nginx.NginxPlus/nginxDeployments/myDeployment/apiKeys/otvmugiwezqyit",
2525
"name": "otvmugiwezqyit",
2626
"type": "ugslayxowhvlfgkfldbnbulh",
2727
"systemData": {
@@ -40,7 +40,7 @@
4040
"hint": "my secret API key hint",
4141
"endDateTime": "2025-05-28T20:01:03.647Z"
4242
},
43-
"id": "/subscriptions/333F7B80-063D-40E5-975B-6E3C3CAC8296/resourceGroups/rgopenapi/providers/NGINX.NGINXPLUS/nginxDeployments/myDeployment/apiKeys/otvmugiwezqyit",
43+
"id": "/subscriptions/333F7B80-063D-40E5-975B-6E3C3CAC8296/resourceGroups/rgopenapi/providers/Nginx.NginxPlus/nginxDeployments/myDeployment/apiKeys/otvmugiwezqyit",
4444
"name": "otvmugiwezqyit",
4545
"type": "ugslayxowhvlfgkfldbnbulh",
4646
"systemData": {

specification/nginx/Nginx.Management/examples/2025-03-01-preview/ApiKeys_Delete_MaximumSet_Gen.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"api-version": "2025-03-01-preview",
66
"subscriptionId": "333F7B80-063D-40E5-975B-6E3C3CAC8296",
77
"resourceGroupName": "rgopenapi",
8-
"nginxDeploymentName": "myDeployment",
8+
"deploymentName": "myDeployment",
99
"apiKeyName": "myApiKey"
1010
},
1111
"responses": {

specification/nginx/Nginx.Management/examples/2025-03-01-preview/ApiKeys_Get_MaximumSet_Gen.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"api-version": "2025-03-01-preview",
66
"subscriptionId": "333F7B80-063D-40E5-975B-6E3C3CAC8296",
77
"resourceGroupName": "rgopenapi",
8-
"nginxDeploymentName": "myDeployment",
8+
"deploymentName": "myDeployment",
99
"apiKeyName": "myApiKey"
1010
},
1111
"responses": {
@@ -15,7 +15,7 @@
1515
"hint": "my secret API key hint",
1616
"endDateTime": "2025-05-28T20:01:03.647Z"
1717
},
18-
"id": "/subscriptions/333F7B80-063D-40E5-975B-6E3C3CAC8296/resourceGroups/rgopenapi/providers/NGINX.NGINXPLUS/nginxDeployments/myDeployment/apiKeys/otvmugiwezqyit",
18+
"id": "/subscriptions/333F7B80-063D-40E5-975B-6E3C3CAC8296/resourceGroups/rgopenapi/providers/Nginx.NginxPlus/nginxDeployments/myDeployment/apiKeys/otvmugiwezqyit",
1919
"name": "otvmugiwezqyit",
2020
"type": "ugslayxowhvlfgkfldbnbulh",
2121
"systemData": {

specification/nginx/Nginx.Management/examples/2025-03-01-preview/ApiKeys_ListByDeployment_MaximumSet_Gen.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"api-version": "2025-03-01-preview",
66
"subscriptionId": "333F7B80-063D-40E5-975B-6E3C3CAC8296",
77
"resourceGroupName": "rgopenapi",
8-
"nginxDeploymentName": "myDeployment"
8+
"deploymentName": "myDeployment"
99
},
1010
"responses": {
1111
"200": {
@@ -16,7 +16,7 @@
1616
"hint": "my secret API key hint",
1717
"endDateTime": "2025-05-28T20:01:03.647Z"
1818
},
19-
"id": "/subscriptions/333F7B80-063D-40E5-975B-6E3C3CAC8296/resourceGroups/rgopenapi/providers/NGINX.NGINXPLUS/nginxDeployments/myDeployment/apiKeys/otvmugiwezqyit",
19+
"id": "/subscriptions/333F7B80-063D-40E5-975B-6E3C3CAC8296/resourceGroups/rgopenapi/providers/Nginx.NginxPlus/nginxDeployments/myDeployment/apiKeys/otvmugiwezqyit",
2020
"name": "otvmugiwezqyit",
2121
"type": "ugslayxowhvlfgkfldbnbulh",
2222
"systemData": {

0 commit comments

Comments
 (0)