Skip to content
Closed
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
2 changes: 1 addition & 1 deletion sdk/nginx/arm-nginx/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2023 Microsoft
Copyright (c) 2024 Microsoft

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
8 changes: 4 additions & 4 deletions sdk/nginx/arm-nginx/_meta.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"commit": "ed84b11847785792767b0b84cc6f98f4ea08ca77",
"commit": "4792bce7667477529991457890b4a6b670e70508",
"readme": "specification/nginx/resource-manager/readme.md",
"autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\nginx\\resource-manager\\readme.md --use=@autorest/typescript@6.0.12 --generate-sample=true",
"autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\nginx\\resource-manager\\readme.md --use=@autorest/typescript@6.0.13 --generate-sample=true",
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
"release_tool": "@azure-tools/js-sdk-release-tools@2.7.2",
"use": "@autorest/typescript@6.0.12"
"release_tool": "@azure-tools/js-sdk-release-tools@2.7.4",
"use": "@autorest/typescript@6.0.13"
}
2 changes: 1 addition & 1 deletion sdk/nginx/arm-nginx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,4 @@
"disableDocsMs": true,
"apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-nginx?view=azure-node-preview"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@

// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { NginxManagementClient } from "@azure/arm-nginx";
import {
NginxCertificate,
CertificatesCreateOrUpdateOptionalParams,
NginxManagementClient
} from "@azure/arm-nginx";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";

