Skip to content

Commit

Permalink
CodeGen from PR 21761 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge 653f6cdde3728e5021229d1d78d8699e41d70600 into 7b47689d4efc098f25f46781f05f22179c153314
  • Loading branch information
SDKAuto committed Jan 26, 2023
1 parent f266acd commit 840b3d5
Show file tree
Hide file tree
Showing 62 changed files with 14,694 additions and 2,536 deletions.
2 changes: 1 addition & 1 deletion sdk/machinelearning/arm-machinelearning/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2022 Microsoft
Copyright (c) 2023 Microsoft

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
26 changes: 13 additions & 13 deletions sdk/machinelearning/arm-machinelearning/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# AzureMachineLearningWorkspaces client library for JavaScript
# Azure Machine Learning client library for JavaScript

This package contains an isomorphic SDK (runs both in Node.js and in browsers) for AzureMachineLearningWorkspaces client.
This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure Machine Learning client.

These APIs allow end users to operate on Azure Machine Learning Workspace resources.

[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/machinelearning/arm-machinelearning) |
[Package (NPM)](https://www.npmjs.com/package/@azure/arm-machinelearning) |
[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-machinelearning) |
[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-machinelearning?view=azure-node-preview) |
[Samples](https://github.com/Azure-Samples/azure-samples-js-management)

## Getting started
Expand All @@ -24,16 +24,16 @@ See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUP

### Install the `@azure/arm-machinelearning` package

Install the AzureMachineLearningWorkspaces client library for JavaScript with `npm`:
Install the Azure Machine Learning client library for JavaScript with `npm`:

```bash
npm install @azure/arm-machinelearning
```

### Create and authenticate a `AzureMachineLearningWorkspaces`
### Create and authenticate a `AzureMachineLearningServices`

To create a client object to access the AzureMachineLearningWorkspaces API, you will need the `endpoint` of your AzureMachineLearningWorkspaces resource and a `credential`. The AzureMachineLearningWorkspaces client can use Azure Active Directory credentials to authenticate.
You can find the endpoint for your AzureMachineLearningWorkspaces resource in the [Azure Portal][azure_portal].
To create a client object to access the Azure Machine Learning API, you will need the `endpoint` of your Azure Machine Learning resource and a `credential`. The Azure Machine Learning client can use Azure Active Directory credentials to authenticate.
You can find the endpoint for your Azure Machine Learning resource in the [Azure Portal][azure_portal].

You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token).

Expand All @@ -43,25 +43,25 @@ To use the [DefaultAzureCredential][defaultazurecredential] provider shown below
npm install @azure/identity
```

You will also need to **register a new AAD application and grant access to AzureMachineLearningWorkspaces** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions).
You will also need to **register a new AAD application and grant access to Azure Machine Learning** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions).
Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`.

For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal).

```javascript
const { AzureMachineLearningWorkspaces } = require("@azure/arm-machinelearning");
const { AzureMachineLearningServices } = require("@azure/arm-machinelearning");
const { DefaultAzureCredential } = require("@azure/identity");
// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details.

const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new AzureMachineLearningWorkspaces(new DefaultAzureCredential(), subscriptionId);
const client = new AzureMachineLearningServices(new DefaultAzureCredential(), subscriptionId);

// For client-side applications running in the browser, use this code instead:
// const credential = new InteractiveBrowserCredential({
// tenantId: "<YOUR_TENANT_ID>",
// clientId: "<YOUR_CLIENT_ID>"
// });
// const client = new AzureMachineLearningWorkspaces(credential, subscriptionId);
// const client = new AzureMachineLearningServices(credential, subscriptionId);
```


Expand All @@ -70,9 +70,9 @@ To use this client library in the browser, first you need to use a bundler. For

## Key concepts

### AzureMachineLearningWorkspaces
### AzureMachineLearningServices

`AzureMachineLearningWorkspaces` is the primary interface for developers using the AzureMachineLearningWorkspaces client library. Explore the methods on this client object to understand the different features of the AzureMachineLearningWorkspaces service that you can access.
`AzureMachineLearningServices` is the primary interface for developers using the Azure Machine Learning client library. Explore the methods on this client object to understand the different features of the Azure Machine Learning service that you can access.

## Troubleshooting

