diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 7726ae71ca65..764b9a61ca91 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -4447,7 +4447,7 @@ packages: dependencies: semver: 7.5.4 shelljs: 0.8.5 - typescript: 5.4.0-dev.20231117 + typescript: 5.4.0-dev.20231119 dev: false /downlevel-dts@0.11.0: @@ -4456,7 +4456,7 @@ packages: dependencies: semver: 7.5.4 shelljs: 0.8.5 - typescript: 5.4.0-dev.20231117 + typescript: 5.4.0-dev.20231119 dev: false /eastasianwidth@0.2.0: @@ -9158,8 +9158,8 @@ packages: hasBin: true dev: false - /typescript@5.4.0-dev.20231117: - resolution: {integrity: sha512-qJs5vq279esPS+UX+NlDaSB8aDc9NiC1VLo6cHGrEVMUV8e9WTMic5T92KgDsExf239vViwmKNvtSMGf90aDOA==} + /typescript@5.4.0-dev.20231119: + resolution: {integrity: sha512-a8JGI0ifhQ0VM9dJhSWWZnSKQu6Bgm16G32BHDOIhEuLcn0uWcfA2ZHeazTiqYEAzja+zsN+Y4f8yliGW0K3+A==} engines: {node: '>=14.17'} hasBin: true dev: false @@ -13986,20 +13986,22 @@ packages: dev: false file:projects/arm-newrelicobservability.tgz: - resolution: {integrity: sha512-UdEx4JEu/jq049v+jJ/Z/PWc8+L0Hdu0dSyUMUMBU6siWdR2TEjxiwpJlDofmme4gHfrLyn/z0gT+lYB8qk67g==, tarball: file:projects/arm-newrelicobservability.tgz} + resolution: {integrity: sha512-harAQp75afnSgDynosR0UNaaafiOJtP7mX77LcZzj1nOciHoU5JLRfUTPRSSUlnLicjlfsem9Qonfjr8ot5KEg==, tarball: file:projects/arm-newrelicobservability.tgz} name: '@rush-temp/arm-newrelicobservability' version: 0.0.0 dependencies: '@azure/identity': 3.4.1 '@microsoft/api-extractor': 7.38.3(@types/node@18.18.9) '@types/chai': 4.3.10 + '@types/mocha': 10.0.4 '@types/node': 18.18.9 chai: 4.3.10 cross-env: 7.0.3 dotenv: 16.3.1 + esm: 3.2.25 mkdirp: 2.1.6 mocha: 10.2.0 - rimraf: 3.0.2 + rimraf: 5.0.5 ts-node: 10.9.1(@types/node@18.18.9)(typescript@5.2.2) tslib: 2.6.2 typescript: 5.2.2 diff --git a/sdk/newrelicobservability/arm-newrelicobservability/CHANGELOG.md b/sdk/newrelicobservability/arm-newrelicobservability/CHANGELOG.md index 3c0b00c6721d..e282d88f9fd4 100644 --- a/sdk/newrelicobservability/arm-newrelicobservability/CHANGELOG.md +++ b/sdk/newrelicobservability/arm-newrelicobservability/CHANGELOG.md @@ -1,15 +1,58 @@ # Release History + +## 1.1.0-beta.1 (2023-11-20) + +**Features** -## 1.0.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - + - Added operation group BillingInfo + - Added operation group ConnectedPartnerResources + - Added operation group MonitoredSubscriptions + - Added operation Monitors.listLinkedResources + - Added Interface BillingInfoGetOptionalParams + - Added Interface BillingInfoResponse + - Added Interface ConnectedPartnerResourceProperties + - Added Interface ConnectedPartnerResourcesListFormat + - Added Interface ConnectedPartnerResourcesListNextOptionalParams + - Added Interface ConnectedPartnerResourcesListOptionalParams + - Added Interface ConnectedPartnerResourcesListResponse + - Added Interface LinkedResource + - Added Interface LinkedResourceListResponse + - Added Interface MarketplaceSaaSInfo + - Added Interface MonitoredSubscription + - Added Interface MonitoredSubscriptionProperties + - Added Interface MonitoredSubscriptionPropertiesList + - Added Interface MonitoredSubscriptionsCreateorUpdateOptionalParams + - Added Interface MonitoredSubscriptionsDeleteHeaders + - Added Interface MonitoredSubscriptionsDeleteOptionalParams + - Added Interface MonitoredSubscriptionsGetOptionalParams + - Added Interface MonitoredSubscriptionsListNextOptionalParams + - Added Interface MonitoredSubscriptionsListOptionalParams + - Added Interface MonitoredSubscriptionsUpdateHeaders + - Added Interface MonitoredSubscriptionsUpdateOptionalParams + - Added Interface MonitoringTagRulesProperties + - Added Interface MonitorsListLinkedResourcesNextOptionalParams + - Added Interface MonitorsListLinkedResourcesOptionalParams + - Added Interface PartnerBillingEntity + - Added Interface SubscriptionList + - Added Type Alias BillingInfoGetResponse + - Added Type Alias ConfigurationName + - Added Type Alias ConnectedPartnerResourcesListNextResponse + - Added Type Alias ConnectedPartnerResourcesListOperationResponse + - Added Type Alias MonitoredSubscriptionsCreateorUpdateResponse + - Added Type Alias MonitoredSubscriptionsDeleteResponse + - Added Type Alias MonitoredSubscriptionsGetResponse + - Added Type Alias MonitoredSubscriptionsListNextResponse + - Added Type Alias MonitoredSubscriptionsListResponse + - Added Type Alias MonitoredSubscriptionsUpdateResponse + - Added Type Alias MonitorsListLinkedResourcesNextResponse + - Added Type Alias MonitorsListLinkedResourcesResponse + - Added Type Alias PatchOperation + - Added Type Alias Status + - Added Enum KnownConfigurationName + - Added Enum KnownPatchOperation + - Added Enum KnownStatus + + ## 1.0.0 (2023-05-06) -The package of @azure/arm-newrelicobservability is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart ). +The package of @azure/arm-newrelicobservability is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart). diff --git a/sdk/newrelicobservability/arm-newrelicobservability/README.md b/sdk/newrelicobservability/arm-newrelicobservability/README.md index 68f2751a122f..b29bb1990eda 100644 --- a/sdk/newrelicobservability/arm-newrelicobservability/README.md +++ b/sdk/newrelicobservability/arm-newrelicobservability/README.md @@ -6,7 +6,7 @@ This package contains an isomorphic SDK (runs both in Node.js and in browsers) f [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/newrelicobservability/arm-newrelicobservability) | [Package (NPM)](https://www.npmjs.com/package/@azure/arm-newrelicobservability) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-newrelicobservability) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-newrelicobservability?view=azure-node-preview) | [Samples](https://github.com/Azure-Samples/azure-samples-js-management) ## Getting started diff --git a/sdk/newrelicobservability/arm-newrelicobservability/_meta.json b/sdk/newrelicobservability/arm-newrelicobservability/_meta.json index b15387f6aefe..98d77f7e682e 100644 --- a/sdk/newrelicobservability/arm-newrelicobservability/_meta.json +++ b/sdk/newrelicobservability/arm-newrelicobservability/_meta.json @@ -1,8 +1,8 @@ { - "commit": "3c639105c011765893db51cbb0dda056e34dc994", + "commit": "ff50e7f9e7261cc2e20734aa583a7abd318c5a02", "readme": "specification/newrelic/resource-manager/readme.md", - "autorest_command": "autorest --version=3.9.3 --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\\newrelic\\resource-manager\\readme.md --use=@autorest/typescript@6.0.1 --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=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/newrelic/resource-manager/readme.md --use=@autorest/typescript@^6.0.12", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.6.2", - "use": "@autorest/typescript@6.0.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.4", + "use": "@autorest/typescript@^6.0.12" } \ No newline at end of file diff --git a/sdk/newrelicobservability/arm-newrelicobservability/assets.json b/sdk/newrelicobservability/arm-newrelicobservability/assets.json deleted file mode 100644 index 04a76f76358b..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/assets.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "AssetsRepo": "Azure/azure-sdk-assets", - "AssetsRepoPrefixPath": "js", - "TagPrefix": "js/newrelicobservability/arm-newrelicobservability", - "Tag": "js/newrelicobservability/arm-newrelicobservability_189517b525" -} diff --git a/sdk/newrelicobservability/arm-newrelicobservability/package.json b/sdk/newrelicobservability/arm-newrelicobservability/package.json index 7b54e7bc1d90..1b524da68aeb 100644 --- a/sdk/newrelicobservability/arm-newrelicobservability/package.json +++ b/sdk/newrelicobservability/arm-newrelicobservability/package.json @@ -3,17 +3,17 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for NewRelicObservability.", - "version": "1.0.1", + "version": "1.1.0-beta.1", "engines": { "node": ">=18.0.0" }, "dependencies": { - "@azure/core-lro": "^2.5.0", + "@azure/core-lro": "^2.5.4", "@azure/abort-controller": "^1.0.0", "@azure/core-paging": "^1.2.0", "@azure/core-client": "^1.7.0", "@azure/core-auth": "^1.3.0", - "@azure/core-rest-pipeline": "^1.8.0", + "@azure/core-rest-pipeline": "^1.12.0", "tslib": "^2.2.0" }, "keywords": [ @@ -32,17 +32,19 @@ "mkdirp": "^2.1.2", "typescript": "~5.2.0", "uglify-js": "^3.4.9", - "rimraf": "^3.0.0", + "rimraf": "^5.0.0", "dotenv": "^16.0.0", + "@azure/dev-tool": "^1.0.0", "@azure/identity": "^3.3.0", "@azure-tools/test-recorder": "^3.0.0", "@azure-tools/test-credential": "^1.0.0", "mocha": "^10.0.0", + "@types/mocha": "^10.0.0", + "esm": "^3.2.18", "@types/chai": "^4.2.8", "chai": "^4.2.0", "cross-env": "^7.0.2", "@types/node": "^18.0.0", - "@azure/dev-tool": "^1.0.0", "ts-node": "^10.0.0" }, "repository": { @@ -77,7 +79,7 @@ "extract-api": "api-extractor run --local", "lint": "echo skipped", "audit": "echo skipped", - "clean": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log", + "clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", "build:node": "echo skipped", "build:browser": "echo skipped", "build:test": "echo skipped", @@ -105,13 +107,5 @@ ] }, "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/newrelicobservability/arm-newrelicobservability", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-newrelicobservability?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/newrelicobservability/arm-newrelicobservability" +} \ No newline at end of file diff --git a/sdk/newrelicobservability/arm-newrelicobservability/review/arm-newrelicobservability.api.md b/sdk/newrelicobservability/arm-newrelicobservability/review/arm-newrelicobservability.api.md index 043b7a2c0e82..c7ba32d8e80b 100644 --- a/sdk/newrelicobservability/arm-newrelicobservability/review/arm-newrelicobservability.api.md +++ b/sdk/newrelicobservability/arm-newrelicobservability/review/arm-newrelicobservability.api.md @@ -83,9 +83,70 @@ export interface AppServicesListResponse { // @public export type BillingCycle = string; +// @public +export interface BillingInfo { + get(resourceGroupName: string, monitorName: string, options?: BillingInfoGetOptionalParams): Promise; +} + +// @public +export interface BillingInfoGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type BillingInfoGetResponse = BillingInfoResponse; + +// @public +export interface BillingInfoResponse { + marketplaceSaasInfo?: MarketplaceSaaSInfo; + partnerBillingEntity?: PartnerBillingEntity; +} + // @public export type BillingSource = string; +// @public +export type ConfigurationName = string; + +// @public +export interface ConnectedPartnerResourceProperties { + accountId?: string; + accountName?: string; + azureResourceId?: string; + location?: string; +} + +// @public +export interface ConnectedPartnerResources { + list(resourceGroupName: string, monitorName: string, options?: ConnectedPartnerResourcesListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface ConnectedPartnerResourcesListFormat { + properties?: ConnectedPartnerResourceProperties; +} + +// @public +export interface ConnectedPartnerResourcesListNextOptionalParams extends coreClient.OperationOptions { + body?: string; +} + +// @public +export type ConnectedPartnerResourcesListNextResponse = ConnectedPartnerResourcesListResponse; + +// @public +export type ConnectedPartnerResourcesListOperationResponse = ConnectedPartnerResourcesListResponse; + +// @public +export interface ConnectedPartnerResourcesListOptionalParams extends coreClient.OperationOptions { + body?: string; +} + +// @public +export interface ConnectedPartnerResourcesListResponse { + nextLink?: string; + value?: ConnectedPartnerResourcesListFormat[]; +} + // @public export type CreatedByType = string; @@ -154,6 +215,11 @@ export enum KnownBillingSource { Newrelic = "NEWRELIC" } +// @public +export enum KnownConfigurationName { + Default = "default" +} + // @public export enum KnownCreatedByType { Application = "Application", @@ -201,6 +267,15 @@ export enum KnownOrigin { UserSystem = "user,system" } +// @public +export enum KnownPatchOperation { + Active = "Active", + AddBegin = "AddBegin", + AddComplete = "AddComplete", + DeleteBegin = "DeleteBegin", + DeleteComplete = "DeleteComplete" +} + // @public export enum KnownProvisioningState { Accepted = "Accepted", @@ -258,6 +333,14 @@ export enum KnownSingleSignOnStates { Initial = "Initial" } +// @public +export enum KnownStatus { + Active = "Active", + Deleting = "Deleting", + Failed = "Failed", + InProgress = "InProgress" +} + // @public export enum KnownTagAction { Exclude = "Exclude", @@ -273,6 +356,17 @@ export enum KnownUsageType { // @public export type LiftrResourceCategories = string; +// @public +export interface LinkedResource { + id?: string; +} + +// @public +export interface LinkedResourceListResponse { + nextLink?: string; + value?: LinkedResource[]; +} + // @public export interface LogRules { filteringTags?: FilteringTag[]; @@ -294,6 +388,15 @@ export interface ManagedServiceIdentity { // @public export type ManagedServiceIdentityType = string; +// @public +export interface MarketplaceSaaSInfo { + billedAzureSubscriptionId?: string; + marketplaceResourceId?: string; + marketplaceStatus?: string; + marketplaceSubscriptionId?: string; + marketplaceSubscriptionName?: string; +} + // @public export type MarketplaceSubscriptionStatus = string; @@ -345,9 +448,113 @@ export interface MonitoredResourceListResponse { value: MonitoredResource[]; } +// @public +export interface MonitoredSubscription { + error?: string; + status?: Status; + subscriptionId?: string; + tagRules?: MonitoringTagRulesProperties; +} + +// @public +export interface MonitoredSubscriptionProperties { + readonly id?: string; + readonly name?: string; + properties?: SubscriptionList; + readonly type?: string; +} + +// @public (undocumented) +export interface MonitoredSubscriptionPropertiesList { + nextLink?: string; + // (undocumented) + value?: MonitoredSubscriptionProperties[]; +} + +// @public +export interface MonitoredSubscriptions { + beginCreateorUpdate(resourceGroupName: string, monitorName: string, configurationName: ConfigurationName, options?: MonitoredSubscriptionsCreateorUpdateOptionalParams): Promise, MonitoredSubscriptionsCreateorUpdateResponse>>; + beginCreateorUpdateAndWait(resourceGroupName: string, monitorName: string, configurationName: ConfigurationName, options?: MonitoredSubscriptionsCreateorUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, monitorName: string, configurationName: ConfigurationName, options?: MonitoredSubscriptionsDeleteOptionalParams): Promise, MonitoredSubscriptionsDeleteResponse>>; + beginDeleteAndWait(resourceGroupName: string, monitorName: string, configurationName: ConfigurationName, options?: MonitoredSubscriptionsDeleteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, monitorName: string, configurationName: ConfigurationName, options?: MonitoredSubscriptionsUpdateOptionalParams): Promise, MonitoredSubscriptionsUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, monitorName: string, configurationName: ConfigurationName, options?: MonitoredSubscriptionsUpdateOptionalParams): Promise; + get(resourceGroupName: string, monitorName: string, configurationName: ConfigurationName, options?: MonitoredSubscriptionsGetOptionalParams): Promise; + list(resourceGroupName: string, monitorName: string, options?: MonitoredSubscriptionsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface MonitoredSubscriptionsCreateorUpdateOptionalParams extends coreClient.OperationOptions { + body?: MonitoredSubscriptionProperties; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type MonitoredSubscriptionsCreateorUpdateResponse = MonitoredSubscriptionProperties; + +// @public +export interface MonitoredSubscriptionsDeleteHeaders { + // (undocumented) + location?: string; +} + +// @public +export interface MonitoredSubscriptionsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type MonitoredSubscriptionsDeleteResponse = MonitoredSubscriptionsDeleteHeaders; + +// @public +export interface MonitoredSubscriptionsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MonitoredSubscriptionsGetResponse = MonitoredSubscriptionProperties; + +// @public +export interface MonitoredSubscriptionsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MonitoredSubscriptionsListNextResponse = MonitoredSubscriptionPropertiesList; + +// @public +export interface MonitoredSubscriptionsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MonitoredSubscriptionsListResponse = MonitoredSubscriptionPropertiesList; + +// @public +export interface MonitoredSubscriptionsUpdateHeaders { + // (undocumented) + location?: string; +} + +// @public +export interface MonitoredSubscriptionsUpdateOptionalParams extends coreClient.OperationOptions { + body?: MonitoredSubscriptionProperties; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type MonitoredSubscriptionsUpdateResponse = MonitoredSubscriptionProperties; + // @public export type MonitoringStatus = string; +// @public +export interface MonitoringTagRulesProperties { + logRules?: LogRules; + metricRules?: MetricRules; + readonly provisioningState?: ProvisioningState; +} + // @public export interface Monitors { beginCreateOrUpdate(resourceGroupName: string, monitorName: string, resource: NewRelicMonitorResource, options?: MonitorsCreateOrUpdateOptionalParams): Promise, MonitorsCreateOrUpdateResponse>>; @@ -361,6 +568,7 @@ export interface Monitors { listByResourceGroup(resourceGroupName: string, options?: MonitorsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; listBySubscription(options?: MonitorsListBySubscriptionOptionalParams): PagedAsyncIterableIterator; listHosts(resourceGroupName: string, monitorName: string, request: HostsGetRequest, options?: MonitorsListHostsOptionalParams): PagedAsyncIterableIterator; + listLinkedResources(resourceGroupName: string, monitorName: string, options?: MonitorsListLinkedResourcesOptionalParams): PagedAsyncIterableIterator; listMonitoredResources(resourceGroupName: string, monitorName: string, options?: MonitorsListMonitoredResourcesOptionalParams): PagedAsyncIterableIterator; switchBilling(resourceGroupName: string, monitorName: string, request: SwitchBillingRequest, options?: MonitorsSwitchBillingOptionalParams): Promise; update(resourceGroupName: string, monitorName: string, properties: NewRelicMonitorResourceUpdate, options?: MonitorsUpdateOptionalParams): Promise; @@ -469,6 +677,20 @@ export interface MonitorsListHostsOptionalParams extends coreClient.OperationOpt // @public export type MonitorsListHostsResponse = VMHostsListResponse; +// @public +export interface MonitorsListLinkedResourcesNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MonitorsListLinkedResourcesNextResponse = LinkedResourceListResponse; + +// @public +export interface MonitorsListLinkedResourcesOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MonitorsListLinkedResourcesResponse = LinkedResourceListResponse; + // @public export interface MonitorsListMonitoredResourcesNextOptionalParams extends coreClient.OperationOptions { } @@ -562,6 +784,12 @@ export class NewRelicObservability extends coreClient.ServiceClient { // (undocumented) apiVersion: string; // (undocumented) + billingInfo: BillingInfo; + // (undocumented) + connectedPartnerResources: ConnectedPartnerResources; + // (undocumented) + monitoredSubscriptions: MonitoredSubscriptions; + // (undocumented) monitors: Monitors; // (undocumented) operations: Operations; @@ -675,6 +903,15 @@ export type OrgCreationSource = string; // @public export type Origin = string; +// @public +export interface PartnerBillingEntity { + organizationId?: string; + organizationName?: string; +} + +// @public +export type PatchOperation = string; + // @public export interface PlanData { billingCycle?: BillingCycle; @@ -753,6 +990,16 @@ export type SendSubscriptionLogsStatus = string; // @public export type SingleSignOnStates = string; +// @public +export type Status = string; + +// @public +export interface SubscriptionList { + monitoredSubscriptionList?: MonitoredSubscription[]; + patchOperation?: PatchOperation; + readonly provisioningState?: ProvisioningState; +} + // @public export interface SwitchBillingParameter { request: SwitchBillingRequest; diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/accountsListSample.ts b/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/accountsListSample.ts deleted file mode 100644 index 99f3702cf446..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/accountsListSample.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { NewRelicObservability } from "@azure/arm-newrelicobservability"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List all the existing accounts - * - * @summary List all the existing accounts - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Accounts_List_MaximumSet_Gen.json - */ -async function accountsListMaximumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "nqmcgifgaqlf"; - const userEmail = "ruxvg@xqkmdhrnoo.hlmbpm"; - const location = "egh"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.accounts.list(userEmail, location)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List all the existing accounts - * - * @summary List all the existing accounts - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Accounts_List_MinimumSet_Gen.json - */ -async function accountsListMinimumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "nqmcgifgaqlf"; - const userEmail = "ruxvg@xqkmdhrnoo.hlmbpm"; - const location = "egh"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.accounts.list(userEmail, location)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - accountsListMaximumSetGen(); - accountsListMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/monitorsCreateOrUpdateSample.ts b/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/monitorsCreateOrUpdateSample.ts deleted file mode 100644 index a16060bfd228..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/monitorsCreateOrUpdateSample.ts +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - NewRelicMonitorResource, - NewRelicObservability -} from "@azure/arm-newrelicobservability"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Create a NewRelicMonitorResource - * - * @summary Create a NewRelicMonitorResource - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_CreateOrUpdate_MaximumSet_Gen.json - */ -async function monitorsCreateOrUpdateMaximumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "hfmjmpyqgezxkp"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgNewRelic"; - const monitorName = "cdlymktqw"; - const resource: NewRelicMonitorResource = { - accountCreationSource: "LIFTR", - liftrResourceCategory: "Unknown", - location: "k", - marketplaceSubscriptionStatus: "Active", - monitoringStatus: "Enabled", - newRelicAccountProperties: { - accountInfo: { - accountId: "xhqmg", - ingestionKey: "wltnimmhqt", - region: "ljcf" - }, - organizationInfo: { organizationId: "k" }, - singleSignOnProperties: { - enterpriseAppId: "kwiwfz", - provisioningState: "Accepted", - singleSignOnState: "Initial", - singleSignOnUrl: "kvseueuljsxmfwpqctz" - }, - userId: "vcscxlncofcuduadesd" - }, - orgCreationSource: "LIFTR", - planData: { - billingCycle: "YEARLY", - effectiveDate: new Date("2022-12-05T14:11:37.786Z"), - planDetails: "tbbiaga", - usageType: "PAYG" - }, - provisioningState: "Accepted", - tags: { key6976: "oaxfhf" }, - userInfo: { - country: "hslqnwdanrconqyekwbnttaetv", - emailAddress: "%6%@4-g.N1.3F-kI1.Ue-.lJso", - firstName: "vdftzcggirefejajwahhwhyibutramdaotvnuf", - lastName: "bcsztgqovdlmzfkjdrngidwzqsevagexzzilnlc", - phoneNumber: "krf" - } - }; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.monitors.beginCreateOrUpdateAndWait( - resourceGroupName, - monitorName, - resource - ); - console.log(result); -} - -async function main() { - monitorsCreateOrUpdateMaximumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/monitorsDeleteSample.ts b/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/monitorsDeleteSample.ts deleted file mode 100644 index f9880c76a3cf..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/monitorsDeleteSample.ts +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { NewRelicObservability } from "@azure/arm-newrelicobservability"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Delete a NewRelicMonitorResource - * - * @summary Delete a NewRelicMonitorResource - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_Delete_MaximumSet_Gen.json - */ -async function monitorsDeleteMaximumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "ddqonpqwjr"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgopenapi"; - const userEmail = "ruxvg@xqkmdhrnoo.hlmbpm"; - const monitorName = "ipxmlcbonyxtolzejcjshkmlron"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.monitors.beginDeleteAndWait( - resourceGroupName, - userEmail, - monitorName - ); - console.log(result); -} - -/** - * This sample demonstrates how to Delete a NewRelicMonitorResource - * - * @summary Delete a NewRelicMonitorResource - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_Delete_MinimumSet_Gen.json - */ -async function monitorsDeleteMinimumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "ddqonpqwjr"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgopenapi"; - const userEmail = "ruxvg@xqkmdhrnoo.hlmbpm"; - const monitorName = "ipxmlcbonyxtolzejcjshkmlron"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.monitors.beginDeleteAndWait( - resourceGroupName, - userEmail, - monitorName - ); - console.log(result); -} - -async function main() { - monitorsDeleteMaximumSetGen(); - monitorsDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/monitorsGetMetricRulesSample.ts b/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/monitorsGetMetricRulesSample.ts deleted file mode 100644 index a25ff34b59a7..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/monitorsGetMetricRulesSample.ts +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - MetricsRequest, - NewRelicObservability -} from "@azure/arm-newrelicobservability"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get metric rules - * - * @summary Get metric rules - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_GetMetricRules_MaximumSet_Gen.json - */ -async function monitorsGetMetricRulesMaximumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "nqmcgifgaqlf"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgNewRelic"; - const monitorName = "fhcjxnxumkdlgpwanewtkdnyuz"; - const request: MetricsRequest = { userEmail: "ruxvg@xqkmdhrnoo.hlmbpm" }; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.monitors.getMetricRules( - resourceGroupName, - monitorName, - request - ); - console.log(result); -} - -/** - * This sample demonstrates how to Get metric rules - * - * @summary Get metric rules - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_GetMetricRules_MinimumSet_Gen.json - */ -async function monitorsGetMetricRulesMinimumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "nqmcgifgaqlf"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgNewRelic"; - const monitorName = "fhcjxnxumkdlgpwanewtkdnyuz"; - const request: MetricsRequest = { userEmail: "ruxvg@xqkmdhrnoo.hlmbpm" }; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.monitors.getMetricRules( - resourceGroupName, - monitorName, - request - ); - console.log(result); -} - -async function main() { - monitorsGetMetricRulesMaximumSetGen(); - monitorsGetMetricRulesMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/monitorsGetMetricStatusSample.ts b/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/monitorsGetMetricStatusSample.ts deleted file mode 100644 index 5df6ca2a184e..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/monitorsGetMetricStatusSample.ts +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - MetricsStatusRequest, - NewRelicObservability -} from "@azure/arm-newrelicobservability"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get metric status - * - * @summary Get metric status - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_GetMetricStatus_MaximumSet_Gen.json - */ -async function monitorsGetMetricStatusMaximumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "nqmcgifgaqlf"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgNewRelic"; - const monitorName = "fhcjxnxumkdlgpwanewtkdnyuz"; - const request: MetricsStatusRequest = { - azureResourceIds: ["enfghpfw"], - userEmail: "ruxvg@xqkmdhrnoo.hlmbpm" - }; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.monitors.getMetricStatus( - resourceGroupName, - monitorName, - request - ); - console.log(result); -} - -/** - * This sample demonstrates how to Get metric status - * - * @summary Get metric status - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_GetMetricStatus_MinimumSet_Gen.json - */ -async function monitorsGetMetricStatusMinimumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "nqmcgifgaqlf"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgNewRelic"; - const monitorName = "fhcjxnxumkdlgpwanewtkdnyuz"; - const request: MetricsStatusRequest = { - userEmail: "ruxvg@xqkmdhrnoo.hlmbpm" - }; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.monitors.getMetricStatus( - resourceGroupName, - monitorName, - request - ); - console.log(result); -} - -async function main() { - monitorsGetMetricStatusMaximumSetGen(); - monitorsGetMetricStatusMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/monitorsGetSample.ts b/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/monitorsGetSample.ts deleted file mode 100644 index 736fe637f7db..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/monitorsGetSample.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { NewRelicObservability } from "@azure/arm-newrelicobservability"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get a NewRelicMonitorResource - * - * @summary Get a NewRelicMonitorResource - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_Get_MaximumSet_Gen.json - */ -async function monitorsGetMaximumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "hfmjmpyqgezxkp"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgNewRelic"; - const monitorName = "cdlymktqw"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.monitors.get(resourceGroupName, monitorName); - console.log(result); -} - -async function main() { - monitorsGetMaximumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/monitorsListAppServicesSample.ts b/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/monitorsListAppServicesSample.ts deleted file mode 100644 index 04dcf08713ba..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/monitorsListAppServicesSample.ts +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - AppServicesGetRequest, - NewRelicObservability -} from "@azure/arm-newrelicobservability"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List the app service resources currently being monitored by the NewRelic resource. - * - * @summary List the app service resources currently being monitored by the NewRelic resource. - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListAppServices_MaximumSet_Gen.json - */ -async function monitorsListAppServicesMaximumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "nqmcgifgaqlf"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgNewRelic"; - const monitorName = "fhcjxnxumkdlgpwanewtkdnyuz"; - const request: AppServicesGetRequest = { - azureResourceIds: ["pvzrksrmzowobuhxpwiotnpcvjbu"], - userEmail: "ruxvg@xqkmdhrnoo.hlmbpm" - }; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.monitors.listAppServices( - resourceGroupName, - monitorName, - request - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List the app service resources currently being monitored by the NewRelic resource. - * - * @summary List the app service resources currently being monitored by the NewRelic resource. - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListAppServices_MinimumSet_Gen.json - */ -async function monitorsListAppServicesMinimumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "nqmcgifgaqlf"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgNewRelic"; - const monitorName = "fhcjxnxumkdlgpwanewtkdnyuz"; - const request: AppServicesGetRequest = { - userEmail: "ruxvg@xqkmdhrnoo.hlmbpm" - }; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.monitors.listAppServices( - resourceGroupName, - monitorName, - request - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - monitorsListAppServicesMaximumSetGen(); - monitorsListAppServicesMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/monitorsListByResourceGroupSample.ts b/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/monitorsListByResourceGroupSample.ts deleted file mode 100644 index f4915e862368..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/monitorsListByResourceGroupSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { NewRelicObservability } from "@azure/arm-newrelicobservability"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List NewRelicMonitorResource resources by resource group - * - * @summary List NewRelicMonitorResource resources by resource group - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListByResourceGroup_MaximumSet_Gen.json - */ -async function monitorsListByResourceGroupMaximumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "hfmjmpyqgezxkp"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgNewRelic"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.monitors.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - monitorsListByResourceGroupMaximumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/monitorsListBySubscriptionSample.ts b/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/monitorsListBySubscriptionSample.ts deleted file mode 100644 index 4a6cdd813248..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/monitorsListBySubscriptionSample.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { NewRelicObservability } from "@azure/arm-newrelicobservability"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List NewRelicMonitorResource resources by subscription ID - * - * @summary List NewRelicMonitorResource resources by subscription ID - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListBySubscription_MaximumSet_Gen.json - */ -async function monitorsListBySubscriptionMaximumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "hfmjmpyqgezxkp"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.monitors.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - monitorsListBySubscriptionMaximumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/monitorsListHostsSample.ts b/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/monitorsListHostsSample.ts deleted file mode 100644 index bdb591af2de1..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/monitorsListHostsSample.ts +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - HostsGetRequest, - NewRelicObservability -} from "@azure/arm-newrelicobservability"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List the compute vm resources currently being monitored by the NewRelic resource. - * - * @summary List the compute vm resources currently being monitored by the NewRelic resource. - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListHosts_MaximumSet_Gen.json - */ -async function monitorsListHostsMaximumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "ddqonpqwjr"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgopenapi"; - const monitorName = "ipxmlcbonyxtolzejcjshkmlron"; - const request: HostsGetRequest = { - userEmail: "ruxvg@xqkmdhrnoo.hlmbpm", - vmIds: ["xzphvxvfmvjrnsgyns"] - }; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.monitors.listHosts( - resourceGroupName, - monitorName, - request - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List the compute vm resources currently being monitored by the NewRelic resource. - * - * @summary List the compute vm resources currently being monitored by the NewRelic resource. - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListHosts_MinimumSet_Gen.json - */ -async function monitorsListHostsMinimumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "ddqonpqwjr"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgopenapi"; - const monitorName = "ipxmlcbonyxtolzejcjshkmlron"; - const request: HostsGetRequest = { - userEmail: "ruxvg@xqkmdhrnoo.hlmbpm", - vmIds: ["xzphvxvfmvjrnsgyns"] - }; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.monitors.listHosts( - resourceGroupName, - monitorName, - request - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - monitorsListHostsMaximumSetGen(); - monitorsListHostsMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/monitorsListMonitoredResourcesSample.ts b/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/monitorsListMonitoredResourcesSample.ts deleted file mode 100644 index d25abd9a0214..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/monitorsListMonitoredResourcesSample.ts +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { NewRelicObservability } from "@azure/arm-newrelicobservability"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List the resources currently being monitored by the NewRelic monitor resource. - * - * @summary List the resources currently being monitored by the NewRelic monitor resource. - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListMonitoredResources_MaximumSet_Gen.json - */ -async function monitorsListMonitoredResourcesMaximumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "ddqonpqwjr"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgopenapi"; - const monitorName = "ipxmlcbonyxtolzejcjshkmlron"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.monitors.listMonitoredResources( - resourceGroupName, - monitorName - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List the resources currently being monitored by the NewRelic monitor resource. - * - * @summary List the resources currently being monitored by the NewRelic monitor resource. - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListMonitoredResources_MinimumSet_Gen.json - */ -async function monitorsListMonitoredResourcesMinimumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "ddqonpqwjr"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgopenapi"; - const monitorName = "ipxmlcbonyxtolzejcjshkmlron"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.monitors.listMonitoredResources( - resourceGroupName, - monitorName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - monitorsListMonitoredResourcesMaximumSetGen(); - monitorsListMonitoredResourcesMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/monitorsSwitchBillingSample.ts b/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/monitorsSwitchBillingSample.ts deleted file mode 100644 index c72eb08c245f..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/monitorsSwitchBillingSample.ts +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - SwitchBillingRequest, - NewRelicObservability -} from "@azure/arm-newrelicobservability"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Switches the billing for NewRelic monitor resource. - * - * @summary Switches the billing for NewRelic monitor resource. - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_SwitchBilling_MaximumSet_Gen.json - */ -async function monitorsSwitchBillingMaximumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "nqmcgifgaqlf"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgNewRelic"; - const monitorName = "fhcjxnxumkdlgpwanewtkdnyuz"; - const request: SwitchBillingRequest = { - azureResourceId: "enfghpfw", - organizationId: "k", - planData: { - billingCycle: "YEARLY", - effectiveDate: new Date("2022-12-05T14:11:37.786Z"), - planDetails: "tbbiaga", - usageType: "PAYG" - }, - userEmail: "ruxvg@xqkmdhrnoo.hlmbpm" - }; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.monitors.switchBilling( - resourceGroupName, - monitorName, - request - ); - console.log(result); -} - -/** - * This sample demonstrates how to Switches the billing for NewRelic monitor resource. - * - * @summary Switches the billing for NewRelic monitor resource. - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_SwitchBilling_MinimumSet_Gen.json - */ -async function monitorsSwitchBillingMinimumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "nqmcgifgaqlf"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgNewRelic"; - const monitorName = "fhcjxnxumkdlgpwanewtkdnyuz"; - const request: SwitchBillingRequest = { - userEmail: "ruxvg@xqkmdhrnoo.hlmbpm" - }; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.monitors.switchBilling( - resourceGroupName, - monitorName, - request - ); - console.log(result); -} - -async function main() { - monitorsSwitchBillingMaximumSetGen(); - monitorsSwitchBillingMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/monitorsUpdateSample.ts b/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/monitorsUpdateSample.ts deleted file mode 100644 index 9086f6911dfc..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/monitorsUpdateSample.ts +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - NewRelicMonitorResourceUpdate, - NewRelicObservability -} from "@azure/arm-newrelicobservability"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Update a NewRelicMonitorResource - * - * @summary Update a NewRelicMonitorResource - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_Update_MaximumSet_Gen.json - */ -async function monitorsUpdateMaximumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "hfmjmpyqgezxkp"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgNewRelic"; - const monitorName = "cdlymktqw"; - const properties: NewRelicMonitorResourceUpdate = { - accountCreationSource: "LIFTR", - identity: { type: "None", userAssignedIdentities: { key8903: {} } }, - newRelicAccountProperties: { - accountInfo: { - accountId: "xhqmg", - ingestionKey: "wltnimmhqt", - region: "ljcf" - }, - organizationInfo: { organizationId: "k" }, - singleSignOnProperties: { - enterpriseAppId: "kwiwfz", - provisioningState: "Accepted", - singleSignOnState: "Initial", - singleSignOnUrl: "kvseueuljsxmfwpqctz" - }, - userId: "vcscxlncofcuduadesd" - }, - orgCreationSource: "LIFTR", - planData: { - billingCycle: "YEARLY", - effectiveDate: new Date("2022-12-05T14:11:37.786Z"), - planDetails: "tbbiaga", - usageType: "PAYG" - }, - tags: { key164: "jqakdrrmmyzytqu" }, - userInfo: { - country: "hslqnwdanrconqyekwbnttaetv", - emailAddress: "%6%@4-g.N1.3F-kI1.Ue-.lJso", - firstName: "vdftzcggirefejajwahhwhyibutramdaotvnuf", - lastName: "bcsztgqovdlmzfkjdrngidwzqsevagexzzilnlc", - phoneNumber: "krf" - } - }; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.monitors.update( - resourceGroupName, - monitorName, - properties - ); - console.log(result); -} - -async function main() { - monitorsUpdateMaximumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/monitorsVMHostPayloadSample.ts b/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/monitorsVMHostPayloadSample.ts deleted file mode 100644 index 9e04ef9c8f3b..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/monitorsVMHostPayloadSample.ts +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { NewRelicObservability } from "@azure/arm-newrelicobservability"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Returns the payload that needs to be passed in the request body for installing NewRelic agent on a VM. - * - * @summary Returns the payload that needs to be passed in the request body for installing NewRelic agent on a VM. - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_VmHostPayload_MaximumSet_Gen.json - */ -async function monitorsVMHostPayloadMaximumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "ddqonpqwjr"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgopenapi"; - const monitorName = "ipxmlcbonyxtolzejcjshkmlron"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.monitors.vmHostPayload( - resourceGroupName, - monitorName - ); - console.log(result); -} - -/** - * This sample demonstrates how to Returns the payload that needs to be passed in the request body for installing NewRelic agent on a VM. - * - * @summary Returns the payload that needs to be passed in the request body for installing NewRelic agent on a VM. - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_VmHostPayload_MinimumSet_Gen.json - */ -async function monitorsVMHostPayloadMinimumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "ddqonpqwjr"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgopenapi"; - const monitorName = "ipxmlcbonyxtolzejcjshkmlron"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.monitors.vmHostPayload( - resourceGroupName, - monitorName - ); - console.log(result); -} - -async function main() { - monitorsVMHostPayloadMaximumSetGen(); - monitorsVMHostPayloadMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/operationsListSample.ts b/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/operationsListSample.ts deleted file mode 100644 index 7901f82878ec..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/operationsListSample.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { NewRelicObservability } from "@azure/arm-newrelicobservability"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List the operations for the provider - * - * @summary List the operations for the provider - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Operations_List_MaximumSet_Gen.json - */ -async function operationsListMaximumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List the operations for the provider - * - * @summary List the operations for the provider - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Operations_List_MinimumSet_Gen.json - */ -async function operationsListMinimumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - operationsListMaximumSetGen(); - operationsListMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/organizationsListSample.ts b/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/organizationsListSample.ts deleted file mode 100644 index 1cf2432c023b..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/organizationsListSample.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { NewRelicObservability } from "@azure/arm-newrelicobservability"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List all the existing organizations - * - * @summary List all the existing organizations - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Organizations_List_MaximumSet_Gen.json - */ -async function organizationsListMaximumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "nqmcgifgaqlf"; - const userEmail = "ruxvg@xqkmdhrnoo.hlmbpm"; - const location = "egh"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.organizations.list(userEmail, location)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List all the existing organizations - * - * @summary List all the existing organizations - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Organizations_List_MinimumSet_Gen.json - */ -async function organizationsListMinimumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "nqmcgifgaqlf"; - const userEmail = "ruxvg@xqkmdhrnoo.hlmbpm"; - const location = "egh"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.organizations.list(userEmail, location)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - organizationsListMaximumSetGen(); - organizationsListMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/plansListSample.ts b/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/plansListSample.ts deleted file mode 100644 index c74ca81bd59d..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/plansListSample.ts +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - PlansListOptionalParams, - NewRelicObservability -} from "@azure/arm-newrelicobservability"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List plans data - * - * @summary List plans data - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Plans_List_MaximumSet_Gen.json - */ -async function plansListMaximumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "hfmjmpyqgezxkp"; - const accountId = "pwuxgvrmkk"; - const organizationId = "hilawwjz"; - const options: PlansListOptionalParams = { accountId, organizationId }; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.plans.list(options)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List plans data - * - * @summary List plans data - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Plans_List_MinimumSet_Gen.json - */ -async function plansListMinimumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "nqmcgifgaqlf"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.plans.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - plansListMaximumSetGen(); - plansListMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/tagRulesCreateOrUpdateSample.ts b/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/tagRulesCreateOrUpdateSample.ts deleted file mode 100644 index f2b5ff1b9981..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/tagRulesCreateOrUpdateSample.ts +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - TagRule, - NewRelicObservability -} from "@azure/arm-newrelicobservability"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Create a TagRule - * - * @summary Create a TagRule - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_CreateOrUpdate_MaximumSet_Gen.json - */ -async function tagRulesCreateOrUpdateMaximumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "ddqonpqwjr"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgopenapi"; - const monitorName = "ipxmlcbonyxtolzejcjshkmlron"; - const ruleSetName = "bxcantgzggsepbhqmedjqyrqeezmfb"; - const resource: TagRule = { - logRules: { - filteringTags: [ - { - name: "saokgpjvdlorciqbjmjxazpee", - action: "Include", - value: "sarxrqsxouhdjwsrqqicbeirdb" - } - ], - sendAadLogs: "Enabled", - sendActivityLogs: "Enabled", - sendSubscriptionLogs: "Enabled" - }, - metricRules: { - filteringTags: [ - { - name: "saokgpjvdlorciqbjmjxazpee", - action: "Include", - value: "sarxrqsxouhdjwsrqqicbeirdb" - } - ], - userEmail: "test@testing.com" - }, - provisioningState: "Accepted" - }; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.tagRules.beginCreateOrUpdateAndWait( - resourceGroupName, - monitorName, - ruleSetName, - resource - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create a TagRule - * - * @summary Create a TagRule - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_CreateOrUpdate_MinimumSet_Gen.json - */ -async function tagRulesCreateOrUpdateMinimumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "ddqonpqwjr"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgopenapi"; - const monitorName = "ipxmlcbonyxtolzejcjshkmlron"; - const ruleSetName = "bxcantgzggsepbhqmedjqyrqeezmfb"; - const resource: TagRule = {}; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.tagRules.beginCreateOrUpdateAndWait( - resourceGroupName, - monitorName, - ruleSetName, - resource - ); - console.log(result); -} - -async function main() { - tagRulesCreateOrUpdateMaximumSetGen(); - tagRulesCreateOrUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/tagRulesDeleteSample.ts b/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/tagRulesDeleteSample.ts deleted file mode 100644 index dcdb3bf905a7..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/tagRulesDeleteSample.ts +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { NewRelicObservability } from "@azure/arm-newrelicobservability"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Delete a TagRule - * - * @summary Delete a TagRule - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Delete_MaximumSet_Gen.json - */ -async function tagRulesDeleteMaximumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "ddqonpqwjr"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgopenapi"; - const monitorName = "ipxmlcbonyxtolzejcjshkmlron"; - const ruleSetName = "bxcantgzggsepbhqmedjqyrqeezmfb"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.tagRules.beginDeleteAndWait( - resourceGroupName, - monitorName, - ruleSetName - ); - console.log(result); -} - -/** - * This sample demonstrates how to Delete a TagRule - * - * @summary Delete a TagRule - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Delete_MinimumSet_Gen.json - */ -async function tagRulesDeleteMinimumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "ddqonpqwjr"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgopenapi"; - const monitorName = "ipxmlcbonyxtolzejcjshkmlron"; - const ruleSetName = "bxcantgzggsepbhqmedjqyrqeezmfb"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.tagRules.beginDeleteAndWait( - resourceGroupName, - monitorName, - ruleSetName - ); - console.log(result); -} - -async function main() { - tagRulesDeleteMaximumSetGen(); - tagRulesDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/tagRulesGetSample.ts b/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/tagRulesGetSample.ts deleted file mode 100644 index 046a6f4173f3..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/tagRulesGetSample.ts +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { NewRelicObservability } from "@azure/arm-newrelicobservability"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get a TagRule - * - * @summary Get a TagRule - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Get_MaximumSet_Gen.json - */ -async function tagRulesGetMaximumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "ddqonpqwjr"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgopenapi"; - const monitorName = "ipxmlcbonyxtolzejcjshkmlron"; - const ruleSetName = "bxcantgzggsepbhqmedjqyrqeezmfb"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.tagRules.get( - resourceGroupName, - monitorName, - ruleSetName - ); - console.log(result); -} - -/** - * This sample demonstrates how to Get a TagRule - * - * @summary Get a TagRule - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Get_MinimumSet_Gen.json - */ -async function tagRulesGetMinimumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "ddqonpqwjr"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgopenapi"; - const monitorName = "ipxmlcbonyxtolzejcjshkmlron"; - const ruleSetName = "bxcantgzggsepbhqmedjqyrqeezmfb"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.tagRules.get( - resourceGroupName, - monitorName, - ruleSetName - ); - console.log(result); -} - -async function main() { - tagRulesGetMaximumSetGen(); - tagRulesGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/tagRulesListByNewRelicMonitorResourceSample.ts b/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/tagRulesListByNewRelicMonitorResourceSample.ts deleted file mode 100644 index 011ed0a27f33..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/tagRulesListByNewRelicMonitorResourceSample.ts +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { NewRelicObservability } from "@azure/arm-newrelicobservability"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List TagRule resources by NewRelicMonitorResource - * - * @summary List TagRule resources by NewRelicMonitorResource - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_ListByNewRelicMonitorResource_MaximumSet_Gen.json - */ -async function tagRulesListByNewRelicMonitorResourceMaximumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "ddqonpqwjr"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgopenapi"; - const monitorName = "ipxmlcbonyxtolzejcjshkmlron"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.tagRules.listByNewRelicMonitorResource( - resourceGroupName, - monitorName - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List TagRule resources by NewRelicMonitorResource - * - * @summary List TagRule resources by NewRelicMonitorResource - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_ListByNewRelicMonitorResource_MinimumSet_Gen.json - */ -async function tagRulesListByNewRelicMonitorResourceMinimumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "ddqonpqwjr"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgopenapi"; - const monitorName = "ipxmlcbonyxtolzejcjshkmlron"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.tagRules.listByNewRelicMonitorResource( - resourceGroupName, - monitorName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - tagRulesListByNewRelicMonitorResourceMaximumSetGen(); - tagRulesListByNewRelicMonitorResourceMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/tagRulesUpdateSample.ts b/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/tagRulesUpdateSample.ts deleted file mode 100644 index 12b176a63e2b..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples-dev/tagRulesUpdateSample.ts +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - TagRuleUpdate, - NewRelicObservability -} from "@azure/arm-newrelicobservability"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Update a TagRule - * - * @summary Update a TagRule - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Update_MaximumSet_Gen.json - */ -async function tagRulesUpdateMaximumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "ddqonpqwjr"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgopenapi"; - const monitorName = "ipxmlcbonyxtolzejcjshkmlron"; - const ruleSetName = "bxcantgzggsepbhqmedjqyrqeezmfb"; - const properties: TagRuleUpdate = { - logRules: { - filteringTags: [ - { - name: "saokgpjvdlorciqbjmjxazpee", - action: "Include", - value: "sarxrqsxouhdjwsrqqicbeirdb" - } - ], - sendAadLogs: "Enabled", - sendActivityLogs: "Enabled", - sendSubscriptionLogs: "Enabled" - }, - metricRules: { - filteringTags: [ - { - name: "saokgpjvdlorciqbjmjxazpee", - action: "Include", - value: "sarxrqsxouhdjwsrqqicbeirdb" - } - ], - userEmail: "test@testing.com" - } - }; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.tagRules.update( - resourceGroupName, - monitorName, - ruleSetName, - properties - ); - console.log(result); -} - -/** - * This sample demonstrates how to Update a TagRule - * - * @summary Update a TagRule - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Update_MinimumSet_Gen.json - */ -async function tagRulesUpdateMinimumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "ddqonpqwjr"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgopenapi"; - const monitorName = "ipxmlcbonyxtolzejcjshkmlron"; - const ruleSetName = "bxcantgzggsepbhqmedjqyrqeezmfb"; - const properties: TagRuleUpdate = {}; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.tagRules.update( - resourceGroupName, - monitorName, - ruleSetName, - properties - ); - console.log(result); -} - -async function main() { - tagRulesUpdateMaximumSetGen(); - tagRulesUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/README.md b/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/README.md deleted file mode 100644 index 30a0763ee738..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/README.md +++ /dev/null @@ -1,92 +0,0 @@ -# client library samples for JavaScript - -These sample programs show how to use the JavaScript client libraries for in some common scenarios. - -| **File Name** | **Description** | -| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [accountsListSample.js][accountslistsample] | List all the existing accounts x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Accounts_List_MaximumSet_Gen.json | -| [monitorsCreateOrUpdateSample.js][monitorscreateorupdatesample] | Create a NewRelicMonitorResource x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_CreateOrUpdate_MaximumSet_Gen.json | -| [monitorsDeleteSample.js][monitorsdeletesample] | Delete a NewRelicMonitorResource x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_Delete_MaximumSet_Gen.json | -| [monitorsGetMetricRulesSample.js][monitorsgetmetricrulessample] | Get metric rules x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_GetMetricRules_MaximumSet_Gen.json | -| [monitorsGetMetricStatusSample.js][monitorsgetmetricstatussample] | Get metric status x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_GetMetricStatus_MaximumSet_Gen.json | -| [monitorsGetSample.js][monitorsgetsample] | Get a NewRelicMonitorResource x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_Get_MaximumSet_Gen.json | -| [monitorsListAppServicesSample.js][monitorslistappservicessample] | List the app service resources currently being monitored by the NewRelic resource. x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListAppServices_MaximumSet_Gen.json | -| [monitorsListByResourceGroupSample.js][monitorslistbyresourcegroupsample] | List NewRelicMonitorResource resources by resource group x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListByResourceGroup_MaximumSet_Gen.json | -| [monitorsListBySubscriptionSample.js][monitorslistbysubscriptionsample] | List NewRelicMonitorResource resources by subscription ID x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListBySubscription_MaximumSet_Gen.json | -| [monitorsListHostsSample.js][monitorslisthostssample] | List the compute vm resources currently being monitored by the NewRelic resource. x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListHosts_MaximumSet_Gen.json | -| [monitorsListMonitoredResourcesSample.js][monitorslistmonitoredresourcessample] | List the resources currently being monitored by the NewRelic monitor resource. x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListMonitoredResources_MaximumSet_Gen.json | -| [monitorsSwitchBillingSample.js][monitorsswitchbillingsample] | Switches the billing for NewRelic monitor resource. x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_SwitchBilling_MaximumSet_Gen.json | -| [monitorsUpdateSample.js][monitorsupdatesample] | Update a NewRelicMonitorResource x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_Update_MaximumSet_Gen.json | -| [monitorsVMHostPayloadSample.js][monitorsvmhostpayloadsample] | Returns the payload that needs to be passed in the request body for installing NewRelic agent on a VM. x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_VmHostPayload_MaximumSet_Gen.json | -| [operationsListSample.js][operationslistsample] | List the operations for the provider x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Operations_List_MaximumSet_Gen.json | -| [organizationsListSample.js][organizationslistsample] | List all the existing organizations x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Organizations_List_MaximumSet_Gen.json | -| [plansListSample.js][planslistsample] | List plans data x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Plans_List_MaximumSet_Gen.json | -| [tagRulesCreateOrUpdateSample.js][tagrulescreateorupdatesample] | Create a TagRule x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_CreateOrUpdate_MaximumSet_Gen.json | -| [tagRulesDeleteSample.js][tagrulesdeletesample] | Delete a TagRule x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Delete_MaximumSet_Gen.json | -| [tagRulesGetSample.js][tagrulesgetsample] | Get a TagRule x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Get_MaximumSet_Gen.json | -| [tagRulesListByNewRelicMonitorResourceSample.js][tagruleslistbynewrelicmonitorresourcesample] | List TagRule resources by NewRelicMonitorResource x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_ListByNewRelicMonitorResource_MaximumSet_Gen.json | -| [tagRulesUpdateSample.js][tagrulesupdatesample] | Update a TagRule x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Update_MaximumSet_Gen.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -3. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node accountsListSample.js -``` - -Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): - -```bash -npx cross-env NEWRELICOBSERVABILITY_SUBSCRIPTION_ID="" NEWRELICOBSERVABILITY_SUBSCRIPTION_ID="" node accountsListSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[accountslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/accountsListSample.js -[monitorscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/monitorsCreateOrUpdateSample.js -[monitorsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/monitorsDeleteSample.js -[monitorsgetmetricrulessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/monitorsGetMetricRulesSample.js -[monitorsgetmetricstatussample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/monitorsGetMetricStatusSample.js -[monitorsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/monitorsGetSample.js -[monitorslistappservicessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/monitorsListAppServicesSample.js -[monitorslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/monitorsListByResourceGroupSample.js -[monitorslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/monitorsListBySubscriptionSample.js -[monitorslisthostssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/monitorsListHostsSample.js -[monitorslistmonitoredresourcessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/monitorsListMonitoredResourcesSample.js -[monitorsswitchbillingsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/monitorsSwitchBillingSample.js -[monitorsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/monitorsUpdateSample.js -[monitorsvmhostpayloadsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/monitorsVMHostPayloadSample.js -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/operationsListSample.js -[organizationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/organizationsListSample.js -[planslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/plansListSample.js -[tagrulescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/tagRulesCreateOrUpdateSample.js -[tagrulesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/tagRulesDeleteSample.js -[tagrulesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/tagRulesGetSample.js -[tagruleslistbynewrelicmonitorresourcesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/tagRulesListByNewRelicMonitorResourceSample.js -[tagrulesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/tagRulesUpdateSample.js -[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-newrelicobservability?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/newrelicobservability/arm-newrelicobservability/README.md diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/accountsListSample.js b/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/accountsListSample.js deleted file mode 100644 index e2e566eaf33b..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/accountsListSample.js +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { NewRelicObservability } = require("@azure/arm-newrelicobservability"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List all the existing accounts - * - * @summary List all the existing accounts - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Accounts_List_MaximumSet_Gen.json - */ -async function accountsListMaximumSetGen() { - const subscriptionId = process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "nqmcgifgaqlf"; - const userEmail = "ruxvg@xqkmdhrnoo.hlmbpm"; - const location = "egh"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.accounts.list(userEmail, location)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List all the existing accounts - * - * @summary List all the existing accounts - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Accounts_List_MinimumSet_Gen.json - */ -async function accountsListMinimumSetGen() { - const subscriptionId = process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "nqmcgifgaqlf"; - const userEmail = "ruxvg@xqkmdhrnoo.hlmbpm"; - const location = "egh"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.accounts.list(userEmail, location)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - accountsListMaximumSetGen(); - accountsListMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/monitorsCreateOrUpdateSample.js b/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/monitorsCreateOrUpdateSample.js deleted file mode 100644 index 7bfaf53c40de..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/monitorsCreateOrUpdateSample.js +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { NewRelicObservability } = require("@azure/arm-newrelicobservability"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Create a NewRelicMonitorResource - * - * @summary Create a NewRelicMonitorResource - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_CreateOrUpdate_MaximumSet_Gen.json - */ -async function monitorsCreateOrUpdateMaximumSetGen() { - const subscriptionId = process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "hfmjmpyqgezxkp"; - const resourceGroupName = process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgNewRelic"; - const monitorName = "cdlymktqw"; - const resource = { - accountCreationSource: "LIFTR", - liftrResourceCategory: "Unknown", - location: "k", - marketplaceSubscriptionStatus: "Active", - monitoringStatus: "Enabled", - newRelicAccountProperties: { - accountInfo: { - accountId: "xhqmg", - ingestionKey: "wltnimmhqt", - region: "ljcf", - }, - organizationInfo: { organizationId: "k" }, - singleSignOnProperties: { - enterpriseAppId: "kwiwfz", - provisioningState: "Accepted", - singleSignOnState: "Initial", - singleSignOnUrl: "kvseueuljsxmfwpqctz", - }, - userId: "vcscxlncofcuduadesd", - }, - orgCreationSource: "LIFTR", - planData: { - billingCycle: "YEARLY", - effectiveDate: new Date("2022-12-05T14:11:37.786Z"), - planDetails: "tbbiaga", - usageType: "PAYG", - }, - provisioningState: "Accepted", - tags: { key6976: "oaxfhf" }, - userInfo: { - country: "hslqnwdanrconqyekwbnttaetv", - emailAddress: "%6%@4-g.N1.3F-kI1.Ue-.lJso", - firstName: "vdftzcggirefejajwahhwhyibutramdaotvnuf", - lastName: "bcsztgqovdlmzfkjdrngidwzqsevagexzzilnlc", - phoneNumber: "krf", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.monitors.beginCreateOrUpdateAndWait( - resourceGroupName, - monitorName, - resource - ); - console.log(result); -} - -async function main() { - monitorsCreateOrUpdateMaximumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/monitorsDeleteSample.js b/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/monitorsDeleteSample.js deleted file mode 100644 index c2cb4dbfafa0..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/monitorsDeleteSample.js +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { NewRelicObservability } = require("@azure/arm-newrelicobservability"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Delete a NewRelicMonitorResource - * - * @summary Delete a NewRelicMonitorResource - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_Delete_MaximumSet_Gen.json - */ -async function monitorsDeleteMaximumSetGen() { - const subscriptionId = process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "ddqonpqwjr"; - const resourceGroupName = process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgopenapi"; - const userEmail = "ruxvg@xqkmdhrnoo.hlmbpm"; - const monitorName = "ipxmlcbonyxtolzejcjshkmlron"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.monitors.beginDeleteAndWait( - resourceGroupName, - userEmail, - monitorName - ); - console.log(result); -} - -/** - * This sample demonstrates how to Delete a NewRelicMonitorResource - * - * @summary Delete a NewRelicMonitorResource - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_Delete_MinimumSet_Gen.json - */ -async function monitorsDeleteMinimumSetGen() { - const subscriptionId = process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "ddqonpqwjr"; - const resourceGroupName = process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgopenapi"; - const userEmail = "ruxvg@xqkmdhrnoo.hlmbpm"; - const monitorName = "ipxmlcbonyxtolzejcjshkmlron"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.monitors.beginDeleteAndWait( - resourceGroupName, - userEmail, - monitorName - ); - console.log(result); -} - -async function main() { - monitorsDeleteMaximumSetGen(); - monitorsDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/monitorsGetMetricRulesSample.js b/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/monitorsGetMetricRulesSample.js deleted file mode 100644 index 7d56c078a221..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/monitorsGetMetricRulesSample.js +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { NewRelicObservability } = require("@azure/arm-newrelicobservability"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get metric rules - * - * @summary Get metric rules - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_GetMetricRules_MaximumSet_Gen.json - */ -async function monitorsGetMetricRulesMaximumSetGen() { - const subscriptionId = process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "nqmcgifgaqlf"; - const resourceGroupName = process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgNewRelic"; - const monitorName = "fhcjxnxumkdlgpwanewtkdnyuz"; - const request = { userEmail: "ruxvg@xqkmdhrnoo.hlmbpm" }; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.monitors.getMetricRules(resourceGroupName, monitorName, request); - console.log(result); -} - -/** - * This sample demonstrates how to Get metric rules - * - * @summary Get metric rules - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_GetMetricRules_MinimumSet_Gen.json - */ -async function monitorsGetMetricRulesMinimumSetGen() { - const subscriptionId = process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "nqmcgifgaqlf"; - const resourceGroupName = process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgNewRelic"; - const monitorName = "fhcjxnxumkdlgpwanewtkdnyuz"; - const request = { userEmail: "ruxvg@xqkmdhrnoo.hlmbpm" }; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.monitors.getMetricRules(resourceGroupName, monitorName, request); - console.log(result); -} - -async function main() { - monitorsGetMetricRulesMaximumSetGen(); - monitorsGetMetricRulesMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/monitorsGetMetricStatusSample.js b/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/monitorsGetMetricStatusSample.js deleted file mode 100644 index cb635951047a..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/monitorsGetMetricStatusSample.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { NewRelicObservability } = require("@azure/arm-newrelicobservability"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get metric status - * - * @summary Get metric status - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_GetMetricStatus_MaximumSet_Gen.json - */ -async function monitorsGetMetricStatusMaximumSetGen() { - const subscriptionId = process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "nqmcgifgaqlf"; - const resourceGroupName = process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgNewRelic"; - const monitorName = "fhcjxnxumkdlgpwanewtkdnyuz"; - const request = { - azureResourceIds: ["enfghpfw"], - userEmail: "ruxvg@xqkmdhrnoo.hlmbpm", - }; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.monitors.getMetricStatus(resourceGroupName, monitorName, request); - console.log(result); -} - -/** - * This sample demonstrates how to Get metric status - * - * @summary Get metric status - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_GetMetricStatus_MinimumSet_Gen.json - */ -async function monitorsGetMetricStatusMinimumSetGen() { - const subscriptionId = process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "nqmcgifgaqlf"; - const resourceGroupName = process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgNewRelic"; - const monitorName = "fhcjxnxumkdlgpwanewtkdnyuz"; - const request = { - userEmail: "ruxvg@xqkmdhrnoo.hlmbpm", - }; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.monitors.getMetricStatus(resourceGroupName, monitorName, request); - console.log(result); -} - -async function main() { - monitorsGetMetricStatusMaximumSetGen(); - monitorsGetMetricStatusMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/monitorsGetSample.js b/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/monitorsGetSample.js deleted file mode 100644 index e1e9f1fe6851..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/monitorsGetSample.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { NewRelicObservability } = require("@azure/arm-newrelicobservability"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get a NewRelicMonitorResource - * - * @summary Get a NewRelicMonitorResource - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_Get_MaximumSet_Gen.json - */ -async function monitorsGetMaximumSetGen() { - const subscriptionId = process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "hfmjmpyqgezxkp"; - const resourceGroupName = process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgNewRelic"; - const monitorName = "cdlymktqw"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.monitors.get(resourceGroupName, monitorName); - console.log(result); -} - -async function main() { - monitorsGetMaximumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/monitorsListAppServicesSample.js b/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/monitorsListAppServicesSample.js deleted file mode 100644 index 98f891ee8c43..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/monitorsListAppServicesSample.js +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { NewRelicObservability } = require("@azure/arm-newrelicobservability"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List the app service resources currently being monitored by the NewRelic resource. - * - * @summary List the app service resources currently being monitored by the NewRelic resource. - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListAppServices_MaximumSet_Gen.json - */ -async function monitorsListAppServicesMaximumSetGen() { - const subscriptionId = process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "nqmcgifgaqlf"; - const resourceGroupName = process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgNewRelic"; - const monitorName = "fhcjxnxumkdlgpwanewtkdnyuz"; - const request = { - azureResourceIds: ["pvzrksrmzowobuhxpwiotnpcvjbu"], - userEmail: "ruxvg@xqkmdhrnoo.hlmbpm", - }; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.monitors.listAppServices(resourceGroupName, monitorName, request)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List the app service resources currently being monitored by the NewRelic resource. - * - * @summary List the app service resources currently being monitored by the NewRelic resource. - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListAppServices_MinimumSet_Gen.json - */ -async function monitorsListAppServicesMinimumSetGen() { - const subscriptionId = process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "nqmcgifgaqlf"; - const resourceGroupName = process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgNewRelic"; - const monitorName = "fhcjxnxumkdlgpwanewtkdnyuz"; - const request = { - userEmail: "ruxvg@xqkmdhrnoo.hlmbpm", - }; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.monitors.listAppServices(resourceGroupName, monitorName, request)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - monitorsListAppServicesMaximumSetGen(); - monitorsListAppServicesMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/monitorsListByResourceGroupSample.js b/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/monitorsListByResourceGroupSample.js deleted file mode 100644 index 2c306b0ec25d..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/monitorsListByResourceGroupSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { NewRelicObservability } = require("@azure/arm-newrelicobservability"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List NewRelicMonitorResource resources by resource group - * - * @summary List NewRelicMonitorResource resources by resource group - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListByResourceGroup_MaximumSet_Gen.json - */ -async function monitorsListByResourceGroupMaximumSetGen() { - const subscriptionId = process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "hfmjmpyqgezxkp"; - const resourceGroupName = process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgNewRelic"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.monitors.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - monitorsListByResourceGroupMaximumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/monitorsListBySubscriptionSample.js b/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/monitorsListBySubscriptionSample.js deleted file mode 100644 index e798459a5aad..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/monitorsListBySubscriptionSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { NewRelicObservability } = require("@azure/arm-newrelicobservability"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List NewRelicMonitorResource resources by subscription ID - * - * @summary List NewRelicMonitorResource resources by subscription ID - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListBySubscription_MaximumSet_Gen.json - */ -async function monitorsListBySubscriptionMaximumSetGen() { - const subscriptionId = process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "hfmjmpyqgezxkp"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.monitors.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - monitorsListBySubscriptionMaximumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/monitorsListHostsSample.js b/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/monitorsListHostsSample.js deleted file mode 100644 index 5c54c7a3633d..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/monitorsListHostsSample.js +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { NewRelicObservability } = require("@azure/arm-newrelicobservability"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List the compute vm resources currently being monitored by the NewRelic resource. - * - * @summary List the compute vm resources currently being monitored by the NewRelic resource. - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListHosts_MaximumSet_Gen.json - */ -async function monitorsListHostsMaximumSetGen() { - const subscriptionId = process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "ddqonpqwjr"; - const resourceGroupName = process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgopenapi"; - const monitorName = "ipxmlcbonyxtolzejcjshkmlron"; - const request = { - userEmail: "ruxvg@xqkmdhrnoo.hlmbpm", - vmIds: ["xzphvxvfmvjrnsgyns"], - }; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.monitors.listHosts(resourceGroupName, monitorName, request)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List the compute vm resources currently being monitored by the NewRelic resource. - * - * @summary List the compute vm resources currently being monitored by the NewRelic resource. - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListHosts_MinimumSet_Gen.json - */ -async function monitorsListHostsMinimumSetGen() { - const subscriptionId = process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "ddqonpqwjr"; - const resourceGroupName = process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgopenapi"; - const monitorName = "ipxmlcbonyxtolzejcjshkmlron"; - const request = { - userEmail: "ruxvg@xqkmdhrnoo.hlmbpm", - vmIds: ["xzphvxvfmvjrnsgyns"], - }; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.monitors.listHosts(resourceGroupName, monitorName, request)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - monitorsListHostsMaximumSetGen(); - monitorsListHostsMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/monitorsListMonitoredResourcesSample.js b/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/monitorsListMonitoredResourcesSample.js deleted file mode 100644 index 95fcc4aa1984..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/monitorsListMonitoredResourcesSample.js +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { NewRelicObservability } = require("@azure/arm-newrelicobservability"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List the resources currently being monitored by the NewRelic monitor resource. - * - * @summary List the resources currently being monitored by the NewRelic monitor resource. - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListMonitoredResources_MaximumSet_Gen.json - */ -async function monitorsListMonitoredResourcesMaximumSetGen() { - const subscriptionId = process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "ddqonpqwjr"; - const resourceGroupName = process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgopenapi"; - const monitorName = "ipxmlcbonyxtolzejcjshkmlron"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.monitors.listMonitoredResources(resourceGroupName, monitorName)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List the resources currently being monitored by the NewRelic monitor resource. - * - * @summary List the resources currently being monitored by the NewRelic monitor resource. - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListMonitoredResources_MinimumSet_Gen.json - */ -async function monitorsListMonitoredResourcesMinimumSetGen() { - const subscriptionId = process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "ddqonpqwjr"; - const resourceGroupName = process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgopenapi"; - const monitorName = "ipxmlcbonyxtolzejcjshkmlron"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.monitors.listMonitoredResources(resourceGroupName, monitorName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - monitorsListMonitoredResourcesMaximumSetGen(); - monitorsListMonitoredResourcesMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/monitorsSwitchBillingSample.js b/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/monitorsSwitchBillingSample.js deleted file mode 100644 index b2772841604d..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/monitorsSwitchBillingSample.js +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { NewRelicObservability } = require("@azure/arm-newrelicobservability"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Switches the billing for NewRelic monitor resource. - * - * @summary Switches the billing for NewRelic monitor resource. - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_SwitchBilling_MaximumSet_Gen.json - */ -async function monitorsSwitchBillingMaximumSetGen() { - const subscriptionId = process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "nqmcgifgaqlf"; - const resourceGroupName = process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgNewRelic"; - const monitorName = "fhcjxnxumkdlgpwanewtkdnyuz"; - const request = { - azureResourceId: "enfghpfw", - organizationId: "k", - planData: { - billingCycle: "YEARLY", - effectiveDate: new Date("2022-12-05T14:11:37.786Z"), - planDetails: "tbbiaga", - usageType: "PAYG", - }, - userEmail: "ruxvg@xqkmdhrnoo.hlmbpm", - }; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.monitors.switchBilling(resourceGroupName, monitorName, request); - console.log(result); -} - -/** - * This sample demonstrates how to Switches the billing for NewRelic monitor resource. - * - * @summary Switches the billing for NewRelic monitor resource. - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_SwitchBilling_MinimumSet_Gen.json - */ -async function monitorsSwitchBillingMinimumSetGen() { - const subscriptionId = process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "nqmcgifgaqlf"; - const resourceGroupName = process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgNewRelic"; - const monitorName = "fhcjxnxumkdlgpwanewtkdnyuz"; - const request = { - userEmail: "ruxvg@xqkmdhrnoo.hlmbpm", - }; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.monitors.switchBilling(resourceGroupName, monitorName, request); - console.log(result); -} - -async function main() { - monitorsSwitchBillingMaximumSetGen(); - monitorsSwitchBillingMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/monitorsUpdateSample.js b/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/monitorsUpdateSample.js deleted file mode 100644 index 17facaad9caa..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/monitorsUpdateSample.js +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { NewRelicObservability } = require("@azure/arm-newrelicobservability"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Update a NewRelicMonitorResource - * - * @summary Update a NewRelicMonitorResource - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_Update_MaximumSet_Gen.json - */ -async function monitorsUpdateMaximumSetGen() { - const subscriptionId = process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "hfmjmpyqgezxkp"; - const resourceGroupName = process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgNewRelic"; - const monitorName = "cdlymktqw"; - const properties = { - accountCreationSource: "LIFTR", - identity: { type: "None", userAssignedIdentities: { key8903: {} } }, - newRelicAccountProperties: { - accountInfo: { - accountId: "xhqmg", - ingestionKey: "wltnimmhqt", - region: "ljcf", - }, - organizationInfo: { organizationId: "k" }, - singleSignOnProperties: { - enterpriseAppId: "kwiwfz", - provisioningState: "Accepted", - singleSignOnState: "Initial", - singleSignOnUrl: "kvseueuljsxmfwpqctz", - }, - userId: "vcscxlncofcuduadesd", - }, - orgCreationSource: "LIFTR", - planData: { - billingCycle: "YEARLY", - effectiveDate: new Date("2022-12-05T14:11:37.786Z"), - planDetails: "tbbiaga", - usageType: "PAYG", - }, - tags: { key164: "jqakdrrmmyzytqu" }, - userInfo: { - country: "hslqnwdanrconqyekwbnttaetv", - emailAddress: "%6%@4-g.N1.3F-kI1.Ue-.lJso", - firstName: "vdftzcggirefejajwahhwhyibutramdaotvnuf", - lastName: "bcsztgqovdlmzfkjdrngidwzqsevagexzzilnlc", - phoneNumber: "krf", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.monitors.update(resourceGroupName, monitorName, properties); - console.log(result); -} - -async function main() { - monitorsUpdateMaximumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/monitorsVMHostPayloadSample.js b/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/monitorsVMHostPayloadSample.js deleted file mode 100644 index 94394396e532..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/monitorsVMHostPayloadSample.js +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { NewRelicObservability } = require("@azure/arm-newrelicobservability"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Returns the payload that needs to be passed in the request body for installing NewRelic agent on a VM. - * - * @summary Returns the payload that needs to be passed in the request body for installing NewRelic agent on a VM. - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_VmHostPayload_MaximumSet_Gen.json - */ -async function monitorsVMHostPayloadMaximumSetGen() { - const subscriptionId = process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "ddqonpqwjr"; - const resourceGroupName = process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgopenapi"; - const monitorName = "ipxmlcbonyxtolzejcjshkmlron"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.monitors.vmHostPayload(resourceGroupName, monitorName); - console.log(result); -} - -/** - * This sample demonstrates how to Returns the payload that needs to be passed in the request body for installing NewRelic agent on a VM. - * - * @summary Returns the payload that needs to be passed in the request body for installing NewRelic agent on a VM. - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_VmHostPayload_MinimumSet_Gen.json - */ -async function monitorsVMHostPayloadMinimumSetGen() { - const subscriptionId = process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "ddqonpqwjr"; - const resourceGroupName = process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgopenapi"; - const monitorName = "ipxmlcbonyxtolzejcjshkmlron"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.monitors.vmHostPayload(resourceGroupName, monitorName); - console.log(result); -} - -async function main() { - monitorsVMHostPayloadMaximumSetGen(); - monitorsVMHostPayloadMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/operationsListSample.js b/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/operationsListSample.js deleted file mode 100644 index 26539e6fdac5..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/operationsListSample.js +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { NewRelicObservability } = require("@azure/arm-newrelicobservability"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List the operations for the provider - * - * @summary List the operations for the provider - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Operations_List_MaximumSet_Gen.json - */ -async function operationsListMaximumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List the operations for the provider - * - * @summary List the operations for the provider - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Operations_List_MinimumSet_Gen.json - */ -async function operationsListMinimumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - operationsListMaximumSetGen(); - operationsListMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/organizationsListSample.js b/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/organizationsListSample.js deleted file mode 100644 index 445d4d53ecb5..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/organizationsListSample.js +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { NewRelicObservability } = require("@azure/arm-newrelicobservability"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List all the existing organizations - * - * @summary List all the existing organizations - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Organizations_List_MaximumSet_Gen.json - */ -async function organizationsListMaximumSetGen() { - const subscriptionId = process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "nqmcgifgaqlf"; - const userEmail = "ruxvg@xqkmdhrnoo.hlmbpm"; - const location = "egh"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.organizations.list(userEmail, location)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List all the existing organizations - * - * @summary List all the existing organizations - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Organizations_List_MinimumSet_Gen.json - */ -async function organizationsListMinimumSetGen() { - const subscriptionId = process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "nqmcgifgaqlf"; - const userEmail = "ruxvg@xqkmdhrnoo.hlmbpm"; - const location = "egh"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.organizations.list(userEmail, location)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - organizationsListMaximumSetGen(); - organizationsListMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/package.json b/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/package.json deleted file mode 100644 index 5cd67ae24bed..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "@azure-samples/arm-newrelicobservability-js", - "private": true, - "version": "1.0.0", - "description": " client library samples for JavaScript", - "engines": { - "node": ">=18.0.0" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/newrelicobservability/arm-newrelicobservability" - }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], - "author": "Microsoft Corporation", - "license": "MIT", - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/newrelicobservability/arm-newrelicobservability", - "dependencies": { - "@azure/arm-newrelicobservability": "latest", - "dotenv": "latest", - "@azure/identity": "^2.0.1" - } -} diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/plansListSample.js b/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/plansListSample.js deleted file mode 100644 index 79f896df026e..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/plansListSample.js +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { NewRelicObservability } = require("@azure/arm-newrelicobservability"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List plans data - * - * @summary List plans data - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Plans_List_MaximumSet_Gen.json - */ -async function plansListMaximumSetGen() { - const subscriptionId = process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "hfmjmpyqgezxkp"; - const accountId = "pwuxgvrmkk"; - const organizationId = "hilawwjz"; - const options = { accountId, organizationId }; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.plans.list(options)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List plans data - * - * @summary List plans data - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Plans_List_MinimumSet_Gen.json - */ -async function plansListMinimumSetGen() { - const subscriptionId = process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "nqmcgifgaqlf"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.plans.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - plansListMaximumSetGen(); - plansListMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/sample.env b/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/sample.env +++ /dev/null @@ -1,4 +0,0 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/tagRulesCreateOrUpdateSample.js b/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/tagRulesCreateOrUpdateSample.js deleted file mode 100644 index 0fb3342e1470..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/tagRulesCreateOrUpdateSample.js +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { NewRelicObservability } = require("@azure/arm-newrelicobservability"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Create a TagRule - * - * @summary Create a TagRule - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_CreateOrUpdate_MaximumSet_Gen.json - */ -async function tagRulesCreateOrUpdateMaximumSetGen() { - const subscriptionId = process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "ddqonpqwjr"; - const resourceGroupName = process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgopenapi"; - const monitorName = "ipxmlcbonyxtolzejcjshkmlron"; - const ruleSetName = "bxcantgzggsepbhqmedjqyrqeezmfb"; - const resource = { - logRules: { - filteringTags: [ - { - name: "saokgpjvdlorciqbjmjxazpee", - action: "Include", - value: "sarxrqsxouhdjwsrqqicbeirdb", - }, - ], - sendAadLogs: "Enabled", - sendActivityLogs: "Enabled", - sendSubscriptionLogs: "Enabled", - }, - metricRules: { - filteringTags: [ - { - name: "saokgpjvdlorciqbjmjxazpee", - action: "Include", - value: "sarxrqsxouhdjwsrqqicbeirdb", - }, - ], - userEmail: "test@testing.com", - }, - provisioningState: "Accepted", - }; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.tagRules.beginCreateOrUpdateAndWait( - resourceGroupName, - monitorName, - ruleSetName, - resource - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create a TagRule - * - * @summary Create a TagRule - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_CreateOrUpdate_MinimumSet_Gen.json - */ -async function tagRulesCreateOrUpdateMinimumSetGen() { - const subscriptionId = process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "ddqonpqwjr"; - const resourceGroupName = process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgopenapi"; - const monitorName = "ipxmlcbonyxtolzejcjshkmlron"; - const ruleSetName = "bxcantgzggsepbhqmedjqyrqeezmfb"; - const resource = {}; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.tagRules.beginCreateOrUpdateAndWait( - resourceGroupName, - monitorName, - ruleSetName, - resource - ); - console.log(result); -} - -async function main() { - tagRulesCreateOrUpdateMaximumSetGen(); - tagRulesCreateOrUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/tagRulesDeleteSample.js b/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/tagRulesDeleteSample.js deleted file mode 100644 index 17654f6db990..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/tagRulesDeleteSample.js +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { NewRelicObservability } = require("@azure/arm-newrelicobservability"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Delete a TagRule - * - * @summary Delete a TagRule - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Delete_MaximumSet_Gen.json - */ -async function tagRulesDeleteMaximumSetGen() { - const subscriptionId = process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "ddqonpqwjr"; - const resourceGroupName = process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgopenapi"; - const monitorName = "ipxmlcbonyxtolzejcjshkmlron"; - const ruleSetName = "bxcantgzggsepbhqmedjqyrqeezmfb"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.tagRules.beginDeleteAndWait( - resourceGroupName, - monitorName, - ruleSetName - ); - console.log(result); -} - -/** - * This sample demonstrates how to Delete a TagRule - * - * @summary Delete a TagRule - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Delete_MinimumSet_Gen.json - */ -async function tagRulesDeleteMinimumSetGen() { - const subscriptionId = process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "ddqonpqwjr"; - const resourceGroupName = process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgopenapi"; - const monitorName = "ipxmlcbonyxtolzejcjshkmlron"; - const ruleSetName = "bxcantgzggsepbhqmedjqyrqeezmfb"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.tagRules.beginDeleteAndWait( - resourceGroupName, - monitorName, - ruleSetName - ); - console.log(result); -} - -async function main() { - tagRulesDeleteMaximumSetGen(); - tagRulesDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/tagRulesGetSample.js b/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/tagRulesGetSample.js deleted file mode 100644 index 538e6a383544..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/tagRulesGetSample.js +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { NewRelicObservability } = require("@azure/arm-newrelicobservability"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get a TagRule - * - * @summary Get a TagRule - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Get_MaximumSet_Gen.json - */ -async function tagRulesGetMaximumSetGen() { - const subscriptionId = process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "ddqonpqwjr"; - const resourceGroupName = process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgopenapi"; - const monitorName = "ipxmlcbonyxtolzejcjshkmlron"; - const ruleSetName = "bxcantgzggsepbhqmedjqyrqeezmfb"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.tagRules.get(resourceGroupName, monitorName, ruleSetName); - console.log(result); -} - -/** - * This sample demonstrates how to Get a TagRule - * - * @summary Get a TagRule - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Get_MinimumSet_Gen.json - */ -async function tagRulesGetMinimumSetGen() { - const subscriptionId = process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "ddqonpqwjr"; - const resourceGroupName = process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgopenapi"; - const monitorName = "ipxmlcbonyxtolzejcjshkmlron"; - const ruleSetName = "bxcantgzggsepbhqmedjqyrqeezmfb"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.tagRules.get(resourceGroupName, monitorName, ruleSetName); - console.log(result); -} - -async function main() { - tagRulesGetMaximumSetGen(); - tagRulesGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/tagRulesListByNewRelicMonitorResourceSample.js b/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/tagRulesListByNewRelicMonitorResourceSample.js deleted file mode 100644 index 1a086c8fdd50..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/tagRulesListByNewRelicMonitorResourceSample.js +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { NewRelicObservability } = require("@azure/arm-newrelicobservability"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List TagRule resources by NewRelicMonitorResource - * - * @summary List TagRule resources by NewRelicMonitorResource - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_ListByNewRelicMonitorResource_MaximumSet_Gen.json - */ -async function tagRulesListByNewRelicMonitorResourceMaximumSetGen() { - const subscriptionId = process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "ddqonpqwjr"; - const resourceGroupName = process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgopenapi"; - const monitorName = "ipxmlcbonyxtolzejcjshkmlron"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.tagRules.listByNewRelicMonitorResource( - resourceGroupName, - monitorName - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List TagRule resources by NewRelicMonitorResource - * - * @summary List TagRule resources by NewRelicMonitorResource - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_ListByNewRelicMonitorResource_MinimumSet_Gen.json - */ -async function tagRulesListByNewRelicMonitorResourceMinimumSetGen() { - const subscriptionId = process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "ddqonpqwjr"; - const resourceGroupName = process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgopenapi"; - const monitorName = "ipxmlcbonyxtolzejcjshkmlron"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.tagRules.listByNewRelicMonitorResource( - resourceGroupName, - monitorName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - tagRulesListByNewRelicMonitorResourceMaximumSetGen(); - tagRulesListByNewRelicMonitorResourceMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/tagRulesUpdateSample.js b/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/tagRulesUpdateSample.js deleted file mode 100644 index 1456048f33a1..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/javascript/tagRulesUpdateSample.js +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { NewRelicObservability } = require("@azure/arm-newrelicobservability"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Update a TagRule - * - * @summary Update a TagRule - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Update_MaximumSet_Gen.json - */ -async function tagRulesUpdateMaximumSetGen() { - const subscriptionId = process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "ddqonpqwjr"; - const resourceGroupName = process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgopenapi"; - const monitorName = "ipxmlcbonyxtolzejcjshkmlron"; - const ruleSetName = "bxcantgzggsepbhqmedjqyrqeezmfb"; - const properties = { - logRules: { - filteringTags: [ - { - name: "saokgpjvdlorciqbjmjxazpee", - action: "Include", - value: "sarxrqsxouhdjwsrqqicbeirdb", - }, - ], - sendAadLogs: "Enabled", - sendActivityLogs: "Enabled", - sendSubscriptionLogs: "Enabled", - }, - metricRules: { - filteringTags: [ - { - name: "saokgpjvdlorciqbjmjxazpee", - action: "Include", - value: "sarxrqsxouhdjwsrqqicbeirdb", - }, - ], - userEmail: "test@testing.com", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.tagRules.update( - resourceGroupName, - monitorName, - ruleSetName, - properties - ); - console.log(result); -} - -/** - * This sample demonstrates how to Update a TagRule - * - * @summary Update a TagRule - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Update_MinimumSet_Gen.json - */ -async function tagRulesUpdateMinimumSetGen() { - const subscriptionId = process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "ddqonpqwjr"; - const resourceGroupName = process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgopenapi"; - const monitorName = "ipxmlcbonyxtolzejcjshkmlron"; - const ruleSetName = "bxcantgzggsepbhqmedjqyrqeezmfb"; - const properties = {}; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.tagRules.update( - resourceGroupName, - monitorName, - ruleSetName, - properties - ); - console.log(result); -} - -async function main() { - tagRulesUpdateMaximumSetGen(); - tagRulesUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/README.md b/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/README.md deleted file mode 100644 index d5875a4b7651..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/README.md +++ /dev/null @@ -1,105 +0,0 @@ -# client library samples for TypeScript - -These sample programs show how to use the TypeScript client libraries for in some common scenarios. - -| **File Name** | **Description** | -| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [accountsListSample.ts][accountslistsample] | List all the existing accounts x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Accounts_List_MaximumSet_Gen.json | -| [monitorsCreateOrUpdateSample.ts][monitorscreateorupdatesample] | Create a NewRelicMonitorResource x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_CreateOrUpdate_MaximumSet_Gen.json | -| [monitorsDeleteSample.ts][monitorsdeletesample] | Delete a NewRelicMonitorResource x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_Delete_MaximumSet_Gen.json | -| [monitorsGetMetricRulesSample.ts][monitorsgetmetricrulessample] | Get metric rules x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_GetMetricRules_MaximumSet_Gen.json | -| [monitorsGetMetricStatusSample.ts][monitorsgetmetricstatussample] | Get metric status x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_GetMetricStatus_MaximumSet_Gen.json | -| [monitorsGetSample.ts][monitorsgetsample] | Get a NewRelicMonitorResource x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_Get_MaximumSet_Gen.json | -| [monitorsListAppServicesSample.ts][monitorslistappservicessample] | List the app service resources currently being monitored by the NewRelic resource. x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListAppServices_MaximumSet_Gen.json | -| [monitorsListByResourceGroupSample.ts][monitorslistbyresourcegroupsample] | List NewRelicMonitorResource resources by resource group x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListByResourceGroup_MaximumSet_Gen.json | -| [monitorsListBySubscriptionSample.ts][monitorslistbysubscriptionsample] | List NewRelicMonitorResource resources by subscription ID x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListBySubscription_MaximumSet_Gen.json | -| [monitorsListHostsSample.ts][monitorslisthostssample] | List the compute vm resources currently being monitored by the NewRelic resource. x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListHosts_MaximumSet_Gen.json | -| [monitorsListMonitoredResourcesSample.ts][monitorslistmonitoredresourcessample] | List the resources currently being monitored by the NewRelic monitor resource. x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListMonitoredResources_MaximumSet_Gen.json | -| [monitorsSwitchBillingSample.ts][monitorsswitchbillingsample] | Switches the billing for NewRelic monitor resource. x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_SwitchBilling_MaximumSet_Gen.json | -| [monitorsUpdateSample.ts][monitorsupdatesample] | Update a NewRelicMonitorResource x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_Update_MaximumSet_Gen.json | -| [monitorsVMHostPayloadSample.ts][monitorsvmhostpayloadsample] | Returns the payload that needs to be passed in the request body for installing NewRelic agent on a VM. x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_VmHostPayload_MaximumSet_Gen.json | -| [operationsListSample.ts][operationslistsample] | List the operations for the provider x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Operations_List_MaximumSet_Gen.json | -| [organizationsListSample.ts][organizationslistsample] | List all the existing organizations x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Organizations_List_MaximumSet_Gen.json | -| [plansListSample.ts][planslistsample] | List plans data x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Plans_List_MaximumSet_Gen.json | -| [tagRulesCreateOrUpdateSample.ts][tagrulescreateorupdatesample] | Create a TagRule x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_CreateOrUpdate_MaximumSet_Gen.json | -| [tagRulesDeleteSample.ts][tagrulesdeletesample] | Delete a TagRule x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Delete_MaximumSet_Gen.json | -| [tagRulesGetSample.ts][tagrulesgetsample] | Get a TagRule x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Get_MaximumSet_Gen.json | -| [tagRulesListByNewRelicMonitorResourceSample.ts][tagruleslistbynewrelicmonitorresourcesample] | List TagRule resources by NewRelicMonitorResource x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_ListByNewRelicMonitorResource_MaximumSet_Gen.json | -| [tagRulesUpdateSample.ts][tagrulesupdatesample] | Update a TagRule x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Update_MaximumSet_Gen.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using: - -```bash -npm install -g typescript -``` - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Compile the samples: - -```bash -npm run build -``` - -3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -4. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node dist/accountsListSample.js -``` - -Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): - -```bash -npx cross-env NEWRELICOBSERVABILITY_SUBSCRIPTION_ID="" NEWRELICOBSERVABILITY_SUBSCRIPTION_ID="" node dist/accountsListSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[accountslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/accountsListSample.ts -[monitorscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/monitorsCreateOrUpdateSample.ts -[monitorsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/monitorsDeleteSample.ts -[monitorsgetmetricrulessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/monitorsGetMetricRulesSample.ts -[monitorsgetmetricstatussample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/monitorsGetMetricStatusSample.ts -[monitorsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/monitorsGetSample.ts -[monitorslistappservicessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/monitorsListAppServicesSample.ts -[monitorslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/monitorsListByResourceGroupSample.ts -[monitorslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/monitorsListBySubscriptionSample.ts -[monitorslisthostssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/monitorsListHostsSample.ts -[monitorslistmonitoredresourcessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/monitorsListMonitoredResourcesSample.ts -[monitorsswitchbillingsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/monitorsSwitchBillingSample.ts -[monitorsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/monitorsUpdateSample.ts -[monitorsvmhostpayloadsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/monitorsVMHostPayloadSample.ts -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/operationsListSample.ts -[organizationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/organizationsListSample.ts -[planslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/plansListSample.ts -[tagrulescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/tagRulesCreateOrUpdateSample.ts -[tagrulesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/tagRulesDeleteSample.ts -[tagrulesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/tagRulesGetSample.ts -[tagruleslistbynewrelicmonitorresourcesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/tagRulesListByNewRelicMonitorResourceSample.ts -[tagrulesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/tagRulesUpdateSample.ts -[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-newrelicobservability?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/newrelicobservability/arm-newrelicobservability/README.md -[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/package.json b/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/package.json deleted file mode 100644 index fdc96e15376d..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "@azure-samples/arm-newrelicobservability-ts", - "private": true, - "version": "1.0.0", - "description": " client library samples for TypeScript", - "engines": { - "node": ">=18.0.0" - }, - "scripts": { - "build": "tsc", - "prebuild": "rimraf dist/" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/newrelicobservability/arm-newrelicobservability" - }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], - "author": "Microsoft Corporation", - "license": "MIT", - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/newrelicobservability/arm-newrelicobservability", - "dependencies": { - "@azure/arm-newrelicobservability": "latest", - "dotenv": "latest", - "@azure/identity": "^2.0.1" - }, - "devDependencies": { - "@types/node": "^18.0.0", - "typescript": "~5.2.0", - "rimraf": "latest" - } -} diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/sample.env b/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/sample.env +++ /dev/null @@ -1,4 +0,0 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/accountsListSample.ts b/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/accountsListSample.ts deleted file mode 100644 index 99f3702cf446..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/accountsListSample.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { NewRelicObservability } from "@azure/arm-newrelicobservability"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List all the existing accounts - * - * @summary List all the existing accounts - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Accounts_List_MaximumSet_Gen.json - */ -async function accountsListMaximumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "nqmcgifgaqlf"; - const userEmail = "ruxvg@xqkmdhrnoo.hlmbpm"; - const location = "egh"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.accounts.list(userEmail, location)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List all the existing accounts - * - * @summary List all the existing accounts - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Accounts_List_MinimumSet_Gen.json - */ -async function accountsListMinimumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "nqmcgifgaqlf"; - const userEmail = "ruxvg@xqkmdhrnoo.hlmbpm"; - const location = "egh"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.accounts.list(userEmail, location)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - accountsListMaximumSetGen(); - accountsListMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/monitorsCreateOrUpdateSample.ts b/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/monitorsCreateOrUpdateSample.ts deleted file mode 100644 index a16060bfd228..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/monitorsCreateOrUpdateSample.ts +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - NewRelicMonitorResource, - NewRelicObservability -} from "@azure/arm-newrelicobservability"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Create a NewRelicMonitorResource - * - * @summary Create a NewRelicMonitorResource - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_CreateOrUpdate_MaximumSet_Gen.json - */ -async function monitorsCreateOrUpdateMaximumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "hfmjmpyqgezxkp"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgNewRelic"; - const monitorName = "cdlymktqw"; - const resource: NewRelicMonitorResource = { - accountCreationSource: "LIFTR", - liftrResourceCategory: "Unknown", - location: "k", - marketplaceSubscriptionStatus: "Active", - monitoringStatus: "Enabled", - newRelicAccountProperties: { - accountInfo: { - accountId: "xhqmg", - ingestionKey: "wltnimmhqt", - region: "ljcf" - }, - organizationInfo: { organizationId: "k" }, - singleSignOnProperties: { - enterpriseAppId: "kwiwfz", - provisioningState: "Accepted", - singleSignOnState: "Initial", - singleSignOnUrl: "kvseueuljsxmfwpqctz" - }, - userId: "vcscxlncofcuduadesd" - }, - orgCreationSource: "LIFTR", - planData: { - billingCycle: "YEARLY", - effectiveDate: new Date("2022-12-05T14:11:37.786Z"), - planDetails: "tbbiaga", - usageType: "PAYG" - }, - provisioningState: "Accepted", - tags: { key6976: "oaxfhf" }, - userInfo: { - country: "hslqnwdanrconqyekwbnttaetv", - emailAddress: "%6%@4-g.N1.3F-kI1.Ue-.lJso", - firstName: "vdftzcggirefejajwahhwhyibutramdaotvnuf", - lastName: "bcsztgqovdlmzfkjdrngidwzqsevagexzzilnlc", - phoneNumber: "krf" - } - }; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.monitors.beginCreateOrUpdateAndWait( - resourceGroupName, - monitorName, - resource - ); - console.log(result); -} - -async function main() { - monitorsCreateOrUpdateMaximumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/monitorsDeleteSample.ts b/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/monitorsDeleteSample.ts deleted file mode 100644 index f9880c76a3cf..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/monitorsDeleteSample.ts +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { NewRelicObservability } from "@azure/arm-newrelicobservability"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Delete a NewRelicMonitorResource - * - * @summary Delete a NewRelicMonitorResource - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_Delete_MaximumSet_Gen.json - */ -async function monitorsDeleteMaximumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "ddqonpqwjr"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgopenapi"; - const userEmail = "ruxvg@xqkmdhrnoo.hlmbpm"; - const monitorName = "ipxmlcbonyxtolzejcjshkmlron"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.monitors.beginDeleteAndWait( - resourceGroupName, - userEmail, - monitorName - ); - console.log(result); -} - -/** - * This sample demonstrates how to Delete a NewRelicMonitorResource - * - * @summary Delete a NewRelicMonitorResource - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_Delete_MinimumSet_Gen.json - */ -async function monitorsDeleteMinimumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "ddqonpqwjr"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgopenapi"; - const userEmail = "ruxvg@xqkmdhrnoo.hlmbpm"; - const monitorName = "ipxmlcbonyxtolzejcjshkmlron"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.monitors.beginDeleteAndWait( - resourceGroupName, - userEmail, - monitorName - ); - console.log(result); -} - -async function main() { - monitorsDeleteMaximumSetGen(); - monitorsDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/monitorsGetMetricRulesSample.ts b/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/monitorsGetMetricRulesSample.ts deleted file mode 100644 index a25ff34b59a7..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/monitorsGetMetricRulesSample.ts +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - MetricsRequest, - NewRelicObservability -} from "@azure/arm-newrelicobservability"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get metric rules - * - * @summary Get metric rules - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_GetMetricRules_MaximumSet_Gen.json - */ -async function monitorsGetMetricRulesMaximumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "nqmcgifgaqlf"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgNewRelic"; - const monitorName = "fhcjxnxumkdlgpwanewtkdnyuz"; - const request: MetricsRequest = { userEmail: "ruxvg@xqkmdhrnoo.hlmbpm" }; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.monitors.getMetricRules( - resourceGroupName, - monitorName, - request - ); - console.log(result); -} - -/** - * This sample demonstrates how to Get metric rules - * - * @summary Get metric rules - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_GetMetricRules_MinimumSet_Gen.json - */ -async function monitorsGetMetricRulesMinimumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "nqmcgifgaqlf"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgNewRelic"; - const monitorName = "fhcjxnxumkdlgpwanewtkdnyuz"; - const request: MetricsRequest = { userEmail: "ruxvg@xqkmdhrnoo.hlmbpm" }; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.monitors.getMetricRules( - resourceGroupName, - monitorName, - request - ); - console.log(result); -} - -async function main() { - monitorsGetMetricRulesMaximumSetGen(); - monitorsGetMetricRulesMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/monitorsGetMetricStatusSample.ts b/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/monitorsGetMetricStatusSample.ts deleted file mode 100644 index 5df6ca2a184e..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/monitorsGetMetricStatusSample.ts +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - MetricsStatusRequest, - NewRelicObservability -} from "@azure/arm-newrelicobservability"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get metric status - * - * @summary Get metric status - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_GetMetricStatus_MaximumSet_Gen.json - */ -async function monitorsGetMetricStatusMaximumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "nqmcgifgaqlf"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgNewRelic"; - const monitorName = "fhcjxnxumkdlgpwanewtkdnyuz"; - const request: MetricsStatusRequest = { - azureResourceIds: ["enfghpfw"], - userEmail: "ruxvg@xqkmdhrnoo.hlmbpm" - }; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.monitors.getMetricStatus( - resourceGroupName, - monitorName, - request - ); - console.log(result); -} - -/** - * This sample demonstrates how to Get metric status - * - * @summary Get metric status - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_GetMetricStatus_MinimumSet_Gen.json - */ -async function monitorsGetMetricStatusMinimumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "nqmcgifgaqlf"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgNewRelic"; - const monitorName = "fhcjxnxumkdlgpwanewtkdnyuz"; - const request: MetricsStatusRequest = { - userEmail: "ruxvg@xqkmdhrnoo.hlmbpm" - }; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.monitors.getMetricStatus( - resourceGroupName, - monitorName, - request - ); - console.log(result); -} - -async function main() { - monitorsGetMetricStatusMaximumSetGen(); - monitorsGetMetricStatusMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/monitorsGetSample.ts b/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/monitorsGetSample.ts deleted file mode 100644 index 736fe637f7db..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/monitorsGetSample.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { NewRelicObservability } from "@azure/arm-newrelicobservability"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get a NewRelicMonitorResource - * - * @summary Get a NewRelicMonitorResource - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_Get_MaximumSet_Gen.json - */ -async function monitorsGetMaximumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "hfmjmpyqgezxkp"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgNewRelic"; - const monitorName = "cdlymktqw"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.monitors.get(resourceGroupName, monitorName); - console.log(result); -} - -async function main() { - monitorsGetMaximumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/monitorsListAppServicesSample.ts b/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/monitorsListAppServicesSample.ts deleted file mode 100644 index 04dcf08713ba..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/monitorsListAppServicesSample.ts +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - AppServicesGetRequest, - NewRelicObservability -} from "@azure/arm-newrelicobservability"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List the app service resources currently being monitored by the NewRelic resource. - * - * @summary List the app service resources currently being monitored by the NewRelic resource. - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListAppServices_MaximumSet_Gen.json - */ -async function monitorsListAppServicesMaximumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "nqmcgifgaqlf"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgNewRelic"; - const monitorName = "fhcjxnxumkdlgpwanewtkdnyuz"; - const request: AppServicesGetRequest = { - azureResourceIds: ["pvzrksrmzowobuhxpwiotnpcvjbu"], - userEmail: "ruxvg@xqkmdhrnoo.hlmbpm" - }; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.monitors.listAppServices( - resourceGroupName, - monitorName, - request - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List the app service resources currently being monitored by the NewRelic resource. - * - * @summary List the app service resources currently being monitored by the NewRelic resource. - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListAppServices_MinimumSet_Gen.json - */ -async function monitorsListAppServicesMinimumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "nqmcgifgaqlf"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgNewRelic"; - const monitorName = "fhcjxnxumkdlgpwanewtkdnyuz"; - const request: AppServicesGetRequest = { - userEmail: "ruxvg@xqkmdhrnoo.hlmbpm" - }; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.monitors.listAppServices( - resourceGroupName, - monitorName, - request - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - monitorsListAppServicesMaximumSetGen(); - monitorsListAppServicesMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/monitorsListByResourceGroupSample.ts b/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/monitorsListByResourceGroupSample.ts deleted file mode 100644 index f4915e862368..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/monitorsListByResourceGroupSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { NewRelicObservability } from "@azure/arm-newrelicobservability"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List NewRelicMonitorResource resources by resource group - * - * @summary List NewRelicMonitorResource resources by resource group - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListByResourceGroup_MaximumSet_Gen.json - */ -async function monitorsListByResourceGroupMaximumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "hfmjmpyqgezxkp"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgNewRelic"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.monitors.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - monitorsListByResourceGroupMaximumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/monitorsListBySubscriptionSample.ts b/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/monitorsListBySubscriptionSample.ts deleted file mode 100644 index 4a6cdd813248..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/monitorsListBySubscriptionSample.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { NewRelicObservability } from "@azure/arm-newrelicobservability"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List NewRelicMonitorResource resources by subscription ID - * - * @summary List NewRelicMonitorResource resources by subscription ID - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListBySubscription_MaximumSet_Gen.json - */ -async function monitorsListBySubscriptionMaximumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "hfmjmpyqgezxkp"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.monitors.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - monitorsListBySubscriptionMaximumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/monitorsListHostsSample.ts b/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/monitorsListHostsSample.ts deleted file mode 100644 index bdb591af2de1..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/monitorsListHostsSample.ts +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - HostsGetRequest, - NewRelicObservability -} from "@azure/arm-newrelicobservability"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List the compute vm resources currently being monitored by the NewRelic resource. - * - * @summary List the compute vm resources currently being monitored by the NewRelic resource. - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListHosts_MaximumSet_Gen.json - */ -async function monitorsListHostsMaximumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "ddqonpqwjr"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgopenapi"; - const monitorName = "ipxmlcbonyxtolzejcjshkmlron"; - const request: HostsGetRequest = { - userEmail: "ruxvg@xqkmdhrnoo.hlmbpm", - vmIds: ["xzphvxvfmvjrnsgyns"] - }; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.monitors.listHosts( - resourceGroupName, - monitorName, - request - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List the compute vm resources currently being monitored by the NewRelic resource. - * - * @summary List the compute vm resources currently being monitored by the NewRelic resource. - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListHosts_MinimumSet_Gen.json - */ -async function monitorsListHostsMinimumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "ddqonpqwjr"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgopenapi"; - const monitorName = "ipxmlcbonyxtolzejcjshkmlron"; - const request: HostsGetRequest = { - userEmail: "ruxvg@xqkmdhrnoo.hlmbpm", - vmIds: ["xzphvxvfmvjrnsgyns"] - }; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.monitors.listHosts( - resourceGroupName, - monitorName, - request - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - monitorsListHostsMaximumSetGen(); - monitorsListHostsMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/monitorsListMonitoredResourcesSample.ts b/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/monitorsListMonitoredResourcesSample.ts deleted file mode 100644 index d25abd9a0214..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/monitorsListMonitoredResourcesSample.ts +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { NewRelicObservability } from "@azure/arm-newrelicobservability"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List the resources currently being monitored by the NewRelic monitor resource. - * - * @summary List the resources currently being monitored by the NewRelic monitor resource. - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListMonitoredResources_MaximumSet_Gen.json - */ -async function monitorsListMonitoredResourcesMaximumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "ddqonpqwjr"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgopenapi"; - const monitorName = "ipxmlcbonyxtolzejcjshkmlron"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.monitors.listMonitoredResources( - resourceGroupName, - monitorName - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List the resources currently being monitored by the NewRelic monitor resource. - * - * @summary List the resources currently being monitored by the NewRelic monitor resource. - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListMonitoredResources_MinimumSet_Gen.json - */ -async function monitorsListMonitoredResourcesMinimumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "ddqonpqwjr"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgopenapi"; - const monitorName = "ipxmlcbonyxtolzejcjshkmlron"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.monitors.listMonitoredResources( - resourceGroupName, - monitorName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - monitorsListMonitoredResourcesMaximumSetGen(); - monitorsListMonitoredResourcesMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/monitorsSwitchBillingSample.ts b/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/monitorsSwitchBillingSample.ts deleted file mode 100644 index c72eb08c245f..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/monitorsSwitchBillingSample.ts +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - SwitchBillingRequest, - NewRelicObservability -} from "@azure/arm-newrelicobservability"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Switches the billing for NewRelic monitor resource. - * - * @summary Switches the billing for NewRelic monitor resource. - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_SwitchBilling_MaximumSet_Gen.json - */ -async function monitorsSwitchBillingMaximumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "nqmcgifgaqlf"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgNewRelic"; - const monitorName = "fhcjxnxumkdlgpwanewtkdnyuz"; - const request: SwitchBillingRequest = { - azureResourceId: "enfghpfw", - organizationId: "k", - planData: { - billingCycle: "YEARLY", - effectiveDate: new Date("2022-12-05T14:11:37.786Z"), - planDetails: "tbbiaga", - usageType: "PAYG" - }, - userEmail: "ruxvg@xqkmdhrnoo.hlmbpm" - }; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.monitors.switchBilling( - resourceGroupName, - monitorName, - request - ); - console.log(result); -} - -/** - * This sample demonstrates how to Switches the billing for NewRelic monitor resource. - * - * @summary Switches the billing for NewRelic monitor resource. - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_SwitchBilling_MinimumSet_Gen.json - */ -async function monitorsSwitchBillingMinimumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "nqmcgifgaqlf"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgNewRelic"; - const monitorName = "fhcjxnxumkdlgpwanewtkdnyuz"; - const request: SwitchBillingRequest = { - userEmail: "ruxvg@xqkmdhrnoo.hlmbpm" - }; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.monitors.switchBilling( - resourceGroupName, - monitorName, - request - ); - console.log(result); -} - -async function main() { - monitorsSwitchBillingMaximumSetGen(); - monitorsSwitchBillingMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/monitorsUpdateSample.ts b/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/monitorsUpdateSample.ts deleted file mode 100644 index 9086f6911dfc..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/monitorsUpdateSample.ts +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - NewRelicMonitorResourceUpdate, - NewRelicObservability -} from "@azure/arm-newrelicobservability"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Update a NewRelicMonitorResource - * - * @summary Update a NewRelicMonitorResource - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_Update_MaximumSet_Gen.json - */ -async function monitorsUpdateMaximumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "hfmjmpyqgezxkp"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgNewRelic"; - const monitorName = "cdlymktqw"; - const properties: NewRelicMonitorResourceUpdate = { - accountCreationSource: "LIFTR", - identity: { type: "None", userAssignedIdentities: { key8903: {} } }, - newRelicAccountProperties: { - accountInfo: { - accountId: "xhqmg", - ingestionKey: "wltnimmhqt", - region: "ljcf" - }, - organizationInfo: { organizationId: "k" }, - singleSignOnProperties: { - enterpriseAppId: "kwiwfz", - provisioningState: "Accepted", - singleSignOnState: "Initial", - singleSignOnUrl: "kvseueuljsxmfwpqctz" - }, - userId: "vcscxlncofcuduadesd" - }, - orgCreationSource: "LIFTR", - planData: { - billingCycle: "YEARLY", - effectiveDate: new Date("2022-12-05T14:11:37.786Z"), - planDetails: "tbbiaga", - usageType: "PAYG" - }, - tags: { key164: "jqakdrrmmyzytqu" }, - userInfo: { - country: "hslqnwdanrconqyekwbnttaetv", - emailAddress: "%6%@4-g.N1.3F-kI1.Ue-.lJso", - firstName: "vdftzcggirefejajwahhwhyibutramdaotvnuf", - lastName: "bcsztgqovdlmzfkjdrngidwzqsevagexzzilnlc", - phoneNumber: "krf" - } - }; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.monitors.update( - resourceGroupName, - monitorName, - properties - ); - console.log(result); -} - -async function main() { - monitorsUpdateMaximumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/monitorsVMHostPayloadSample.ts b/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/monitorsVMHostPayloadSample.ts deleted file mode 100644 index 9e04ef9c8f3b..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/monitorsVMHostPayloadSample.ts +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { NewRelicObservability } from "@azure/arm-newrelicobservability"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Returns the payload that needs to be passed in the request body for installing NewRelic agent on a VM. - * - * @summary Returns the payload that needs to be passed in the request body for installing NewRelic agent on a VM. - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_VmHostPayload_MaximumSet_Gen.json - */ -async function monitorsVMHostPayloadMaximumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "ddqonpqwjr"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgopenapi"; - const monitorName = "ipxmlcbonyxtolzejcjshkmlron"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.monitors.vmHostPayload( - resourceGroupName, - monitorName - ); - console.log(result); -} - -/** - * This sample demonstrates how to Returns the payload that needs to be passed in the request body for installing NewRelic agent on a VM. - * - * @summary Returns the payload that needs to be passed in the request body for installing NewRelic agent on a VM. - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_VmHostPayload_MinimumSet_Gen.json - */ -async function monitorsVMHostPayloadMinimumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "ddqonpqwjr"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgopenapi"; - const monitorName = "ipxmlcbonyxtolzejcjshkmlron"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.monitors.vmHostPayload( - resourceGroupName, - monitorName - ); - console.log(result); -} - -async function main() { - monitorsVMHostPayloadMaximumSetGen(); - monitorsVMHostPayloadMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/operationsListSample.ts b/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/operationsListSample.ts deleted file mode 100644 index 7901f82878ec..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/operationsListSample.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { NewRelicObservability } from "@azure/arm-newrelicobservability"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List the operations for the provider - * - * @summary List the operations for the provider - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Operations_List_MaximumSet_Gen.json - */ -async function operationsListMaximumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List the operations for the provider - * - * @summary List the operations for the provider - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Operations_List_MinimumSet_Gen.json - */ -async function operationsListMinimumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - operationsListMaximumSetGen(); - operationsListMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/organizationsListSample.ts b/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/organizationsListSample.ts deleted file mode 100644 index 1cf2432c023b..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/organizationsListSample.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { NewRelicObservability } from "@azure/arm-newrelicobservability"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List all the existing organizations - * - * @summary List all the existing organizations - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Organizations_List_MaximumSet_Gen.json - */ -async function organizationsListMaximumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "nqmcgifgaqlf"; - const userEmail = "ruxvg@xqkmdhrnoo.hlmbpm"; - const location = "egh"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.organizations.list(userEmail, location)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List all the existing organizations - * - * @summary List all the existing organizations - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Organizations_List_MinimumSet_Gen.json - */ -async function organizationsListMinimumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "nqmcgifgaqlf"; - const userEmail = "ruxvg@xqkmdhrnoo.hlmbpm"; - const location = "egh"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.organizations.list(userEmail, location)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - organizationsListMaximumSetGen(); - organizationsListMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/plansListSample.ts b/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/plansListSample.ts deleted file mode 100644 index c74ca81bd59d..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/plansListSample.ts +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - PlansListOptionalParams, - NewRelicObservability -} from "@azure/arm-newrelicobservability"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List plans data - * - * @summary List plans data - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Plans_List_MaximumSet_Gen.json - */ -async function plansListMaximumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "hfmjmpyqgezxkp"; - const accountId = "pwuxgvrmkk"; - const organizationId = "hilawwjz"; - const options: PlansListOptionalParams = { accountId, organizationId }; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.plans.list(options)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List plans data - * - * @summary List plans data - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Plans_List_MinimumSet_Gen.json - */ -async function plansListMinimumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "nqmcgifgaqlf"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.plans.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - plansListMaximumSetGen(); - plansListMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/tagRulesCreateOrUpdateSample.ts b/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/tagRulesCreateOrUpdateSample.ts deleted file mode 100644 index f2b5ff1b9981..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/tagRulesCreateOrUpdateSample.ts +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - TagRule, - NewRelicObservability -} from "@azure/arm-newrelicobservability"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Create a TagRule - * - * @summary Create a TagRule - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_CreateOrUpdate_MaximumSet_Gen.json - */ -async function tagRulesCreateOrUpdateMaximumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "ddqonpqwjr"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgopenapi"; - const monitorName = "ipxmlcbonyxtolzejcjshkmlron"; - const ruleSetName = "bxcantgzggsepbhqmedjqyrqeezmfb"; - const resource: TagRule = { - logRules: { - filteringTags: [ - { - name: "saokgpjvdlorciqbjmjxazpee", - action: "Include", - value: "sarxrqsxouhdjwsrqqicbeirdb" - } - ], - sendAadLogs: "Enabled", - sendActivityLogs: "Enabled", - sendSubscriptionLogs: "Enabled" - }, - metricRules: { - filteringTags: [ - { - name: "saokgpjvdlorciqbjmjxazpee", - action: "Include", - value: "sarxrqsxouhdjwsrqqicbeirdb" - } - ], - userEmail: "test@testing.com" - }, - provisioningState: "Accepted" - }; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.tagRules.beginCreateOrUpdateAndWait( - resourceGroupName, - monitorName, - ruleSetName, - resource - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create a TagRule - * - * @summary Create a TagRule - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_CreateOrUpdate_MinimumSet_Gen.json - */ -async function tagRulesCreateOrUpdateMinimumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "ddqonpqwjr"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgopenapi"; - const monitorName = "ipxmlcbonyxtolzejcjshkmlron"; - const ruleSetName = "bxcantgzggsepbhqmedjqyrqeezmfb"; - const resource: TagRule = {}; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.tagRules.beginCreateOrUpdateAndWait( - resourceGroupName, - monitorName, - ruleSetName, - resource - ); - console.log(result); -} - -async function main() { - tagRulesCreateOrUpdateMaximumSetGen(); - tagRulesCreateOrUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/tagRulesDeleteSample.ts b/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/tagRulesDeleteSample.ts deleted file mode 100644 index dcdb3bf905a7..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/tagRulesDeleteSample.ts +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { NewRelicObservability } from "@azure/arm-newrelicobservability"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Delete a TagRule - * - * @summary Delete a TagRule - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Delete_MaximumSet_Gen.json - */ -async function tagRulesDeleteMaximumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "ddqonpqwjr"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgopenapi"; - const monitorName = "ipxmlcbonyxtolzejcjshkmlron"; - const ruleSetName = "bxcantgzggsepbhqmedjqyrqeezmfb"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.tagRules.beginDeleteAndWait( - resourceGroupName, - monitorName, - ruleSetName - ); - console.log(result); -} - -/** - * This sample demonstrates how to Delete a TagRule - * - * @summary Delete a TagRule - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Delete_MinimumSet_Gen.json - */ -async function tagRulesDeleteMinimumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "ddqonpqwjr"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgopenapi"; - const monitorName = "ipxmlcbonyxtolzejcjshkmlron"; - const ruleSetName = "bxcantgzggsepbhqmedjqyrqeezmfb"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.tagRules.beginDeleteAndWait( - resourceGroupName, - monitorName, - ruleSetName - ); - console.log(result); -} - -async function main() { - tagRulesDeleteMaximumSetGen(); - tagRulesDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/tagRulesGetSample.ts b/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/tagRulesGetSample.ts deleted file mode 100644 index 046a6f4173f3..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/tagRulesGetSample.ts +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { NewRelicObservability } from "@azure/arm-newrelicobservability"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get a TagRule - * - * @summary Get a TagRule - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Get_MaximumSet_Gen.json - */ -async function tagRulesGetMaximumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "ddqonpqwjr"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgopenapi"; - const monitorName = "ipxmlcbonyxtolzejcjshkmlron"; - const ruleSetName = "bxcantgzggsepbhqmedjqyrqeezmfb"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.tagRules.get( - resourceGroupName, - monitorName, - ruleSetName - ); - console.log(result); -} - -/** - * This sample demonstrates how to Get a TagRule - * - * @summary Get a TagRule - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Get_MinimumSet_Gen.json - */ -async function tagRulesGetMinimumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "ddqonpqwjr"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgopenapi"; - const monitorName = "ipxmlcbonyxtolzejcjshkmlron"; - const ruleSetName = "bxcantgzggsepbhqmedjqyrqeezmfb"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.tagRules.get( - resourceGroupName, - monitorName, - ruleSetName - ); - console.log(result); -} - -async function main() { - tagRulesGetMaximumSetGen(); - tagRulesGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/tagRulesListByNewRelicMonitorResourceSample.ts b/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/tagRulesListByNewRelicMonitorResourceSample.ts deleted file mode 100644 index 011ed0a27f33..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/tagRulesListByNewRelicMonitorResourceSample.ts +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { NewRelicObservability } from "@azure/arm-newrelicobservability"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List TagRule resources by NewRelicMonitorResource - * - * @summary List TagRule resources by NewRelicMonitorResource - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_ListByNewRelicMonitorResource_MaximumSet_Gen.json - */ -async function tagRulesListByNewRelicMonitorResourceMaximumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "ddqonpqwjr"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgopenapi"; - const monitorName = "ipxmlcbonyxtolzejcjshkmlron"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.tagRules.listByNewRelicMonitorResource( - resourceGroupName, - monitorName - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List TagRule resources by NewRelicMonitorResource - * - * @summary List TagRule resources by NewRelicMonitorResource - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_ListByNewRelicMonitorResource_MinimumSet_Gen.json - */ -async function tagRulesListByNewRelicMonitorResourceMinimumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "ddqonpqwjr"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgopenapi"; - const monitorName = "ipxmlcbonyxtolzejcjshkmlron"; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.tagRules.listByNewRelicMonitorResource( - resourceGroupName, - monitorName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - tagRulesListByNewRelicMonitorResourceMaximumSetGen(); - tagRulesListByNewRelicMonitorResourceMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/tagRulesUpdateSample.ts b/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/tagRulesUpdateSample.ts deleted file mode 100644 index 12b176a63e2b..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/src/tagRulesUpdateSample.ts +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - TagRuleUpdate, - NewRelicObservability -} from "@azure/arm-newrelicobservability"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Update a TagRule - * - * @summary Update a TagRule - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Update_MaximumSet_Gen.json - */ -async function tagRulesUpdateMaximumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "ddqonpqwjr"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgopenapi"; - const monitorName = "ipxmlcbonyxtolzejcjshkmlron"; - const ruleSetName = "bxcantgzggsepbhqmedjqyrqeezmfb"; - const properties: TagRuleUpdate = { - logRules: { - filteringTags: [ - { - name: "saokgpjvdlorciqbjmjxazpee", - action: "Include", - value: "sarxrqsxouhdjwsrqqicbeirdb" - } - ], - sendAadLogs: "Enabled", - sendActivityLogs: "Enabled", - sendSubscriptionLogs: "Enabled" - }, - metricRules: { - filteringTags: [ - { - name: "saokgpjvdlorciqbjmjxazpee", - action: "Include", - value: "sarxrqsxouhdjwsrqqicbeirdb" - } - ], - userEmail: "test@testing.com" - } - }; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.tagRules.update( - resourceGroupName, - monitorName, - ruleSetName, - properties - ); - console.log(result); -} - -/** - * This sample demonstrates how to Update a TagRule - * - * @summary Update a TagRule - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Update_MinimumSet_Gen.json - */ -async function tagRulesUpdateMinimumSetGen() { - const subscriptionId = - process.env["NEWRELICOBSERVABILITY_SUBSCRIPTION_ID"] || "ddqonpqwjr"; - const resourceGroupName = - process.env["NEWRELICOBSERVABILITY_RESOURCE_GROUP"] || "rgopenapi"; - const monitorName = "ipxmlcbonyxtolzejcjshkmlron"; - const ruleSetName = "bxcantgzggsepbhqmedjqyrqeezmfb"; - const properties: TagRuleUpdate = {}; - const credential = new DefaultAzureCredential(); - const client = new NewRelicObservability(credential, subscriptionId); - const result = await client.tagRules.update( - resourceGroupName, - monitorName, - ruleSetName, - properties - ); - console.log(result); -} - -async function main() { - tagRulesUpdateMaximumSetGen(); - tagRulesUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/tsconfig.json b/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/tsconfig.json deleted file mode 100644 index e26ce2a6d8f7..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/samples/v1/typescript/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2020", - "module": "commonjs", - "moduleResolution": "node", - "resolveJsonModule": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "strict": true, - "alwaysStrict": true, - "outDir": "dist", - "rootDir": "src" - }, - "include": [ - "src/**.ts" - ] -} diff --git a/sdk/newrelicobservability/arm-newrelicobservability/src/models/index.ts b/sdk/newrelicobservability/arm-newrelicobservability/src/models/index.ts index d36e90eaf8e5..f95303c4c022 100644 --- a/sdk/newrelicobservability/arm-newrelicobservability/src/models/index.ts +++ b/sdk/newrelicobservability/arm-newrelicobservability/src/models/index.ts @@ -198,7 +198,7 @@ export interface AccountInfo { * This value contains a credential. Consider obscuring before showing to users */ ingestionKey?: string; - /** NewRelic account region */ + /** Region where New Relic account is present */ region?: string; } @@ -438,6 +438,62 @@ export interface MonitoredResource { reasonForLogsStatus?: string; } +/** Marketplace Subscription and Organization details to which resource gets billed into. */ +export interface BillingInfoResponse { + /** Marketplace Subscription details */ + marketplaceSaasInfo?: MarketplaceSaaSInfo; + /** Partner Billing Entity details: Organization Info */ + partnerBillingEntity?: PartnerBillingEntity; +} + +/** Marketplace SAAS Info of the resource. */ +export interface MarketplaceSaaSInfo { + /** Marketplace Subscription Id. This is a GUID-formatted string. */ + marketplaceSubscriptionId?: string; + /** Marketplace Subscription Details: SAAS Name */ + marketplaceSubscriptionName?: string; + /** Marketplace Subscription Details: Resource URI */ + marketplaceResourceId?: string; + /** Marketplace Subscription Details: SaaS Subscription Status */ + marketplaceStatus?: string; + /** The Azure Subscription ID to which the Marketplace Subscription belongs and gets billed into. */ + billedAzureSubscriptionId?: string; +} + +/** Partner Billing details associated with the resource. */ +export interface PartnerBillingEntity { + /** The New Relic Organization Id. */ + organizationId?: string; + /** The New Relic Organization Name. */ + organizationName?: string; +} + +/** List of all active newrelic deployments. */ +export interface ConnectedPartnerResourcesListResponse { + /** Results of a list operation. */ + value?: ConnectedPartnerResourcesListFormat[]; + /** Link to the next set of results, if any. */ + nextLink?: string; +} + +/** Connected Partner Resources List Format */ +export interface ConnectedPartnerResourcesListFormat { + /** Connected Partner Resource Properties */ + properties?: ConnectedPartnerResourceProperties; +} + +/** Connected Partner Resource Properties */ +export interface ConnectedPartnerResourceProperties { + /** NewRelic account name */ + accountName?: string; + /** NewRelic Account Id */ + accountId?: string; + /** The azure resource Id of the deployment. */ + azureResourceId?: string; + /** The location of the deployment. */ + location?: string; +} + /** The response of a TagRule list operation. */ export interface TagRuleListResult { /** The TagRule items on this page */ @@ -446,6 +502,19 @@ export interface TagRuleListResult { nextLink?: string; } +/** The resource-specific properties for this resource. */ +export interface MonitoringTagRulesProperties { + /** + * Provisioning State of the resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; + /** Set of rules for sending logs for the Monitor resource. */ + logRules?: LogRules; + /** Set of rules for sending metrics for the Monitor resource. */ + metricRules?: MetricRules; +} + /** Set of rules for sending logs for the Monitor resource. */ export interface LogRules { /** Flag specifying if AAD logs should be sent for the Monitor resource. */ @@ -469,6 +538,72 @@ export interface TagRuleUpdate { metricRules?: MetricRules; } +export interface MonitoredSubscriptionPropertiesList { + value?: MonitoredSubscriptionProperties[]; + /** The link to the next page of items */ + nextLink?: string; +} + +/** The request to update subscriptions needed to be monitored by the NewRelic monitor resource. */ +export interface MonitoredSubscriptionProperties { + /** + * Name of the monitored subscription resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The id of the monitored subscription resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The type of the monitored subscription resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** The request to update subscriptions needed to be monitored by the NewRelic monitor resource. */ + properties?: SubscriptionList; +} + +/** The request to update subscriptions needed to be monitored by the NewRelic monitor resource. */ +export interface SubscriptionList { + /** The operation for the patch on the resource. */ + patchOperation?: PatchOperation; + /** List of subscriptions and the state of the monitoring. */ + monitoredSubscriptionList?: MonitoredSubscription[]; + /** + * Provisioning State of the resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; +} + +/** The list of subscriptions and it's monitoring status by current NewRelic monitor. */ +export interface MonitoredSubscription { + /** The subscriptionId to be monitored. */ + subscriptionId?: string; + /** The state of monitoring. */ + status?: Status; + /** The reason of not monitoring the subscription. */ + error?: string; + /** The resource-specific properties for this resource. */ + tagRules?: MonitoringTagRulesProperties; +} + +/** Response of a list operation. */ +export interface LinkedResourceListResponse { + /** Results of a list operation. */ + value?: LinkedResource[]; + /** Link to the next set of results, if any. */ + nextLink?: string; +} + +/** The definition of a linked resource. */ +export interface LinkedResource { + /** The ARM id of the linked resource. */ + id?: string; +} + /** Response of payload to be passed while installing VM agent. */ export interface VMExtensionPayload { /** Ingestion key of the account */ @@ -524,7 +659,7 @@ export interface AccountResource extends ProxyResource { accountId?: string; /** account name */ accountName?: string; - /** region */ + /** Region where New Relic account is present */ region?: string; } @@ -637,6 +772,16 @@ export interface TagRulesDeleteHeaders { retryAfter?: number; } +/** Defines headers for MonitoredSubscriptions_update operation. */ +export interface MonitoredSubscriptionsUpdateHeaders { + location?: string; +} + +/** Defines headers for MonitoredSubscriptions_delete operation. */ +export interface MonitoredSubscriptionsDeleteHeaders { + location?: string; +} + /** Known values of {@link Origin} that the service accepts. */ export enum KnownOrigin { /** User */ @@ -1057,6 +1202,72 @@ export enum KnownSendActivityLogsStatus { */ export type SendActivityLogsStatus = string; +/** Known values of {@link PatchOperation} that the service accepts. */ +export enum KnownPatchOperation { + /** AddBegin */ + AddBegin = "AddBegin", + /** AddComplete */ + AddComplete = "AddComplete", + /** DeleteBegin */ + DeleteBegin = "DeleteBegin", + /** DeleteComplete */ + DeleteComplete = "DeleteComplete", + /** Active */ + Active = "Active" +} + +/** + * Defines values for PatchOperation. \ + * {@link KnownPatchOperation} can be used interchangeably with PatchOperation, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **AddBegin** \ + * **AddComplete** \ + * **DeleteBegin** \ + * **DeleteComplete** \ + * **Active** + */ +export type PatchOperation = string; + +/** Known values of {@link Status} that the service accepts. */ +export enum KnownStatus { + /** InProgress */ + InProgress = "InProgress", + /** Active */ + Active = "Active", + /** Failed */ + Failed = "Failed", + /** Deleting */ + Deleting = "Deleting" +} + +/** + * Defines values for Status. \ + * {@link KnownStatus} can be used interchangeably with Status, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **InProgress** \ + * **Active** \ + * **Failed** \ + * **Deleting** + */ +export type Status = string; + +/** Known values of {@link ConfigurationName} that the service accepts. */ +export enum KnownConfigurationName { + /** Default */ + Default = "default" +} + +/** + * Defines values for ConfigurationName. \ + * {@link KnownConfigurationName} can be used interchangeably with ConfigurationName, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **default** + */ +export type ConfigurationName = string; + /** Optional parameters. */ export interface OperationsListOptionalParams extends coreClient.OperationOptions {} @@ -1176,6 +1387,13 @@ export interface MonitorsListMonitoredResourcesOptionalParams /** Contains response data for the listMonitoredResources operation. */ export type MonitorsListMonitoredResourcesResponse = MonitoredResourceListResponse; +/** Optional parameters. */ +export interface MonitorsListLinkedResourcesOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listLinkedResources operation. */ +export type MonitorsListLinkedResourcesResponse = LinkedResourceListResponse; + /** Optional parameters. */ export interface MonitorsVmHostPayloadOptionalParams extends coreClient.OperationOptions {} @@ -1218,6 +1436,13 @@ export interface MonitorsListMonitoredResourcesNextOptionalParams /** Contains response data for the listMonitoredResourcesNext operation. */ export type MonitorsListMonitoredResourcesNextResponse = MonitoredResourceListResponse; +/** Optional parameters. */ +export interface MonitorsListLinkedResourcesNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listLinkedResourcesNext operation. */ +export type MonitorsListLinkedResourcesNextResponse = LinkedResourceListResponse; + /** Optional parameters. */ export interface OrganizationsListOptionalParams extends coreClient.OperationOptions {} @@ -1250,6 +1475,33 @@ export interface PlansListNextOptionalParams /** Contains response data for the listNext operation. */ export type PlansListNextResponse = PlanDataListResponse; +/** Optional parameters. */ +export interface BillingInfoGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type BillingInfoGetResponse = BillingInfoResponse; + +/** Optional parameters. */ +export interface ConnectedPartnerResourcesListOptionalParams + extends coreClient.OperationOptions { + /** Email Id of the user */ + body?: string; +} + +/** Contains response data for the list operation. */ +export type ConnectedPartnerResourcesListOperationResponse = ConnectedPartnerResourcesListResponse; + +/** Optional parameters. */ +export interface ConnectedPartnerResourcesListNextOptionalParams + extends coreClient.OperationOptions { + /** Email Id of the user */ + body?: string; +} + +/** Contains response data for the listNext operation. */ +export type ConnectedPartnerResourcesListNextResponse = ConnectedPartnerResourcesListResponse; + /** Optional parameters. */ export interface TagRulesListByNewRelicMonitorResourceOptionalParams extends coreClient.OperationOptions {} @@ -1299,6 +1551,67 @@ export interface TagRulesListByNewRelicMonitorResourceNextOptionalParams /** Contains response data for the listByNewRelicMonitorResourceNext operation. */ export type TagRulesListByNewRelicMonitorResourceNextResponse = TagRuleListResult; +/** Optional parameters. */ +export interface MonitoredSubscriptionsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type MonitoredSubscriptionsListResponse = MonitoredSubscriptionPropertiesList; + +/** Optional parameters. */ +export interface MonitoredSubscriptionsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type MonitoredSubscriptionsGetResponse = MonitoredSubscriptionProperties; + +/** Optional parameters. */ +export interface MonitoredSubscriptionsCreateorUpdateOptionalParams + extends coreClient.OperationOptions { + /** The request to update subscriptions needed to be monitored by the NewRelic monitor resource. */ + body?: MonitoredSubscriptionProperties; + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createorUpdate operation. */ +export type MonitoredSubscriptionsCreateorUpdateResponse = MonitoredSubscriptionProperties; + +/** Optional parameters. */ +export interface MonitoredSubscriptionsUpdateOptionalParams + extends coreClient.OperationOptions { + /** The request to update subscriptions needed to be monitored by the NewRelic monitor resource. */ + body?: MonitoredSubscriptionProperties; + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the update operation. */ +export type MonitoredSubscriptionsUpdateResponse = MonitoredSubscriptionProperties; + +/** Optional parameters. */ +export interface MonitoredSubscriptionsDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the delete operation. */ +export type MonitoredSubscriptionsDeleteResponse = MonitoredSubscriptionsDeleteHeaders; + +/** Optional parameters. */ +export interface MonitoredSubscriptionsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type MonitoredSubscriptionsListNextResponse = MonitoredSubscriptionPropertiesList; + /** Optional parameters. */ export interface NewRelicObservabilityOptionalParams extends coreClient.ServiceClientOptions { diff --git a/sdk/newrelicobservability/arm-newrelicobservability/src/models/mappers.ts b/sdk/newrelicobservability/arm-newrelicobservability/src/models/mappers.ts index 0c88745701c4..adc937ff3d75 100644 --- a/sdk/newrelicobservability/arm-newrelicobservability/src/models/mappers.ts +++ b/sdk/newrelicobservability/arm-newrelicobservability/src/models/mappers.ts @@ -1142,6 +1142,165 @@ export const MonitoredResource: coreClient.CompositeMapper = { } }; +export const BillingInfoResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BillingInfoResponse", + modelProperties: { + marketplaceSaasInfo: { + serializedName: "marketplaceSaasInfo", + type: { + name: "Composite", + className: "MarketplaceSaaSInfo" + } + }, + partnerBillingEntity: { + serializedName: "partnerBillingEntity", + type: { + name: "Composite", + className: "PartnerBillingEntity" + } + } + } + } +}; + +export const MarketplaceSaaSInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MarketplaceSaaSInfo", + modelProperties: { + marketplaceSubscriptionId: { + serializedName: "marketplaceSubscriptionId", + type: { + name: "String" + } + }, + marketplaceSubscriptionName: { + serializedName: "marketplaceSubscriptionName", + type: { + name: "String" + } + }, + marketplaceResourceId: { + serializedName: "marketplaceResourceId", + type: { + name: "String" + } + }, + marketplaceStatus: { + serializedName: "marketplaceStatus", + type: { + name: "String" + } + }, + billedAzureSubscriptionId: { + serializedName: "billedAzureSubscriptionId", + type: { + name: "String" + } + } + } + } +}; + +export const PartnerBillingEntity: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PartnerBillingEntity", + modelProperties: { + organizationId: { + serializedName: "organizationId", + type: { + name: "String" + } + }, + organizationName: { + serializedName: "organizationName", + type: { + name: "String" + } + } + } + } +}; + +export const ConnectedPartnerResourcesListResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ConnectedPartnerResourcesListResponse", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ConnectedPartnerResourcesListFormat" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const ConnectedPartnerResourcesListFormat: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ConnectedPartnerResourcesListFormat", + modelProperties: { + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "ConnectedPartnerResourceProperties" + } + } + } + } +}; + +export const ConnectedPartnerResourceProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ConnectedPartnerResourceProperties", + modelProperties: { + accountName: { + serializedName: "accountName", + type: { + name: "String" + } + }, + accountId: { + serializedName: "accountId", + type: { + name: "String" + } + }, + azureResourceId: { + serializedName: "azureResourceId", + type: { + name: "String" + } + }, + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + export const TagRuleListResult: coreClient.CompositeMapper = { type: { name: "Composite", @@ -1170,6 +1329,36 @@ export const TagRuleListResult: coreClient.CompositeMapper = { } }; +export const MonitoringTagRulesProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MonitoringTagRulesProperties", + modelProperties: { + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + logRules: { + serializedName: "logRules", + type: { + name: "Composite", + className: "LogRules" + } + }, + metricRules: { + serializedName: "metricRules", + type: { + name: "Composite", + className: "MetricRules" + } + } + } + } +}; + export const LogRules: coreClient.CompositeMapper = { type: { name: "Composite", @@ -1232,6 +1421,180 @@ export const TagRuleUpdate: coreClient.CompositeMapper = { } }; +export const MonitoredSubscriptionPropertiesList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MonitoredSubscriptionPropertiesList", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MonitoredSubscriptionProperties" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const MonitoredSubscriptionProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MonitoredSubscriptionProperties", + modelProperties: { + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "SubscriptionList" + } + } + } + } +}; + +export const SubscriptionList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SubscriptionList", + modelProperties: { + patchOperation: { + serializedName: "patchOperation", + type: { + name: "String" + } + }, + monitoredSubscriptionList: { + serializedName: "monitoredSubscriptionList", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MonitoredSubscription" + } + } + } + }, + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const MonitoredSubscription: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MonitoredSubscription", + modelProperties: { + subscriptionId: { + serializedName: "subscriptionId", + type: { + name: "String" + } + }, + status: { + serializedName: "status", + type: { + name: "String" + } + }, + error: { + serializedName: "error", + type: { + name: "String" + } + }, + tagRules: { + serializedName: "tagRules", + type: { + name: "Composite", + className: "MonitoringTagRulesProperties" + } + } + } + } +}; + +export const LinkedResourceListResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LinkedResourceListResponse", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "LinkedResource" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const LinkedResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LinkedResource", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } + } + } + } +}; + export const VMExtensionPayload: coreClient.CompositeMapper = { type: { name: "Composite", @@ -1649,3 +2012,33 @@ export const TagRulesDeleteHeaders: coreClient.CompositeMapper = { } } }; + +export const MonitoredSubscriptionsUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MonitoredSubscriptionsUpdateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const MonitoredSubscriptionsDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MonitoredSubscriptionsDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; diff --git a/sdk/newrelicobservability/arm-newrelicobservability/src/models/parameters.ts b/sdk/newrelicobservability/arm-newrelicobservability/src/models/parameters.ts index 2cae3884655e..7df62bdc29c5 100644 --- a/sdk/newrelicobservability/arm-newrelicobservability/src/models/parameters.ts +++ b/sdk/newrelicobservability/arm-newrelicobservability/src/models/parameters.ts @@ -20,7 +20,8 @@ import { SwitchBillingRequest as SwitchBillingRequestMapper, HostsGetRequest as HostsGetRequestMapper, TagRule as TagRuleMapper, - TagRuleUpdate as TagRuleUpdateMapper + TagRuleUpdate as TagRuleUpdateMapper, + MonitoredSubscriptionProperties as MonitoredSubscriptionPropertiesMapper } from "../models/mappers"; export const accept: OperationParameter = { @@ -50,7 +51,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2022-07-01", + defaultValue: "2023-11-01-preview", isConstant: true, serializedName: "api-version", type: { @@ -180,6 +181,20 @@ export const request4: OperationParameter = { mapper: HostsGetRequestMapper }; +export const monitorName1: OperationURLParameter = { + parameterPath: "monitorName", + mapper: { + constraints: { + Pattern: new RegExp("^.*$") + }, + serializedName: "monitorName", + required: true, + type: { + name: "String" + } + } +}; + export const accountId: OperationQueryParameter = { parameterPath: ["options", "accountId"], mapper: { @@ -200,6 +215,21 @@ export const organizationId: OperationQueryParameter = { } }; +export const body: OperationParameter = { + parameterPath: ["options", "body"], + mapper: { + constraints: { + Pattern: new RegExp( + "^[A-Za-z0-9._%+-]+@(?:[A-Za-z0-9-]+\\.)+[A-Za-z]{2,}$" + ) + }, + serializedName: "body", + type: { + name: "String" + } + } +}; + export const ruleSetName: OperationURLParameter = { parameterPath: "ruleSetName", mapper: { @@ -220,3 +250,19 @@ export const properties1: OperationParameter = { parameterPath: "properties", mapper: TagRuleUpdateMapper }; + +export const configurationName: OperationURLParameter = { + parameterPath: "configurationName", + mapper: { + serializedName: "configurationName", + required: true, + type: { + name: "String" + } + } +}; + +export const body1: OperationParameter = { + parameterPath: ["options", "body"], + mapper: MonitoredSubscriptionPropertiesMapper +}; diff --git a/sdk/newrelicobservability/arm-newrelicobservability/src/newRelicObservability.ts b/sdk/newrelicobservability/arm-newrelicobservability/src/newRelicObservability.ts index 90b13e7e6ae9..a84185d7ace9 100644 --- a/sdk/newrelicobservability/arm-newrelicobservability/src/newRelicObservability.ts +++ b/sdk/newrelicobservability/arm-newrelicobservability/src/newRelicObservability.ts @@ -20,7 +20,10 @@ import { MonitorsImpl, OrganizationsImpl, PlansImpl, - TagRulesImpl + BillingInfoImpl, + ConnectedPartnerResourcesImpl, + TagRulesImpl, + MonitoredSubscriptionsImpl } from "./operations"; import { Operations, @@ -28,7 +31,10 @@ import { Monitors, Organizations, Plans, - TagRules + BillingInfo, + ConnectedPartnerResources, + TagRules, + MonitoredSubscriptions } from "./operationsInterfaces"; import { NewRelicObservabilityOptionalParams } from "./models"; @@ -64,7 +70,7 @@ export class NewRelicObservability extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-newrelicobservability/1.0.1`; + const packageDetails = `azsdk-js-arm-newrelicobservability/1.1.0-beta.1`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -117,13 +123,16 @@ export class NewRelicObservability extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2022-07-01"; + this.apiVersion = options.apiVersion || "2023-11-01-preview"; this.operations = new OperationsImpl(this); this.accounts = new AccountsImpl(this); this.monitors = new MonitorsImpl(this); this.organizations = new OrganizationsImpl(this); this.plans = new PlansImpl(this); + this.billingInfo = new BillingInfoImpl(this); + this.connectedPartnerResources = new ConnectedPartnerResourcesImpl(this); this.tagRules = new TagRulesImpl(this); + this.monitoredSubscriptions = new MonitoredSubscriptionsImpl(this); this.addCustomApiVersionPolicy(options.apiVersion); } @@ -160,5 +169,8 @@ export class NewRelicObservability extends coreClient.ServiceClient { monitors: Monitors; organizations: Organizations; plans: Plans; + billingInfo: BillingInfo; + connectedPartnerResources: ConnectedPartnerResources; tagRules: TagRules; + monitoredSubscriptions: MonitoredSubscriptions; } diff --git a/sdk/newrelicobservability/arm-newrelicobservability/src/operations/billingInfo.ts b/sdk/newrelicobservability/arm-newrelicobservability/src/operations/billingInfo.ts new file mode 100644 index 000000000000..878dca42a170 --- /dev/null +++ b/sdk/newrelicobservability/arm-newrelicobservability/src/operations/billingInfo.ts @@ -0,0 +1,72 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { BillingInfo } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { NewRelicObservability } from "../newRelicObservability"; +import { + BillingInfoGetOptionalParams, + BillingInfoGetResponse +} from "../models"; + +/** Class containing BillingInfo operations. */ +export class BillingInfoImpl implements BillingInfo { + private readonly client: NewRelicObservability; + + /** + * Initialize a new instance of the class BillingInfo class. + * @param client Reference to the service client + */ + constructor(client: NewRelicObservability) { + this.client = client; + } + + /** + * Get marketplace info mapped to the given monitor. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource + * @param options The options parameters. + */ + get( + resourceGroupName: string, + monitorName: string, + options?: BillingInfoGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, options }, + getOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/getBillingInfo", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.BillingInfoResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName1 + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/newrelicobservability/arm-newrelicobservability/src/operations/connectedPartnerResources.ts b/sdk/newrelicobservability/arm-newrelicobservability/src/operations/connectedPartnerResources.ts new file mode 100644 index 000000000000..a281b2e80557 --- /dev/null +++ b/sdk/newrelicobservability/arm-newrelicobservability/src/operations/connectedPartnerResources.ts @@ -0,0 +1,200 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { ConnectedPartnerResources } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { NewRelicObservability } from "../newRelicObservability"; +import { + ConnectedPartnerResourcesListFormat, + ConnectedPartnerResourcesListNextOptionalParams, + ConnectedPartnerResourcesListOptionalParams, + ConnectedPartnerResourcesListOperationResponse, + ConnectedPartnerResourcesListNextResponse +} from "../models"; + +/// +/** Class containing ConnectedPartnerResources operations. */ +export class ConnectedPartnerResourcesImpl + implements ConnectedPartnerResources { + private readonly client: NewRelicObservability; + + /** + * Initialize a new instance of the class ConnectedPartnerResources class. + * @param client Reference to the service client + */ + constructor(client: NewRelicObservability) { + this.client = client; + } + + /** + * List of all active deployments that are associated with the marketplace subscription linked to the + * given monitor. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + monitorName: string, + options?: ConnectedPartnerResourcesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroupName, monitorName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceGroupName, + monitorName, + options, + settings + ); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + monitorName: string, + options?: ConnectedPartnerResourcesListOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: ConnectedPartnerResourcesListOperationResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, monitorName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + monitorName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + resourceGroupName: string, + monitorName: string, + options?: ConnectedPartnerResourcesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + monitorName, + options + )) { + yield* page; + } + } + + /** + * List of all active deployments that are associated with the marketplace subscription linked to the + * given monitor. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + monitorName: string, + options?: ConnectedPartnerResourcesListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, options }, + listOperationSpec + ); + } + + /** + * ListNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + monitorName: string, + nextLink: string, + options?: ConnectedPartnerResourcesListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/listConnectedPartnerResources", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.ConnectedPartnerResourcesListResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName1 + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ConnectedPartnerResourcesListResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName1 + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; diff --git a/sdk/newrelicobservability/arm-newrelicobservability/src/operations/index.ts b/sdk/newrelicobservability/arm-newrelicobservability/src/operations/index.ts index 82c1c5ac8be6..cd7ee152aba1 100644 --- a/sdk/newrelicobservability/arm-newrelicobservability/src/operations/index.ts +++ b/sdk/newrelicobservability/arm-newrelicobservability/src/operations/index.ts @@ -11,4 +11,7 @@ export * from "./accounts"; export * from "./monitors"; export * from "./organizations"; export * from "./plans"; +export * from "./billingInfo"; +export * from "./connectedPartnerResources"; export * from "./tagRules"; +export * from "./monitoredSubscriptions"; diff --git a/sdk/newrelicobservability/arm-newrelicobservability/src/operations/monitoredSubscriptions.ts b/sdk/newrelicobservability/arm-newrelicobservability/src/operations/monitoredSubscriptions.ts new file mode 100644 index 000000000000..e500c093805d --- /dev/null +++ b/sdk/newrelicobservability/arm-newrelicobservability/src/operations/monitoredSubscriptions.ts @@ -0,0 +1,636 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { MonitoredSubscriptions } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { NewRelicObservability } from "../newRelicObservability"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + MonitoredSubscriptionProperties, + MonitoredSubscriptionsListNextOptionalParams, + MonitoredSubscriptionsListOptionalParams, + MonitoredSubscriptionsListResponse, + ConfigurationName, + MonitoredSubscriptionsGetOptionalParams, + MonitoredSubscriptionsGetResponse, + MonitoredSubscriptionsCreateorUpdateOptionalParams, + MonitoredSubscriptionsCreateorUpdateResponse, + MonitoredSubscriptionsUpdateOptionalParams, + MonitoredSubscriptionsUpdateResponse, + MonitoredSubscriptionsDeleteOptionalParams, + MonitoredSubscriptionsDeleteResponse, + MonitoredSubscriptionsListNextResponse +} from "../models"; + +/// +/** Class containing MonitoredSubscriptions operations. */ +export class MonitoredSubscriptionsImpl implements MonitoredSubscriptions { + private readonly client: NewRelicObservability; + + /** + * Initialize a new instance of the class MonitoredSubscriptions class. + * @param client Reference to the service client + */ + constructor(client: NewRelicObservability) { + this.client = client; + } + + /** + * List the subscriptions currently being monitored by the NewRelic monitor resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + monitorName: string, + options?: MonitoredSubscriptionsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroupName, monitorName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceGroupName, + monitorName, + options, + settings + ); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + monitorName: string, + options?: MonitoredSubscriptionsListOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: MonitoredSubscriptionsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, monitorName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + monitorName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + resourceGroupName: string, + monitorName: string, + options?: MonitoredSubscriptionsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + monitorName, + options + )) { + yield* page; + } + } + + /** + * List the subscriptions currently being monitored by the NewRelic monitor resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + monitorName: string, + options?: MonitoredSubscriptionsListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, options }, + listOperationSpec + ); + } + + /** + * List the subscriptions currently being monitored by the NewRelic monitor resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource + * @param configurationName The configuration name. Only 'default' value is supported. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + monitorName: string, + configurationName: ConfigurationName, + options?: MonitoredSubscriptionsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, configurationName, options }, + getOperationSpec + ); + } + + /** + * Add the subscriptions that should be monitored by the NewRelic monitor resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource + * @param configurationName The configuration name. Only 'default' value is supported. + * @param options The options parameters. + */ + async beginCreateorUpdate( + resourceGroupName: string, + monitorName: string, + configurationName: ConfigurationName, + options?: MonitoredSubscriptionsCreateorUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + MonitoredSubscriptionsCreateorUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, monitorName, configurationName, options }, + spec: createorUpdateOperationSpec + }); + const poller = await createHttpPoller< + MonitoredSubscriptionsCreateorUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + await poller.poll(); + return poller; + } + + /** + * Add the subscriptions that should be monitored by the NewRelic monitor resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource + * @param configurationName The configuration name. Only 'default' value is supported. + * @param options The options parameters. + */ + async beginCreateorUpdateAndWait( + resourceGroupName: string, + monitorName: string, + configurationName: ConfigurationName, + options?: MonitoredSubscriptionsCreateorUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateorUpdate( + resourceGroupName, + monitorName, + configurationName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Updates the subscriptions that are being monitored by the NewRelic monitor resource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource + * @param configurationName The configuration name. Only 'default' value is supported. + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + monitorName: string, + configurationName: ConfigurationName, + options?: MonitoredSubscriptionsUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + MonitoredSubscriptionsUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, monitorName, configurationName, options }, + spec: updateOperationSpec + }); + const poller = await createHttpPoller< + MonitoredSubscriptionsUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + await poller.poll(); + return poller; + } + + /** + * Updates the subscriptions that are being monitored by the NewRelic monitor resource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource + * @param configurationName The configuration name. Only 'default' value is supported. + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + monitorName: string, + configurationName: ConfigurationName, + options?: MonitoredSubscriptionsUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + monitorName, + configurationName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Updates the subscriptions that are being monitored by the NewRelic monitor resource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource + * @param configurationName The configuration name. Only 'default' value is supported. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + monitorName: string, + configurationName: ConfigurationName, + options?: MonitoredSubscriptionsDeleteOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + MonitoredSubscriptionsDeleteResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, monitorName, configurationName, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller< + MonitoredSubscriptionsDeleteResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + await poller.poll(); + return poller; + } + + /** + * Updates the subscriptions that are being monitored by the NewRelic monitor resource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource + * @param configurationName The configuration name. Only 'default' value is supported. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + monitorName: string, + configurationName: ConfigurationName, + options?: MonitoredSubscriptionsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + monitorName, + configurationName, + options + ); + return poller.pollUntilDone(); + } + + /** + * ListNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + monitorName: string, + nextLink: string, + options?: MonitoredSubscriptionsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/monitoredSubscriptions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.MonitoredSubscriptionPropertiesList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName1 + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/monitoredSubscriptions/{configurationName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.MonitoredSubscriptionProperties + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName1, + Parameters.configurationName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createorUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/monitoredSubscriptions/{configurationName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.MonitoredSubscriptionProperties + }, + 201: { + bodyMapper: Mappers.MonitoredSubscriptionProperties + }, + 202: { + bodyMapper: Mappers.MonitoredSubscriptionProperties + }, + 204: { + bodyMapper: Mappers.MonitoredSubscriptionProperties + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName1, + Parameters.configurationName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/monitoredSubscriptions/{configurationName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.MonitoredSubscriptionProperties + }, + 201: { + bodyMapper: Mappers.MonitoredSubscriptionProperties + }, + 202: { + bodyMapper: Mappers.MonitoredSubscriptionProperties + }, + 204: { + bodyMapper: Mappers.MonitoredSubscriptionProperties + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName1, + Parameters.configurationName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/monitoredSubscriptions/{configurationName}", + httpMethod: "DELETE", + responses: { + 200: { + headersMapper: Mappers.MonitoredSubscriptionsDeleteHeaders + }, + 201: { + headersMapper: Mappers.MonitoredSubscriptionsDeleteHeaders + }, + 202: { + headersMapper: Mappers.MonitoredSubscriptionsDeleteHeaders + }, + 204: { + headersMapper: Mappers.MonitoredSubscriptionsDeleteHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName1, + Parameters.configurationName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.MonitoredSubscriptionPropertiesList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName1 + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/newrelicobservability/arm-newrelicobservability/src/operations/monitors.ts b/sdk/newrelicobservability/arm-newrelicobservability/src/operations/monitors.ts index dcc7dba7052f..47c9b51f0cc0 100644 --- a/sdk/newrelicobservability/arm-newrelicobservability/src/operations/monitors.ts +++ b/sdk/newrelicobservability/arm-newrelicobservability/src/operations/monitors.ts @@ -41,6 +41,10 @@ import { MonitorsListMonitoredResourcesNextOptionalParams, MonitorsListMonitoredResourcesOptionalParams, MonitorsListMonitoredResourcesResponse, + LinkedResource, + MonitorsListLinkedResourcesNextOptionalParams, + MonitorsListLinkedResourcesOptionalParams, + MonitorsListLinkedResourcesResponse, MonitorsGetOptionalParams, MonitorsGetResponse, MonitorsCreateOrUpdateOptionalParams, @@ -64,7 +68,8 @@ import { MonitorsListByResourceGroupNextResponse, MonitorsListAppServicesNextResponse, MonitorsListHostsNextResponse, - MonitorsListMonitoredResourcesNextResponse + MonitorsListMonitoredResourcesNextResponse, + MonitorsListLinkedResourcesNextResponse } from "../models"; /// @@ -473,6 +478,91 @@ export class MonitorsImpl implements Monitors { } } + /** + * List all Azure resources associated to the same NewRelic organization and account as the target + * resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource + * @param options The options parameters. + */ + public listLinkedResources( + resourceGroupName: string, + monitorName: string, + options?: MonitorsListLinkedResourcesOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listLinkedResourcesPagingAll( + resourceGroupName, + monitorName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listLinkedResourcesPagingPage( + resourceGroupName, + monitorName, + options, + settings + ); + } + }; + } + + private async *listLinkedResourcesPagingPage( + resourceGroupName: string, + monitorName: string, + options?: MonitorsListLinkedResourcesOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: MonitorsListLinkedResourcesResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listLinkedResources( + resourceGroupName, + monitorName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listLinkedResourcesNext( + resourceGroupName, + monitorName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listLinkedResourcesPagingAll( + resourceGroupName: string, + monitorName: string, + options?: MonitorsListLinkedResourcesOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listLinkedResourcesPagingPage( + resourceGroupName, + monitorName, + options + )) { + yield* page; + } + } + /** * List NewRelicMonitorResource resources by subscription ID * @param options The options parameters. @@ -833,6 +923,24 @@ export class MonitorsImpl implements Monitors { ); } + /** + * List all Azure resources associated to the same NewRelic organization and account as the target + * resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource + * @param options The options parameters. + */ + private _listLinkedResources( + resourceGroupName: string, + monitorName: string, + options?: MonitorsListLinkedResourcesOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, options }, + listLinkedResourcesOperationSpec + ); + } + /** * Returns the payload that needs to be passed in the request body for installing NewRelic agent on a * VM. @@ -943,6 +1051,25 @@ export class MonitorsImpl implements Monitors { listMonitoredResourcesNextOperationSpec ); } + + /** + * ListLinkedResourcesNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource + * @param nextLink The nextLink from the previous successful call to the ListLinkedResources method. + * @param options The options parameters. + */ + private _listLinkedResourcesNext( + resourceGroupName: string, + monitorName: string, + nextLink: string, + options?: MonitorsListLinkedResourcesNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, nextLink, options }, + listLinkedResourcesNextOperationSpec + ); + } } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); @@ -1233,6 +1360,28 @@ const listMonitoredResourcesOperationSpec: coreClient.OperationSpec = { headerParameters: [Parameters.accept], serializer }; +const listLinkedResourcesOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/listLinkedResources", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.LinkedResourceListResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName1 + ], + headerParameters: [Parameters.accept], + serializer +}; const vmHostPayloadOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/vmHostPayloads", @@ -1359,3 +1508,24 @@ const listMonitoredResourcesNextOperationSpec: coreClient.OperationSpec = { headerParameters: [Parameters.accept], serializer }; +const listLinkedResourcesNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.LinkedResourceListResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName1 + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/newrelicobservability/arm-newrelicobservability/src/operationsInterfaces/billingInfo.ts b/sdk/newrelicobservability/arm-newrelicobservability/src/operationsInterfaces/billingInfo.ts new file mode 100644 index 000000000000..b565b2a3a643 --- /dev/null +++ b/sdk/newrelicobservability/arm-newrelicobservability/src/operationsInterfaces/billingInfo.ts @@ -0,0 +1,27 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + BillingInfoGetOptionalParams, + BillingInfoGetResponse +} from "../models"; + +/** Interface representing a BillingInfo. */ +export interface BillingInfo { + /** + * Get marketplace info mapped to the given monitor. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource + * @param options The options parameters. + */ + get( + resourceGroupName: string, + monitorName: string, + options?: BillingInfoGetOptionalParams + ): Promise; +} diff --git a/sdk/newrelicobservability/arm-newrelicobservability/src/operationsInterfaces/connectedPartnerResources.ts b/sdk/newrelicobservability/arm-newrelicobservability/src/operationsInterfaces/connectedPartnerResources.ts new file mode 100644 index 000000000000..2cabba6d3759 --- /dev/null +++ b/sdk/newrelicobservability/arm-newrelicobservability/src/operationsInterfaces/connectedPartnerResources.ts @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + ConnectedPartnerResourcesListFormat, + ConnectedPartnerResourcesListOptionalParams +} from "../models"; + +/// +/** Interface representing a ConnectedPartnerResources. */ +export interface ConnectedPartnerResources { + /** + * List of all active deployments that are associated with the marketplace subscription linked to the + * given monitor. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource + * @param options The options parameters. + */ + list( + resourceGroupName: string, + monitorName: string, + options?: ConnectedPartnerResourcesListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/newrelicobservability/arm-newrelicobservability/src/operationsInterfaces/index.ts b/sdk/newrelicobservability/arm-newrelicobservability/src/operationsInterfaces/index.ts index 82c1c5ac8be6..cd7ee152aba1 100644 --- a/sdk/newrelicobservability/arm-newrelicobservability/src/operationsInterfaces/index.ts +++ b/sdk/newrelicobservability/arm-newrelicobservability/src/operationsInterfaces/index.ts @@ -11,4 +11,7 @@ export * from "./accounts"; export * from "./monitors"; export * from "./organizations"; export * from "./plans"; +export * from "./billingInfo"; +export * from "./connectedPartnerResources"; export * from "./tagRules"; +export * from "./monitoredSubscriptions"; diff --git a/sdk/newrelicobservability/arm-newrelicobservability/src/operationsInterfaces/monitoredSubscriptions.ts b/sdk/newrelicobservability/arm-newrelicobservability/src/operationsInterfaces/monitoredSubscriptions.ts new file mode 100644 index 000000000000..93fc84684cb9 --- /dev/null +++ b/sdk/newrelicobservability/arm-newrelicobservability/src/operationsInterfaces/monitoredSubscriptions.ts @@ -0,0 +1,145 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + MonitoredSubscriptionProperties, + MonitoredSubscriptionsListOptionalParams, + ConfigurationName, + MonitoredSubscriptionsGetOptionalParams, + MonitoredSubscriptionsGetResponse, + MonitoredSubscriptionsCreateorUpdateOptionalParams, + MonitoredSubscriptionsCreateorUpdateResponse, + MonitoredSubscriptionsUpdateOptionalParams, + MonitoredSubscriptionsUpdateResponse, + MonitoredSubscriptionsDeleteOptionalParams, + MonitoredSubscriptionsDeleteResponse +} from "../models"; + +/// +/** Interface representing a MonitoredSubscriptions. */ +export interface MonitoredSubscriptions { + /** + * List the subscriptions currently being monitored by the NewRelic monitor resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource + * @param options The options parameters. + */ + list( + resourceGroupName: string, + monitorName: string, + options?: MonitoredSubscriptionsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * List the subscriptions currently being monitored by the NewRelic monitor resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource + * @param configurationName The configuration name. Only 'default' value is supported. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + monitorName: string, + configurationName: ConfigurationName, + options?: MonitoredSubscriptionsGetOptionalParams + ): Promise; + /** + * Add the subscriptions that should be monitored by the NewRelic monitor resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource + * @param configurationName The configuration name. Only 'default' value is supported. + * @param options The options parameters. + */ + beginCreateorUpdate( + resourceGroupName: string, + monitorName: string, + configurationName: ConfigurationName, + options?: MonitoredSubscriptionsCreateorUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + MonitoredSubscriptionsCreateorUpdateResponse + > + >; + /** + * Add the subscriptions that should be monitored by the NewRelic monitor resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource + * @param configurationName The configuration name. Only 'default' value is supported. + * @param options The options parameters. + */ + beginCreateorUpdateAndWait( + resourceGroupName: string, + monitorName: string, + configurationName: ConfigurationName, + options?: MonitoredSubscriptionsCreateorUpdateOptionalParams + ): Promise; + /** + * Updates the subscriptions that are being monitored by the NewRelic monitor resource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource + * @param configurationName The configuration name. Only 'default' value is supported. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + monitorName: string, + configurationName: ConfigurationName, + options?: MonitoredSubscriptionsUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + MonitoredSubscriptionsUpdateResponse + > + >; + /** + * Updates the subscriptions that are being monitored by the NewRelic monitor resource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource + * @param configurationName The configuration name. Only 'default' value is supported. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + monitorName: string, + configurationName: ConfigurationName, + options?: MonitoredSubscriptionsUpdateOptionalParams + ): Promise; + /** + * Updates the subscriptions that are being monitored by the NewRelic monitor resource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource + * @param configurationName The configuration name. Only 'default' value is supported. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + monitorName: string, + configurationName: ConfigurationName, + options?: MonitoredSubscriptionsDeleteOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + MonitoredSubscriptionsDeleteResponse + > + >; + /** + * Updates the subscriptions that are being monitored by the NewRelic monitor resource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource + * @param configurationName The configuration name. Only 'default' value is supported. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + monitorName: string, + configurationName: ConfigurationName, + options?: MonitoredSubscriptionsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/newrelicobservability/arm-newrelicobservability/src/operationsInterfaces/monitors.ts b/sdk/newrelicobservability/arm-newrelicobservability/src/operationsInterfaces/monitors.ts index 9fb24a88b754..274870784c9f 100644 --- a/sdk/newrelicobservability/arm-newrelicobservability/src/operationsInterfaces/monitors.ts +++ b/sdk/newrelicobservability/arm-newrelicobservability/src/operationsInterfaces/monitors.ts @@ -20,6 +20,8 @@ import { MonitorsListHostsOptionalParams, MonitoredResource, MonitorsListMonitoredResourcesOptionalParams, + LinkedResource, + MonitorsListLinkedResourcesOptionalParams, MonitorsGetOptionalParams, MonitorsGetResponse, MonitorsCreateOrUpdateOptionalParams, @@ -97,6 +99,18 @@ export interface Monitors { monitorName: string, options?: MonitorsListMonitoredResourcesOptionalParams ): PagedAsyncIterableIterator; + /** + * List all Azure resources associated to the same NewRelic organization and account as the target + * resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource + * @param options The options parameters. + */ + listLinkedResources( + resourceGroupName: string, + monitorName: string, + options?: MonitorsListLinkedResourcesOptionalParams + ): PagedAsyncIterableIterator; /** * Get a NewRelicMonitorResource * @param resourceGroupName The name of the resource group. The name is case insensitive. diff --git a/sdk/newrelicobservability/arm-newrelicobservability/test/newrelicobservability_operations_test.spec.ts.ts b/sdk/newrelicobservability/arm-newrelicobservability/test/newrelicobservability_operations_test.spec.ts.ts deleted file mode 100644 index 53d650efd0b1..000000000000 --- a/sdk/newrelicobservability/arm-newrelicobservability/test/newrelicobservability_operations_test.spec.ts.ts +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { - env, - Recorder, - RecorderStartOptions, - delay, - isPlaybackMode, -} from "@azure-tools/test-recorder"; -import { createTestCredential } from "@azure-tools/test-credential"; -import { assert } from "chai"; -import { Context } from "mocha"; -import { NewRelicObservability } from "../src/newRelicObservability"; - -const replaceableVariables: Record = { - AZURE_CLIENT_ID: "azure_client_id", - AZURE_CLIENT_SECRET: "azure_client_secret", - AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", - SUBSCRIPTION_ID: "azure_subscription_id" -}; - -const recorderOptions: RecorderStartOptions = { - envSetupForPlayback: replaceableVariables -}; - -export const testPollingOptions = { - updateIntervalInMs: isPlaybackMode() ? 0 : undefined, -}; - -describe("NewRelicObservability test", () => { - let recorder: Recorder; - let subscriptionId: string; - let client: NewRelicObservability; - let location: string; - let resourceGroup: string; - let resourcename: string; - - beforeEach(async function (this: Context) { - recorder = new Recorder(this.currentTest); - await recorder.start(recorderOptions); - subscriptionId = env.SUBSCRIPTION_ID || ''; - // This is an example of how the environment variables are used - const credential = createTestCredential(); - client = new NewRelicObservability(credential, subscriptionId, recorder.configureClientOptions({})); - location = "eastus"; - resourceGroup = "myjstest"; - resourcename = "resourcetest"; - - }); - - afterEach(async function () { - await recorder.stop(); - }); - - it("operations list test", async function () { - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - }); - -}) diff --git a/sdk/newrelicobservability/arm-newrelicobservability/test/sampleTest.ts b/sdk/newrelicobservability/arm-newrelicobservability/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/newrelicobservability/arm-newrelicobservability/test/sampleTest.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + Recorder, + RecorderStartOptions, + env +} from "@azure-tools/test-recorder"; +import { assert } from "chai"; +import { Context } from "mocha"; + +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/newrelicobservability/arm-newrelicobservability/tsconfig.json b/sdk/newrelicobservability/arm-newrelicobservability/tsconfig.json index d5412a5206c2..3e6ae96443f3 100644 --- a/sdk/newrelicobservability/arm-newrelicobservability/tsconfig.json +++ b/sdk/newrelicobservability/arm-newrelicobservability/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-newrelicobservability": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"