Expand All @@ -28,12 +32,21 @@ async function certificatesCreateOrUpdate() {
process.env["NGINX_RESOURCE_GROUP"] || "myResourceGroup";
const deploymentName = "myDeployment";
const certificateName = "default";
const body: NginxCertificate = {
properties: {
certificateVirtualPath: "/src/cert/somePath.cert",
keyVaultSecretId: "https://someKV.vault.azure.com/someSecretID",
keyVirtualPath: "/src/cert/somekey.key"
}
};
const options: CertificatesCreateOrUpdateOptionalParams = { body };
const credential = new DefaultAzureCredential();
const client = new NginxManagementClient(credential, subscriptionId);
const result = await client.certificates.beginCreateOrUpdateAndWait(
resourceGroupName,
deploymentName,
certificateName
certificateName,
options
);
console.log(result);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@

// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { NginxManagementClient } from "@azure/arm-nginx";
import {
NginxConfiguration,
ConfigurationsCreateOrUpdateOptionalParams,
NginxManagementClient
} from "@azure/arm-nginx";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";

Expand All @@ -28,12 +32,21 @@ async function configurationsCreateOrUpdate() {
process.env["NGINX_RESOURCE_GROUP"] || "myResourceGroup";
const deploymentName = "myDeployment";
const configurationName = "default";
const body: NginxConfiguration = {
properties: {
files: [{ content: "ABCDEF==", virtualPath: "/etc/nginx/nginx.conf" }],
package: { data: undefined },
rootFile: "/etc/nginx/nginx.conf"
}
};
const options: ConfigurationsCreateOrUpdateOptionalParams = { body };
const credential = new DefaultAzureCredential();
const client = new NginxManagementClient(credential, subscriptionId);
const result = await client.configurations.beginCreateOrUpdateAndWait(
resourceGroupName,
deploymentName,
configurationName
configurationName,
options
);
console.log(result);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@

// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { NginxManagementClient } from "@azure/arm-nginx";
import {
NginxDeployment,
DeploymentsCreateOrUpdateOptionalParams,
NginxManagementClient
} from "@azure/arm-nginx";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";

Expand All @@ -27,11 +31,44 @@ async function deploymentsCreate() {
const resourceGroupName =
process.env["NGINX_RESOURCE_GROUP"] || "myResourceGroup";
const deploymentName = "myDeployment";
const body: NginxDeployment = {
name: "myDeployment",
location: "West US",
properties: {
managedResourceGroup: "myManagedResourceGroup",
networkProfile: {
frontEndIPConfiguration: {
privateIPAddresses: [
{
privateIPAddress: "1.1.1.1",
privateIPAllocationMethod: "Static",
subnetId:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"
}
],
publicIPAddresses: [
{
id:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/publicIPAddresses/myPublicIPAddress"
}
]
},
networkInterfaceConfiguration: {
subnetId:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"
}
},
userProfile: { preferredEmail: "example@example.email" }
},
tags: { environment: "Dev" }
};
const options: DeploymentsCreateOrUpdateOptionalParams = { body };
const credential = new DefaultAzureCredential();
const client = new NginxManagementClient(credential, subscriptionId);
const result = await client.deployments.beginCreateOrUpdateAndWait(
resourceGroupName,
deploymentName
deploymentName,
options
);
console.log(result);
}
Expand Down
13 changes: 11 additions & 2 deletions sdk/nginx/arm-nginx/samples-dev/deploymentsUpdateSample.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@

// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { NginxManagementClient } from "@azure/arm-nginx";
import {
NginxDeploymentUpdateParameters,
DeploymentsUpdateOptionalParams,
NginxManagementClient
} from "@azure/arm-nginx";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";

Expand All @@ -27,11 +31,16 @@ async function deploymentsUpdate() {
const resourceGroupName =
process.env["NGINX_RESOURCE_GROUP"] || "myResourceGroup";
const deploymentName = "myDeployment";
const body: NginxDeploymentUpdateParameters = {
tags: { environment: "Dev" }
};
const options: DeploymentsUpdateOptionalParams = { body };
const credential = new DefaultAzureCredential();
const client = new NginxManagementClient(credential, subscriptionId);
const result = await client.deployments.beginUpdateAndWait(
resourceGroupName,
deploymentName
deploymentName,
options
);
console.log(result);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,21 @@ async function certificatesCreateOrUpdate() {
const resourceGroupName = process.env["NGINX_RESOURCE_GROUP"] || "myResourceGroup";
const deploymentName = "myDeployment";
const certificateName = "default";
const body = {
properties: {
certificateVirtualPath: "/src/cert/somePath.cert",
keyVaultSecretId: "https://someKV.vault.azure.com/someSecretID",
keyVirtualPath: "/src/cert/somekey.key",
},
};
const options = { body };
const credential = new DefaultAzureCredential();
const client = new NginxManagementClient(credential, subscriptionId);
const result = await client.certificates.beginCreateOrUpdateAndWait(
resourceGroupName,
deploymentName,
certificateName
certificateName,
options,
);
console.log(result);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ async function certificatesDelete() {
const result = await client.certificates.beginDeleteAndWait(
resourceGroupName,
deploymentName,
certificateName
certificateName,
);
console.log(result);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,21 @@ async function configurationsCreateOrUpdate() {
const resourceGroupName = process.env["NGINX_RESOURCE_GROUP"] || "myResourceGroup";
const deploymentName = "myDeployment";
const configurationName = "default";
const body = {
properties: {
files: [{ content: "ABCDEF==", virtualPath: "/etc/nginx/nginx.conf" }],
package: { data: undefined },
rootFile: "/etc/nginx/nginx.conf",
},
};
const options = { body };
const credential = new DefaultAzureCredential();
const client = new NginxManagementClient(credential, subscriptionId);
const result = await client.configurations.beginCreateOrUpdateAndWait(
resourceGroupName,
deploymentName,
configurationName
configurationName,
options,
);
console.log(result);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ async function configurationsDelete() {
const result = await client.configurations.beginDeleteAndWait(
resourceGroupName,
deploymentName,
configurationName
configurationName,
);
console.log(result);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ async function configurationsGet() {
const result = await client.configurations.get(
resourceGroupName,
deploymentName,
configurationName
configurationName,
);
console.log(result);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,43 @@ async function deploymentsCreate() {
process.env["NGINX_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["NGINX_RESOURCE_GROUP"] || "myResourceGroup";
const deploymentName = "myDeployment";
const body = {
name: "myDeployment",
location: "West US",
properties: {
managedResourceGroup: "myManagedResourceGroup",
networkProfile: {
frontEndIPConfiguration: {
privateIPAddresses: [
{
privateIPAddress: "1.1.1.1",
privateIPAllocationMethod: "Static",
subnetId:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet",
},
],
publicIPAddresses: [
{
id: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/publicIPAddresses/myPublicIPAddress",
},
],
},
networkInterfaceConfiguration: {
subnetId:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet",
},
},
userProfile: { preferredEmail: "example@example.email" },
},
tags: { environment: "Dev" },
};
const options = { body };
const credential = new DefaultAzureCredential();
const client = new NginxManagementClient(credential, subscriptionId);
const result = await client.deployments.beginCreateOrUpdateAndWait(
resourceGroupName,
deploymentName
deploymentName,
options,
);
console.log(result);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,17 @@ async function deploymentsUpdate() {
process.env["NGINX_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["NGINX_RESOURCE_GROUP"] || "myResourceGroup";
const deploymentName = "myDeployment";
const body = {
tags: { environment: "Dev" },
};
const options = { body };
const credential = new DefaultAzureCredential();
const client = new NginxManagementClient(credential, subscriptionId);
const result = await client.deployments.beginUpdateAndWait(resourceGroupName, deploymentName);
const result = await client.deployments.beginUpdateAndWait(
resourceGroupName,
deploymentName,
options,
);
console.log(result);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@

// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { NginxManagementClient } from "@azure/arm-nginx";
import {
NginxCertificate,
CertificatesCreateOrUpdateOptionalParams,
NginxManagementClient
} from "@azure/arm-nginx";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";

Expand All @@ -28,12 +32,21 @@ async function certificatesCreateOrUpdate() {
process.env["NGINX_RESOURCE_GROUP"] || "myResourceGroup";
const deploymentName = "myDeployment";
const certificateName = "default";
const body: NginxCertificate = {
properties: {
certificateVirtualPath: "/src/cert/somePath.cert",
keyVaultSecretId: "https://someKV.vault.azure.com/someSecretID",
keyVirtualPath: "/src/cert/somekey.key"
}
};
const options: CertificatesCreateOrUpdateOptionalParams = { body };
const credential = new DefaultAzureCredential();
const client = new NginxManagementClient(credential, subscriptionId);
const result = await client.certificates.beginCreateOrUpdateAndWait(
resourceGroupName,
deploymentName,
certificateName
certificateName,
options
);
console.log(result);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@

// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { NginxManagementClient } from "@azure/arm-nginx";
import {
NginxConfiguration,
ConfigurationsCreateOrUpdateOptionalParams,
NginxManagementClient
} from "@azure/arm-nginx";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";

Expand All @@ -28,12 +32,21 @@ async function configurationsCreateOrUpdate() {
process.env["NGINX_RESOURCE_GROUP"] || "myResourceGroup";
const deploymentName = "myDeployment";
const configurationName = "default";
const body: NginxConfiguration = {
properties: {
files: [{ content: "ABCDEF==", virtualPath: "/etc/nginx/nginx.conf" }],
package: { data: undefined },
rootFile: "/etc/nginx/nginx.conf"
}
};
const options: ConfigurationsCreateOrUpdateOptionalParams = { body };
const credential = new DefaultAzureCredential();
const client = new NginxManagementClient(credential, subscriptionId);
const result = await client.configurations.beginCreateOrUpdateAndWait(
resourceGroupName,
deploymentName,
configurationName
configurationName,
options
);
console.log(result);
}
Expand Down
Loading