Expand Down
8 changes: 4 additions & 4 deletions sdk/machinelearning/arm-machinelearning/_meta.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"commit": "1fefe3f5cee88319b17c08a2dbf95e1e983a9f8c",
"commit": "e7affd9446e9a712b7c58e5c43393cdc025b8dae",
"readme": "specification/machinelearningservices/resource-manager/readme.md",
"autorest_command": "autorest --version=3.8.4 --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\\machinelearningservices\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.3.20221108.1 --generate-sample=true",
"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=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/machinelearningservices/resource-manager/readme.md --use=@autorest/typescript@6.0.0-rc.5",
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
"release_tool": "@azure-tools/js-sdk-release-tools@2.4.2",
"use": "@autorest/typescript@6.0.0-rc.3.20221108.1"
"release_tool": "@azure-tools/js-sdk-release-tools@2.6.0",
"use": "@autorest/typescript@6.0.0-rc.5"
}
18 changes: 5 additions & 13 deletions sdk/machinelearning/arm-machinelearning/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"name": "@azure/arm-machinelearning",
"sdk-type": "mgmt",
"author": "Microsoft Corporation",
"description": "A generated SDK for AzureMachineLearningWorkspaces.",
"version": "2.1.2",
"description": "A generated SDK for AzureMachineLearningServices.",
"version": "1.0.0-beta.1",
"engines": {
"node": ">=14.0.0"
},
Expand Down Expand Up @@ -105,18 +105,10 @@
"//metadata": {
"constantPaths": [
{
"path": "src/azureMachineLearningWorkspaces.ts",
"path": "src/azureMachineLearningServices.ts",
"prefix": "packageDetails"
}
]
},
"autoPublish": true,
"//sampleConfiguration": {
"productName": "",
"productSlugs": [
"azure"
],
"disableDocsMs": true,
"apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-machinelearning?view=azure-node-preview"
}
}
"autoPublish": true
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ import {
PrivateEndpointConnectionsImpl,
PrivateLinkResourcesImpl,
WorkspaceConnectionsImpl,
RegistryCodeContainersImpl,
RegistryCodeVersionsImpl,
RegistryComponentContainersImpl,
RegistryComponentVersionsImpl,
RegistryEnvironmentContainersImpl,
RegistryEnvironmentVersionsImpl,
RegistryModelContainersImpl,
RegistryModelVersionsImpl,
BatchEndpointsImpl,
BatchDeploymentsImpl,
CodeContainersImpl,
Expand All @@ -36,11 +44,13 @@ import {
EnvironmentContainersImpl,
EnvironmentVersionsImpl,
JobsImpl,
LabelingJobsImpl,
ModelContainersImpl,
ModelVersionsImpl,
OnlineEndpointsImpl,
OnlineDeploymentsImpl,
SchedulesImpl,
RegistriesImpl,
WorkspaceFeaturesImpl
} from "./operations";
import {
Expand All @@ -53,6 +63,14 @@ import {
PrivateEndpointConnections,
PrivateLinkResources,
WorkspaceConnections,
RegistryCodeContainers,
RegistryCodeVersions,
RegistryComponentContainers,
RegistryComponentVersions,
RegistryEnvironmentContainers,
RegistryEnvironmentVersions,
RegistryModelContainers,
RegistryModelVersions,
BatchEndpoints,
BatchDeployments,
CodeContainers,
Expand All @@ -65,30 +83,32 @@ import {
EnvironmentContainers,
EnvironmentVersions,
Jobs,
LabelingJobs,
ModelContainers,
ModelVersions,
OnlineEndpoints,
OnlineDeployments,
Schedules,
Registries,
WorkspaceFeatures
} from "./operationsInterfaces";
import { AzureMachineLearningWorkspacesOptionalParams } from "./models";
import { AzureMachineLearningServicesOptionalParams } from "./models";

export class AzureMachineLearningWorkspaces extends coreClient.ServiceClient {
export class AzureMachineLearningServices extends coreClient.ServiceClient {
$host: string;
apiVersion: string;
subscriptionId: string;

/**
* Initializes a new instance of the AzureMachineLearningWorkspaces class.
* Initializes a new instance of the AzureMachineLearningServices class.
* @param credentials Subscription credentials which uniquely identify client subscription.
* @param subscriptionId The ID of the target subscription.
* @param options The parameter options
*/
constructor(
credentials: coreAuth.TokenCredential,
subscriptionId: string,
options?: AzureMachineLearningWorkspacesOptionalParams
options?: AzureMachineLearningServicesOptionalParams
) {
if (credentials === undefined) {
throw new Error("'credentials' cannot be null");
Expand All @@ -101,12 +121,12 @@ export class AzureMachineLearningWorkspaces extends coreClient.ServiceClient {
if (!options) {
options = {};
}
const defaults: AzureMachineLearningWorkspacesOptionalParams = {
const defaults: AzureMachineLearningServicesOptionalParams = {
requestContentType: "application/json; charset=utf-8",
credential: credentials
};

const packageDetails = `azsdk-js-arm-machinelearning/2.1.2`;
const packageDetails = `azsdk-js-arm-machinelearning/1.0.0-beta.1`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
Expand Down Expand Up @@ -159,7 +179,7 @@ export class AzureMachineLearningWorkspaces extends coreClient.ServiceClient {

// Assigning values to Constant parameters
this.$host = options.$host || "https://management.azure.com";
this.apiVersion = options.apiVersion || "2022-10-01";
this.apiVersion = options.apiVersion || "2022-12-01-preview";
this.operations = new OperationsImpl(this);
this.workspaces = new WorkspacesImpl(this);
this.usages = new UsagesImpl(this);
Expand All @@ -169,6 +189,20 @@ export class AzureMachineLearningWorkspaces extends coreClient.ServiceClient {
this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this);
this.privateLinkResources = new PrivateLinkResourcesImpl(this);
this.workspaceConnections = new WorkspaceConnectionsImpl(this);
this.registryCodeContainers = new RegistryCodeContainersImpl(this);
this.registryCodeVersions = new RegistryCodeVersionsImpl(this);
this.registryComponentContainers = new RegistryComponentContainersImpl(
this
);
this.registryComponentVersions = new RegistryComponentVersionsImpl(this);
this.registryEnvironmentContainers = new RegistryEnvironmentContainersImpl(
this
);
this.registryEnvironmentVersions = new RegistryEnvironmentVersionsImpl(
this
);
this.registryModelContainers = new RegistryModelContainersImpl(this);
this.registryModelVersions = new RegistryModelVersionsImpl(this);
this.batchEndpoints = new BatchEndpointsImpl(this);
this.batchDeployments = new BatchDeploymentsImpl(this);
this.codeContainers = new CodeContainersImpl(this);
Expand All @@ -181,11 +215,13 @@ export class AzureMachineLearningWorkspaces extends coreClient.ServiceClient {
this.environmentContainers = new EnvironmentContainersImpl(this);
this.environmentVersions = new EnvironmentVersionsImpl(this);
this.jobs = new JobsImpl(this);
this.labelingJobs = new LabelingJobsImpl(this);
this.modelContainers = new ModelContainersImpl(this);
this.modelVersions = new ModelVersionsImpl(this);
this.onlineEndpoints = new OnlineEndpointsImpl(this);
this.onlineDeployments = new OnlineDeploymentsImpl(this);
this.schedules = new SchedulesImpl(this);
this.registries = new RegistriesImpl(this);
this.workspaceFeatures = new WorkspaceFeaturesImpl(this);
this.addCustomApiVersionPolicy(options.apiVersion);
}
Expand Down Expand Up @@ -227,6 +263,14 @@ export class AzureMachineLearningWorkspaces extends coreClient.ServiceClient {
privateEndpointConnections: PrivateEndpointConnections;
privateLinkResources: PrivateLinkResources;
workspaceConnections: WorkspaceConnections;
registryCodeContainers: RegistryCodeContainers;
registryCodeVersions: RegistryCodeVersions;
registryComponentContainers: RegistryComponentContainers;
registryComponentVersions: RegistryComponentVersions;
registryEnvironmentContainers: RegistryEnvironmentContainers;
registryEnvironmentVersions: RegistryEnvironmentVersions;
registryModelContainers: RegistryModelContainers;
registryModelVersions: RegistryModelVersions;
batchEndpoints: BatchEndpoints;
batchDeployments: BatchDeployments;
codeContainers: CodeContainers;
Expand All @@ -239,10 +283,12 @@ export class AzureMachineLearningWorkspaces extends coreClient.ServiceClient {
environmentContainers: EnvironmentContainers;
environmentVersions: EnvironmentVersions;
jobs: Jobs;
labelingJobs: LabelingJobs;
modelContainers: ModelContainers;
modelVersions: ModelVersions;
onlineEndpoints: OnlineEndpoints;
onlineDeployments: OnlineDeployments;
schedules: Schedules;
registries: Registries;
workspaceFeatures: WorkspaceFeatures;
}
2 changes: 1 addition & 1 deletion sdk/machinelearning/arm-machinelearning/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
/// <reference lib="esnext.asynciterable" />
export { getContinuationToken } from "./pagingHelper";
export * from "./models";
export { AzureMachineLearningWorkspaces } from "./azureMachineLearningWorkspaces";
export { AzureMachineLearningServices } from "./azureMachineLearningServices";
export * from "./operationsInterfaces";
Loading

0 comments on commit 840b3d5

Please sign in to comment.