Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions specification/nginx/Nginx.Management/NginxDeploymentWafPolicy.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";
import "@typespec/openapi";
import "@typespec/rest";
import "@typespec/versioning";
import "./models.tsp";
import "./NginxDeployment.tsp";

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

Expand Down Expand Up @@ -49,12 +51,21 @@ interface NginxDeploymentWafPolicies {
* Reset the Nginx Waf Policy of given Nginx deployment to default
*/
delete is ArmResourceDeleteWithoutOkAsync<NginxDeploymentWafPolicy>;

/**
* Analyze an Nginx Waf Policy
*/
@added(Versions.v2025_11_01)
@action("analyzeWafPolicy")
analysis is ArmResourceActionSync<
NginxDeploymentWafPolicy,
NginxDeploymentWafPolicyAnalysisCreateRequest,
ArmResponse<NginxDeploymentWafPolicyAnalysisResponse>,
OptionalRequestBody = true
>;
}

@@doc(NginxDeploymentWafPolicy.name, "The name of Waf Policy");
@@doc(NginxDeploymentWafPolicy.properties,
"Nginx Deployment Waf Policy Properties"
);
@@doc(NginxDeploymentWafPolicies.create::parameters.resource,
"The Nginx Deployment Waf Policy"
);
7 changes: 5 additions & 2 deletions specification/nginx/Nginx.Management/client.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,14 @@ using Azure.Core;
);
@@clientName(AnalysisResultData, "NginxAnalysisResultDetails", "csharp");
@@clientName(Level, "NginxDiagnosticLevel", "csharp");
@@clientName(NginxConfigurationResponse, "NginxConfiguration", "csharp");
@@clientName(NginxConfigurationResponse,
"NginxConfiguration",
"csharp,go,javascript"
);
@@usage(NginxConfigurationResponse, Usage.input, "csharp");
@@clientName(NginxConfigurationResponseProperties,
"NginxConfigurationProperties",
"csharp"
"csharp,go,javascript"
);
@@clientName(NginxDeploymentApiKeyResponse, "NginxDeploymentApiKey", "csharp");
@@clientName(NginxDeploymentApiKeyResponseProperties,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"parameters": {
"api-version": "2025-11-01",
"apiKeyName": "myApiKey",
"deploymentName": "myDeployment",
"requestBody": {
"properties": {
"endDateTime": "2024-09-01T00:00:00Z",
"secretText": "00000000-0000-0000-0000-000000000000"
}
},
"resourceGroupName": "myResourceGroup",
"subscriptionId": "00000000-0000-0000-0000-000000000000"
},
"responses": {
"200": {
"body": {
"name": "myApiKey",
"type": "Nginx.NginxPlus/nginxDeployments/apiKeys",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Nginx.NginxPlus/nginxDeployments/myDeployment/apiKeys/myApiKey",
"properties": {
"endDateTime": "2024-09-01T00:00:00Z",
"hint": "000"
}
}
},
"201": {
"body": {
"name": "myApiKey",
"type": "Nginx.NginxPlus/nginxDeployments/apiKeys",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Nginx.NginxPlus/nginxDeployments/myDeployment/apiKeys/myApiKey",
"properties": {
"endDateTime": "2024-09-01T00:00:00Z",
"hint": "000"
}
}
}
},
"operationId": "ApiKeys_CreateOrUpdate",
"title": "ApiKeys_CreateOrUpdate"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"parameters": {
"api-version": "2025-11-01",
"apiKeyName": "myApiKey",
"deploymentName": "myDeployment",
"resourceGroupName": "myResourceGroup",
"subscriptionId": "00000000-0000-0000-0000-000000000000"
},
"responses": {
"200": {},
"204": {}
},
"operationId": "ApiKeys_Delete",
"title": "ApiKeys_Delete"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"parameters": {
"api-version": "2025-11-01",
"apiKeyName": "myApiKey",
"deploymentName": "myDeployment",
"resourceGroupName": "myResourceGroup",
"subscriptionId": "00000000-0000-0000-0000-000000000000"
},
"responses": {
"200": {
"body": {
"name": "myApiKey",
"type": "Nginx.NginxPlus/nginxDeployments/apiKeys",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Nginx.NginxPlus/nginxDeployments/myDeployment/apiKeys/myApiKey",
"properties": {
"endDateTime": "2024-09-01T00:00:00Z",
"hint": "000"
}
}
}
},
"operationId": "ApiKeys_Get",
"title": "ApiKeys_Get"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"parameters": {
"api-version": "2025-11-01",
"deploymentName": "myDeployment",
"resourceGroupName": "myResourceGroup",
"subscriptionId": "00000000-0000-0000-0000-000000000000"
},
"responses": {
"200": {
"body": {
"value": [
{
"name": "myApiKey",
"type": "Nginx.NginxPlus/nginxDeployments/apiKeys",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Nginx.NginxPlus/nginxDeployments/myDeployment/apiKeys/myApiKey",
"properties": {
"endDateTime": "2024-09-01T00:00:00Z",
"hint": "000"
}
},
{
"name": "myApiKey2",
"type": "Nginx.NginxPlus/nginxDeployments/apiKeys",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Nginx.NginxPlus/nginxDeployments/myDeployment/apiKeys/myApiKey2",
"properties": {
"endDateTime": "2024-10-01T00:00:00Z",
"hint": "111"
}
}
]
}
}
},
"operationId": "ApiKeys_List",
"title": "ApiKeys_List"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"parameters": {
"api-version": "2025-11-01",
"certificateName": "default",
"deploymentName": "myDeployment",
"requestBody": {
"properties": {
"certificateVirtualPath": "/src/cert/somePath.cert",
"keyVaultSecretId": "https://someKV.vault.azure.com/someSecretID",
"keyVirtualPath": "/src/cert/somekey.key"
}
},
"resourceGroupName": "myResourceGroup",
"subscriptionId": "00000000-0000-0000-0000-000000000000"
},
"responses": {
"200": {
"body": {
"name": "default",
"type": "nginx.nginxplus/nginxdeployments/certificates",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Nginx.NginxPlus/nginxDeployments/myDeployment/certificates/default",
"properties": {
"certificateVirtualPath": "/src/cert/somePath.cert",
"keyVaultSecretId": "https://someKV.vault.azure.com/someSecretID",
"keyVirtualPath": "/src/cert/somekey.key",
"provisioningState": "Succeeded"
}
}
},
"201": {
"body": {
"name": "default",
"type": "nginx.nginxplus/nginxdeployments/certificates",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Nginx.NginxPlus/nginxDeployments/myDeployment/certificates/default",
"properties": {
"certificateVirtualPath": "/src/cert/somePath.cert",
"keyVaultSecretId": "https://someKV.vault.azure.com/someSecretID",
"keyVirtualPath": "/src/cert/somekey.key",
"provisioningState": "Accepted"
}
}
}
},
"operationId": "Certificates_CreateOrUpdate",
"title": "Certificates_CreateOrUpdate"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"parameters": {
"api-version": "2025-11-01",
"certificateName": "default",
"deploymentName": "myDeployment",
"resourceGroupName": "myResourceGroup",
"subscriptionId": "00000000-0000-0000-0000-000000000000"
},
"responses": {
"202": {
"headers": {
"Azure-AsyncOperation": "https://example.com/operationstatus"
}
},
"204": {}
},
"operationId": "Certificates_Delete",
"title": "Certificates_Delete"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"parameters": {
"api-version": "2025-11-01",
"certificateName": "default",
"deploymentName": "myDeployment",
"resourceGroupName": "myResourceGroup",
"subscriptionId": "00000000-0000-0000-0000-000000000000"
},
"responses": {
"200": {
"body": {
"name": "default",
"type": "nginx.nginxplus/nginxdeployments/certificates",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Nginx.NginxPlus/nginxDeployments/myDeployment/certificates/default",
"properties": {
"certificateError": {
"code": "CertificateNotYetValid",
"message": "The certificate is not yet valid. The certificate is not yet valid. NotBefore: '2020-01-01T00:00:00Z', NotAfter: '2020-01-01T00:00:00Z'"
},
"certificateVirtualPath": "/src/cert/somePath.cert",
"keyVaultSecretCreated": "2020-01-01T00:00:00Z",
"keyVaultSecretId": "https://someKV.vault.azure.com/someSecretID",
"keyVaultSecretVersion": "12345678ef9a12345678ef9a12345678",
"keyVirtualPath": "/src/cert/somekey.key",
"provisioningState": "Succeeded",
"sha1Thumbprint": "1234567890ABCDEF1234567890ABCDEF12345678"
}
}
}
},
"operationId": "Certificates_Get",
"title": "Certificates_Get"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"parameters": {
"api-version": "2025-11-01",
"deploymentName": "myDeployment",
"resourceGroupName": "myResourceGroup",
"subscriptionId": "00000000-0000-0000-0000-000000000000"
},
"responses": {
"200": {
"body": {
"value": [
{
"name": "cert1",
"type": "nginx.nginxplus/nginxdeployments/certificates",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Nginx.NginxPlus/nginxDeployments/myDeployment/certificates/cert1",
"properties": {
"certificateError": {
"code": "CertificateNotYetValid",
"message": "The certificate is not yet valid. The certificate is not yet valid. NotBefore: '2020-01-01T00:00:00Z', NotAfter: '2020-01-01T00:00:00Z'"
},
"certificateVirtualPath": "/src/cert/somePath.cert",
"keyVaultSecretCreated": "2020-01-01T00:00:00Z",
"keyVaultSecretId": "https://someKV.vault.azure.com/someSecretID",
"keyVaultSecretVersion": "12345678ef9a12345678ef9a12345678",
"keyVirtualPath": "/src/cert/somekey.key",
"provisioningState": "Succeeded",
"sha1Thumbprint": "1234567890ABCDEF1234567890ABCDEF12345678"
}
},
{
"name": "cert2",
"type": "nginx.nginxplus/nginxdeployments/certificates",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Nginx.NginxPlus/nginxDeployments/myDeployment/certificates/cert2",
"properties": {
"certificateError": null,
"certificateVirtualPath": "/src/cert/somePath2.cert",
"keyVaultSecretCreated": "2020-01-01T00:00:00Z",
"keyVaultSecretId": "https://someKV.vault.azure.com/someSecretID2",
"keyVaultSecretVersion": "12345678ef9a12345678ef9a12345678",
"keyVirtualPath": "/src/cert/somekey2.key",
"provisioningState": "Succeeded",
"sha1Thumbprint": "1234567890ABCDEF1234567890ABCDEF12345678"
}
}
]
}
}
},
"operationId": "Certificates_List",
"title": "Certificates_List"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"parameters": {
"api-version": "2025-11-01",
"configurationName": "default",
"deploymentName": "myDeployment",
"requestBody": {
"config": {
"files": [
{
"content": "ABCDEF==",
"virtualPath": "/etc/nginx/nginx.conf"
}
],
"package": {
"data": null
},
"rootFile": "/etc/nginx/nginx.conf"
}
},
"resourceGroupName": "myResourceGroup",
"subscriptionId": "00000000-0000-0000-0000-000000000000"
},
"responses": {
"200": {
"body": {
"data": {
"errors": [
{
"description": "Directives outside the http context are not allowed",
"directive": "worker_processes",
"file": "/etc/nginx/nginx.conf",
"id": "config-analysis-error-1",
"line": 2,
"message": "You are not allowed to set the worker_processes directive",
"rule": "nginx-azure-load-balancer-allowed-directives"
}
]
},
"status": "FAILED"
}
}
},
"operationId": "Configurations_Analysis",
"title": "Configurations_Analysis"
}
Loading
Loading