Ce référentiel contient un projet de preuve de concept pour Azure Machine Learning Studio Management.
La solution comprend des bibliothèques de classe ( DLL ) .NET Standard 2.0 , qui peuvent être incorporées dans de nombreuses applications .NET et être utilisées pour l'échelle et automatiser les espaces de travail et les expériences de studio Azure ML.
Pour le moment, le projet est en phase de pré-libération - soyez conscient des erreurs et des exceptions possibles avant de l'utiliser!
L'idée de créer un outil pour gérer Azure Machine Learning Studio est née lors de la réunion avec notre partenaire SONETA / ENOVA365 .
Notre partenaire recherchait des solutions qui pourraient aider à automatiser et à évoluer des expériences dans Azure ML Studio Portal. Après l'analyse initiale des outils disponibles, j'ai découvert le seul que j'ai utilisé plus tard comme base pour la solution actuelle ( Source: Module PowerShell pour Azure Machine Learning Studio & Web Services ) - cette solution a été développée pour les utilisateurs de PowerShell, et l'implémentation C # Code (SDK) m'a aidé comme base pour créer ce projet.
Cette solution a été créée pour l'utilisation d'Azure Machine Learning Studio Resources - Workspace, Experiment, Database, Modules, etc. Nous avons besoin d'un compte approprié pour pouvoir travailler en utilisant cette bibliothèque.
Nous pouvons créer différents types d'espaces de travail, car notre bibliothèque doit traiter tout type de compte.
Visitez le site Web principal d'Azure Machine Learning Studio et créez simplement un nouveau compte - https://studio.azureml.net/
Vous devriez le remarquer:

Alternativement, créez un compte Azure avec un abonnement.
Et créer un espace de travail avec le portail:




Azureml.studio.dll et azureml.studio.core.dll sont des bibliothèques de classe écrites dans .NET Standard 2.0.
"La norme .NET est une spécification formelle des API .NET qui sont destinées à être disponibles sur toutes les implémentations .NET. La motivation derrière la norme .NET consiste à établir une plus grande uniformité dans l'écosystème .NET. ECMA 335 continue d'établir un comportement d'implémentation .NET, mais il n'y a pas de spécification similaire pour les bibliothèques de classe de base .NET (BCL) pour les implémentations de la bibliothèque .net."
Vous pouvez utiliser ces DLL en particulier, cependant avant d'utiliser Concider le tableau suivant de toutes les versions de .NET Standard et les plates-formes prises en charge ( Source: .NET Standard ):
| .NET Norme | 1.0 | 1.1 | 1.2 | 1.3 | 1.4 | 1.5 | 1.6 | 2.0 |
|---|---|---|---|---|---|---|---|---|
| .Net noyau | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 2.0 |
| .NET Framework | 4.5 | 4.5 | 4.5.1 | 4.6 | 4.6.1 | 4.6.1 | 4.6.1 | 4.6.1 |
| Mono | 4.6 | 4.6 | 4.6 | 4.6 | 4.6 | 4.6 | 4.6 | 5.4 |
| Xamarin.ios | 10.0 | 10.0 | 10.0 | 10.0 | 10.0 | 10.0 | 10.0 | 10.14 |
| Xamarin.mac | 3.0 | 3.0 | 3.0 | 3.0 | 3.0 | 3.0 | 3.0 | 3.8 |
| Xamarin.android | 7.0 | 7.0 | 7.0 | 7.0 | 7.0 | 7.0 | 7.0 | 8.0 |
| Plateforme Windows universelle | 10.0 | 10.0 | 10.0 | 10.0 | 10.0 | 10.0.16299 | 10.0.16299 | 10.0.16299 |
Vous avez peut-être besoin d'outils tels que les éditeurs de code, les IDE ou les notes de notes et les bibliothèques à travers lesquels vous pouvez créer une application .NET. Dans ce cas, j'ai utilisé Visual Studio avec des frameworks appropriés pour exécuter une application de console à titre d'exemple.
( De la source: https://github.com/hning86/azuremlps#configuration ):
ID de l'espace de travail

Jeton d'autorisation de l'espace de travail

Emplacement


using AzureML . Studio . Core . Models ;
namespace AzureML . Studio . ConsoleApplicationExample
{
class Program
{
static void Main ( string [ ] args )
{
var studioClient = new StudioClient ( ) ;
var workspaceSettings = WorkspaceSettings ( ) ;
workspaceSettings . WorkspaceId = "XYZ" ;
workspaceSettings . AuthorizationToken = "######" ;
workspaceSettings . Location = "" ;
var workspace = studioClient . GetWorkspace ( workspaceSettings ) ;
.. .
.. .
} var workspace = studioClient . GetWorkspace ( workspaceSettings ) ; var workspace = studioClient . GetWorkspace ( "XYZ" , "######" , "" ) ; IEnumerable < WorkspaceSettings > workspacesSettings ;
var workspaces = studioClient . GetWorkspaces ( workspacesSettings ) ; var users = studioClient . GetWorkspaceUsers ( workspaceSettings ) ; var users = studioClient . GetWorkspaceUsers ( "XYZ" , "######" , "" ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
var users = studioClient . GetWorkspaceUsers ( workspace ) ; IEnumerable < WorkspaceSettings > workspacesSettings ;
var workspaceUsersdictionary = studioClient . GetWorkspacesUsers ( workspacesSettings ) ; IEnumerable < Workspace > workspaces ;
var workspaceUsersdictionary = studioClient . GetWorkspacesUsers ( workspaces ) ; var workspaceUser = new WorkspaceUser (
new WorkspaceUserInternal ( ) {
User = new UserDetailInternal ( ) {
Email = "email" , Role = "role" } } ) ) ;
studioClient . AddUserToWorkspace ( workspaceSettings , workspaceUser ) ; studioClient . AddUserToWorkspace ( workspaceSettings , "email" , "role" ) ; studioClient . AddUserToWorkspace ( "XYZ" , "######" , "" , workspaceUser ) ; studioClient . AddUserToWorkspace ( "XYZ" , "######" , "" , "email" , "role" ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
studioClient . AddUserToWorkspace ( workspace , workspaceUser ) ; studioClient . AddUserToWorkspace ( workspace , "email" , "role" ) ; IEnumerable < WorkspaceSettings > workspacesSettings ;
var workspaceUser = new WorkspaceUser (
new WorkspaceUserInternal ( ) {
User = new UserDetailInternal ( ) {
Email = "email" , Role = "role" } } ) ) ;
studioClient . AddUserToWorkspaces ( workspacesSettings , workspaceUser ) ; studioClient . AddUserToWorkspaces ( workspacesSettings , "email" , "role" ) ; IEnumerable < Workspace > workspaces ;
studioClient . AddUserToWorkspaces ( workspaces , workspaceUser ) ; studioClient . AddUserToWorkspaces ( workspaces , "email" , "role" ) ; IEnumerable < WorkspaceUser > workspaceUsers ;
studioClient . AddUsersToWorkspace ( workspaceSettings , workspaceUsers ) ; studioClient . AddUsersToWorkspace ( "XYZ" , "######" , "" , workspaceUsers ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
studioClient . AddUsersToWorkspace ( workspace , workspaceUsers ) ; IEnumerable < WorkspaceSettings > workspacesSettings ;
IEnumerable < WorkspaceUser > workspaceUsers ;
studioClient . AddUsersToWorkspaces ( workspacesSettings , workspaceUsers ) ; IEnumerable < Workspace > workspaces ;
studioClient . AddUsersToWorkspaces ( workspaces , workspaceUsers ) ; var datasets = studioClient . GetDatasetsFromWorkspace ( workspaceSettings ) ; var datasets = studioClient . GetDatasetsFromWorkspace ( "XYZ" , "######" , "" ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
var datasets = studioClient . GetDatasetsFromWorkspace ( workspace ) ; IEnumerable < WorkspaceSettings > workspacesSettings ;
var workspaceDatasetsDictionary = studioClient . GetDatasetsFromWorkspaces ( workspacesSettings ) ; IEnumerable < Workspace > workspaces ;
var workspaceDatasetsDictionary = studioClient . GetDatasetsFromWorkspaces ( workspaces ) ; studioClient . DeleteDatasetFromWorkspace ( workspaceSettings , "datasetFamilyId" ) ; var dataset = new Dataset ( ) ;
dataset . FamilyId = "datasetFamilyId" ;
studioClient . DeleteDatasetFromWorkspace ( workspaceSettings , dataset ) ; studioClient . DeleteDatasetFromWorkspace ( "XYZ" , "######" , "" , dataset ) ; studioClient . DeleteDatasetFromWorkspace ( "XYZ" , "######" , "" , "datasetFamilyId" ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
studioClient . DeleteDatasetFromWorkspace ( workspace , "datasetFamilyId" ) studioClient . DeleteDatasetFromWorkspace ( workspace , dataset ) ; IEnumerable < Dataset > datasets ;
studioClient . DeleteDatasetsFromWorkspace ( workspaceSettings , datasets ) ; studioClient . DeleteDatasetsFromWorkspace ( "XYZ" , "######" , "" , datasets ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
studioClient . DeleteDatasetsFromWorkspace ( workspace , datasets ) ; studioClient . DeleteAllDatasetsFromWorkspace ( workspaceSettings ) ; studioClient . DeleteAllDatasetsFromWorkspace ( "XYZ" , "######" , "" ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
studioClient . DeleteAllDatasetsFromWorkspace ( workspace ) ; IEnumerable < WorkspaceSettings > workspacesSettings ;
studioClient . DeleteAllDatasetsFromWorkspaces ( workspacesSettings ) ; IEnumerable < Workspace > workspaces ;
studioClient . DeleteAllDatasetsFromWorkspaces ( workspaces ) ; studioClient . DownloadDatasetFromWorkspace ( workspaceSettings , "datasetId" , "fileName" ) ; studioClient . DownloadDatasetFromWorkspace ( "XYZ" , "######" , "" , "datasetId" , "fileName" ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
studioClient . DownloadDatasetFromWorkspace ( workspace , "datasetId" , "fileName" ) ; var dataset = new Dataset ( ) ;
dataset . Id = "datasetId" ;
studioClient . DownloadDatasetFromWorkspace ( workspaceSettings , dataset , "fileName" ) ; studioClient . DownloadDatasetFromWorkspace ( "XYZ" , "######" , "" , dataset , "fileName" ) ; studioClient . DownloadDatasetFromWorkspace ( workspace , dataset , "fileName" ) ; IEnumerable < Dataset > datasets ;
studioClient . DownloadDatasetsFromWorkspace ( workspaceSettings , datasets ) ; studioClient . DownloadDatasetsFromWorkspace ( "XYZ" , "######" , "" , datasets ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
studioClient . DownloadDatasetsFromWorkspace ( workspace , datasets ) ; studioClient . DownloadAllDatasetsFromWorkspace ( workspaceSettings ) ; studioClient . DownloadAllDatasetsFromWorkspace ( "XYZ" , "######" , "" ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
studioClient . DownloadAllDatasetsFromWorkspace ( workspace ) ; IEnumerable < WorkspaceSettings > workspacesSettings ;
studioClient . DownloadAllDatasetsFromWorkspaces ( workspacesSettings ) ; IEnumerable < Workspace > workspaces ;
studioClient . DownloadAllDatasetsFromWorkspaces ( workspaces ) ; Enum: ressourcefileformat.cs
ResourceFileFormat resourceFileFormat ;
async studioClient . UploadResourceToWorkspace ( workspaceSettings , resourceFileFormat , " filePath " ) ; async studioClient . UploadResourceToWorkspace ( "XYZ" , "######" , "" , resourceFileFormat , "filePath" ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
async studioClient . UploadResourceToWorkspace ( workspace , resourceFileFormat , " filePath " ) ; Enum: ressourcefileformat.cs
IDictionary < string , ResourceFileFormat > filePathResourceFileFormatDict ;
studioClient . UploadResourcesToWorkspace ( workspaceSettings , filePathResourceFileFormatDict ) ; studioClient . UploadResourcesToWorkspace ( "XYZ" , "######" , "" , filePathResourceFileFormatDict ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
studioClient . UploadResourcesToWorkspace ( workspace , filePathResourceFileFormatDict ) ; Enum: ressourcefileformat.cs
IEnumerable < WorkspaceSettings > workspacesSettings ;
ResourceFileFormat resourceFileFormat ;
studioClient . UploadResourceToWorkspaces ( workspacesSettings , resourceFileFormat , "filePath" ) ; IEnumerable < Workspace > workspaces ;
studioClient . UploadResourceToWorkspaces ( workspaces , resourceFileFormat , "filePath" ) ; Enum: ressourcefileformat.cs
IEnumerable < WorkspaceSettings > workspacesSettings ;
IDictionary < string , ResourceFileFormat > filePathResourceFileFormatDict ;
studioClient . UploadResourcesToWorkspaces ( workspacesSettings , filePathResourceFileFormatDict ) ; IEnumerable < Workspace > workspaces ;
studioClient . UploadResourcesToWorkspaces ( workspaces , filePathResourceFileFormatDict ) ; var experiment = studioClient . GetExperiment ( workspaceSettings , "experimentId" ) ; var experiment = studioClient . GetExperiment ( "XYZ" , "######" , "" , "experimentId" ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
var experiment = studioClient . GetExperiment ( workspace , "experimentId" ) ; IEnumerable < string > experimentsIds ;
var experiments = studioClient . GetExperiments ( workspaceSettings , experimentsIds ) ; var experiments = studioClient . GetExperiments ( "XYZ" , "######" , "" , experimentsIds ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
var experiments = studioClient . GetExperiments ( workspace , experimentsIds ) ; IEnumerable < WorkspaceSettings > workspacesSettings ;
var workspaceExperimentsDict = studioClient . GetAllExperiments ( workspacesSettings ) ; IEnumerable < Workspace > workspaces ;
var workspaceExperimentsDict = studioClient . GetAllExperiments ( workspaces ) ; var experiments = studioClient . GetAllExperiments ( workspaceSettings ) ; var experiments = studioClient . GetAllExperiments ( "XYZ" , "######" , "" ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
var experiments = studioClient . GetAllExperiments ( workspace ) ; studioClient . RunExperiment ( workspaceSettings , "experimentId" ) ; studioClient . RunExperiment ( "XYZ" , "######" , "" , "experimentId" ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
studioClient . RunExperiment ( workspace , "experimentId" ) ; var experiment = new Experiment ;
experiment . ExperimentId = "experimentId" ;
studioClient . RunExperiment ( workspaceSettings , experiment ) ; studioClient . RunExperiment ( "XYZ" , "######" , "" , experiment ) ; studioClient . RunExperiment ( workspace , experiment ) ; IEnumerable < string > experimentsIds ;
studioClient . RunExperiments ( workspaceSettings , experimentsIds ) ; studioClient . RunExperiments ( "XYZ" , "######" , "" , experimentsIds ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
studioClient . RunExperiments ( workspace , experimentsIds ) ; IEnumerable < Experiment > experiments ;
studioClient . RunExperiments ( workspaceSettings , experiments ) ; studioClient . RunExperiments ( "XYZ" , "######" , "" , experiments ) ; studioClient . RunExperiments ( workspace , experiments ) ; studioClient . RunAllExperiments ( workspaceSettings ) ; studioClient . RunAllExperiments ( "XYZ" , "######" , "" ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
studioClient . RunAllExperiments ( workspace ) ; IEnumerable < WorkspaceSettings > workspacesSettings ;
studioClient . RunAllExperiments ( workspacesSettings ) ; IEnumerable < Workspace > workspaces ;
studioClient . RunAllExperiments ( workspaces ) ; studioClient . SaveExperiment ( workspaceSettings , "experimentId" ) ; studioClient . SaveExperiment ( "XYZ" , "######" , "" , "experimentId" ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
studioClient . SaveExperiment ( workspace , "experimentId" ) ; var experiment = new Experiment ;
experiment . ExperimentId = "experimentId" ;
studioClient . SaveExperiment ( workspaceSettings , experiment ) ; studioClient . SaveExperiment ( "XYZ" , "######" , "" , experiment ) ; studioClient . SaveExperiment ( workspace , experiment ) ; IEnumerable < string > experimentsIds ;
studioClient . SaveExperiments ( workspaceSettings , experimentsIds ) ; studioClient . SaveExperiments ( "XYZ" , "######" , "" , experimentsIds ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
studioClient . SaveExperiments ( workspace , experimentsIds ) ; IEnumerable < Experiment > experiments ;
studioClient . SaveExperiments ( workspaceSettings , experiments ) ; studioClient . SaveExperiments ( "XYZ" , "######" , "" , experiments ) ; studioClient . SaveExperiments ( workspace , experiments ) ; studioClient . SaveAllExperiments ( workspaceSettings ) ; studioClient . SaveAllExperiments ( "XYZ" , "######" , "" ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
studioClient . SaveAllExperiments ( workspace ) ; IEnumerable < WorkspaceSettings > workspacesSettings ;
studioClient . SaveAllExperiments ( workspacesSettings ) ; IEnumerable < Workspace > workspaces ;
studioClient . SaveAllExperiments ( workspaces ) ; studioClient . SaveExperimentAs ( workspaceSettings , "experimentId" , "newName" ) ; studioClient . SaveExperimentAs ( "XYZ" , "######" , "" , "experimentId" , "newName" ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
studioClient . SaveExperimentAs ( workspace , "experimentId" , "newName" ) ; var experiment = new Experiment ;
experiment . ExperimentId = "experimentId" ;
studioClient . SaveExperimentAs ( workspaceSettings , experiment , "newName" ) ; studioClient . SaveExperimentAs ( "XYZ" , "######" , "" , experiment , "newName" ) ; studioClient . SaveExperimentAs ( workspace , experiment , "newName" ) ; studioClient . DeleteExperiment ( workspaceSettings , "experimentId" ) ; studioClient . DeleteExperiment ( "XYZ" , "######" , "" , "experimentId" ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
studioClient . DeleteExperiment ( workspace , "experimentId" ) ; var experiment = new Experiment ;
experiment . ExperimentId = "experimentId" ;
studioClient . DeleteExperiment ( workspaceSettings , experiment ) ; studioClient . DeleteExperiment ( "XYZ" , "######" , "" , experiment ) ; studioClient . DeleteExperiment ( workspace , experiment ) ; IEnumerable < string > experimentsIds ;
studioClient . DeleteExperiments ( workspaceSettings , experimentsIds ) ; studioClient . DeleteExperiments ( "XYZ" , "######" , "" , experimentsIds ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
studioClient . DeleteExperiments ( workspace , experimentsIds ) ; IEnumerable < Experiment > experiments ;
studioClient . DeleteExperiments ( workspaceSettings , experiments ) ; studioClient . DeleteExperiments ( "XYZ" , "######" , "" , experiments ) ; studioClient . DeleteExperiments ( workspace , experiments ) ; studioClient . DeleteAllExperiments ( workspaceSettings ) ; studioClient . DeleteAllExperiments ( "XYZ" , "######" , "" ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
studioClient . DeleteAllExperiments ( workspace ) ; IEnumerable < WorkspaceSettings > workspacesSettings ;
studioClient . DeleteAllExperiments ( workspacesSettings ) ; IEnumerable < Workspace > workspaces ;
studioClient . DeleteAllExperiments ( workspaces ) ; studioClient . ExportExperiment ( workspaceSettings , "experimentId" ) ; studioClient . ExportExperiment ( "XYZ" , "######" , "" , "experimentId" ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
studioClient . ExportExperiment ( workspace , "experimentId" ) ; var experiment = new Experiment ;
experiment . ExperimentId = "experimentId" ;
studioClient . ExportExperiment ( workspaceSettings , experiment ) ; studioClient . ExportExperiment ( "XYZ" , "######" , "" , experiment ) ; studioClient . ExportExperiment ( workspace , experiment ) ; studioClient . ExportExperiment ( workspaceSettings , "experimentId" , "outputFilePath" ) ; studioClient . ExportExperiment ( "XYZ" , "######" , "" , "experimentId" , "outputFilePath" ) ; studioClient . ExportExperiment ( workspace , "experimentId" , "outputFilePath" ) ; studioClient . ExportExperiment ( workspaceSettings , experiment , "outputFilePath" ) ; studioClient . ExportExperiment ( "XYZ" , "######" , "" , experiment , "outputFilePath" ) ; studioClient . ExportExperiment ( workspace , experiment , "outputFilePath" ) ; IEnumerable < string > experimentsIds ;
studioClient . ExportExperiments ( workspaceSettings , experimentsIds ) ; studioClient . ExportExperiments ( "XYZ" , "######" , "" , experimentsIds ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
studioClient . ExportExperiments ( workspace , experimentsIds ) ; IEnumerable < Experiment > experiments ;
studioClient . ExportExperiments ( workspaceSettings , experiments ) ; studioClient . ExportExperiments ( "XYZ" , "######" , "" , experiments ) ; studioClient . ExportExperiments ( workspace , experiments ) ; studioClient . ExportAllExperiments ( workspaceSettings ) ; studioClient . ExportAllExperiments ( "XYZ" , "######" , "" ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
studioClient . ExportAllExperiments ( workspace ) ; studioClient . ImportExperiment ( workspaceSettings , "inputFilePath" ) ; studioClient . ImportExperiment ( "XYZ" , "######" , "" , "inputFilePath" ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
studioClient . ImportExperiment ( workspace , "inputFilePath" ) ; IEnumerable < WorkspaceSettings > workspacesSettings ;
studioClient . ImportExperiment ( workspacesSettings , "inputFilePath" ) ; IEnumerable < Workspace > workspaces ;
studioClient . ImportExperiment ( workspaces , "inputFilePath" ) ; studioClient . ImportExperiment ( workspaceSettings , "inputFilePath" , "newName" ) ; studioClient . ImportExperiment ( "XYZ" , "######" , "" , "inputFilePath" , "newName" ) ; studioClient . ImportExperiment ( workspace , "inputFilePath" , "newName" ) ; studioClient . ImportExperiment ( workspacesSettings , "inputFilePath" , "newName" ) ; studioClient . ImportExperiment ( workspaces , "inputFilePath" , "newName" ) ; studioClient . CopyExperiment ( sourceWorkspaceSettings , "experimentId" , destinationWorkspaceSettings ) ; var experiment = new Experiment ;
experiment . ExperimentId = "experimentId" ;
studioClient . CopyExperiment ( sourceWorkspaceSettings , experiment , destinationWorkspaceSettings ) ; IEnumerable < string > experimentsIds ;
studioClient . CopyExperiments ( sourceWorkspaceSettings , experimentsIds , destinationWorkspaceSettings ) ; IEnumerable < Experiment > experiments ;
studioClient . CopyExperiments ( sourceWorkspaceSettings , experiments , destinationWorkspaceSettings ) ; studioClient . CopyAllExperiments ( sourceWorkspaceSettings , destinationWorkspaceSettings ) ; var userAsset = studioClient . GetTrainedModel ( workspaceSettings , "userAssetId" ) ; var userAsset = studioClient . GetTrainedModel ( "XYZ" , "######" , "" , "userAssetId" ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
var userAsset = studioClient . GetTrainedModel ( workspace , "userAssetId" ) ; var userAssets = studioClient . GetTrainedModels ( workspaceSettings ) ; var userAssets = studioClient . GetTrainedModels ( "XYZ" , "######" , "" ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
var userAssets = studioClient . GetTrainedModels ( workspace ) ; IEnumerable < WorkspaceSettings > workspacesSettings ;
var workspaceUserAssetsDict = studioClient . GetTrainedModels ( workspacesSettings ) ; IEnumerable < Workspace > workspaces ;
var workspaceUserAssetsDict = studioClient . GetTrainedModels ( workspaces ) ; var userAsset = studioClient . GetTransform ( workspaceSettings , "userAssetId" ) ; var userAsset = studioClient . GetTransform ( "XYZ" , "######" , "" , "userAssetId" ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
var userAsset = studioClient . GetTransform ( workspace , "userAssetId" ) ; var userAssets = studioClient . GetTransforms ( workspaceSettings ) ; var userAssets = studioClient . GetTransforms ( "XYZ" , "######" , "" ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
var userAssets = studioClient . GetTransforms ( workspace ) ; IEnumerable < WorkspaceSettings > workspacesSettings ;
var workspaceUserAssetsDict = studioClient . GetTransforms ( workspacesSettings ) ; IEnumerable < Workspace > workspaces ;
var workspaceUserAssetsDict = studioClient . GetTransforms ( workspaces ) ; studioClient . ModifyNodeParameter ( workspaceSettings , "experimentId" , "nodeNameComment" , "nodeParameterName" , "value" , "saveAs" ) ; studioClient . ModifyNodeParameter ( "XYZ" , "######" , "" , "experimentId" , "nodeNameComment" , "nodeParameterName" , "value" , "saveAs" ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
studioClient . ModifyNodeParameter ( workspace , "experimentId" , "nodeNameComment" , "nodeParameterName" , "value" , "saveAs" ) ; studioClient . ModifyNodeEdge ( workspaceSettings , "experimentId" , "sourceNodeComment" , "destinationNodeComment" , "saveAs" ) ; studioClient . ModifyNodeEdge ( "XYZ" , "######" , "" , "experimentId" , "sourceNodeComment" , "destinationNodeComment" , "saveAs" ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
studioClient . ModifyNodeEdge ( workspace , "experimentId" , "sourceNodeComment" , "destinationNodeComment" , "saveAs" ) ; studioClient . AddModule ( workspaceSettings , "experimentId" , "nameOfNewModule" , "saveAs" ) ; studioClient . AddModule ( "XYZ" , "######" , "" , "experimentId" , "nameOfNewModule" , "saveAs" ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
studioClient . AddModule ( workspace , "experimentId" , "nameOfNewModule" , "saveAs" ) ;De nombreuses lignes de code sont manquantes, mais à cet état, vous pourrez effectuer de nombreuses opérations de base.
Il y a un projet de test unitaire inclus, mais il est vide et il sera terminé dans la prochaine iterration du développement. Jusqu'à présent, j'ai testé peu d'opérations importantes dans l'application de console.
static void CopyExperimentFromWorkspaceToWorkspaceSamePricingSameRegion ( StudioClient studioClient )
{
var sourceWorkspace = new WorkspaceSettings ( )
{
WorkspaceId = "" ,
AuthorizationToken = "" ,
Location = "West Europe"
} ;
var destinationWorkspace = new WorkspaceSettings ( )
{
WorkspaceId = "" ,
AuthorizationToken = "" ,
Location = "West Europe"
} ;
//var experiments = studioClient.GetExperiments(sourceWorkspace);
var experimentId = "" ;
var experiment = studioClient . GetExperiment ( sourceWorkspace , experimentId ) ;
studioClient . CopyExperiment ( sourceWorkspace , experiment , destinationWorkspace ) ;
} static void CopyExperimentFromWorkspaceToWorkspaceDifferentPricingSameRegion ( StudioClient studioClient )
{
var sourceWorkspace = new WorkspaceSettings ( )
{
WorkspaceId = "" ,
AuthorizationToken = "" ,
Location = "West Europe"
} ;
var destinationWorkspace = new WorkspaceSettings ( )
{
WorkspaceId = "" ,
AuthorizationToken = "" ,
Location = "West Europe"
} ;
//var experiments = studioClient.GetExperiments(sourceWorkspace);
var experimentId = "" ;
var experiment = studioClient . GetExperiment ( sourceWorkspace , experimentId ) ;
studioClient . CopyExperiment ( sourceWorkspace , experiment , destinationWorkspace ) ;
} static void CopyExperimentFromWorkspaceToWorkspaceSamePricingDifferentRegion ( StudioClient studioClient )
{
var sourceWorkspace = new WorkspaceSettings ( )
{
WorkspaceId = "" ,
AuthorizationToken = "" ,
Location = "West Europe"
} ;
var destinationWorkspace = new WorkspaceSettings ( )
{
WorkspaceId = "" ,
AuthorizationToken = "" ,
Location = "West Europe"
} ;
//var experiments = studioClient.GetExperiments(sourceWorkspace);
var experimentId = "" ;
var experiment = studioClient . GetExperiment ( sourceWorkspace , experimentId ) ;
studioClient . ExportExperiment ( sourceWorkspace , experiment ) ;
var inputFilePath = @"C:...experimentFileName" ;
studioClient . ImportExperiment ( destinationWorkspace , inputFilePath , "Copied from other region" ) ;
} static void CopyExperimentFromWorkspaceToWorkspaceDifferentPricingDifferentRegion ( StudioClient studioClient )
{
var sourceWorkspace = new WorkspaceSettings ( )
{
WorkspaceId = "" ,
AuthorizationToken = "" ,
Location = "West Europe"
} ;
var destinationWorkspace = new WorkspaceSettings ( )
{
WorkspaceId = "" ,
AuthorizationToken = "" ,
Location = "West Europe"
} ;
//var experiments = studioClient.GetExperiments(sourceWorkspace);
var experimentId = "" ;
var experiment = studioClient . GetExperiment ( sourceWorkspace , experimentId ) ;
studioClient . ExportExperiment ( sourceWorkspace , experiment ) ;
var inputFilePath = @"C:...experimentFileName" ;
studioClient . ImportExperiment ( destinationWorkspace , inputFilePath , "Copied from other region" ) ;
}C'est à quoi cela ressemblait du point de vue du portail:






Modifier la valeur du paramètre du nœud d'une expérience et remplacer l'expérience:
static void ModifyExperimentNodeAndOverwrite ( StudioClient studioClient )
{
var workspace = new WorkspaceSettings ( )
{
WorkspaceId = "" ,
AuthorizationToken = "" ,
Location = "West Europe"
} ;
//var experiments = studioClient.GetExperiments(sourceWorkspace);
var experimentId = "" ;
var experiment = studioClient . GetExperiment ( workspace , experimentId ) ;
studioClient . ModifyNodeParameter ( workspace , experimentId , "Import Data Comment" , "Database Query" , "SELECT Name, ProductNumber, CAST(Weight AS float) Weight r n FROM SalesLT.Product" ) ;
}Modifiez la valeur du paramètre du nœud d'une expérience et l'enregistrement en tant que nouvelle expérience:
static void ModifyExperimentNodeAndSaveAsAnotherExperiment ( StudioClient studioClient )
{
var workspace = new WorkspaceSettings ( )
{
WorkspaceId = "" ,
AuthorizationToken = "" ,
Location = "West Europe"
} ;
//var experiments = studioClient.GetExperiments(sourceWorkspace);
var experimentId = "" ;
var experiment = studioClient . GetExperiment ( workspace , experimentId ) ;
studioClient . ModifyNodeParameter ( workspace , experimentId , "Import Data Comment" , "Database Query" , "SELECT Name, Color, CAST(Weight AS float) Weight r n FROM SalesLT.Product" , "Import Data - Experiment 2" ) ;
}De la vue du portail:




Modifiez la connexion dans les modules (nœuds) et remplacez l'expérience:
static void ModifyConnectionWithinTheModulesAndOverwrite ( StudioClient studioClient )
{
var workspace = new WorkspaceSettings ( )
{
WorkspaceId = "" ,
AuthorizationToken = "" ,
Location = ""
} ;
//var experiments = studioClient.GetExperiments(sourceWorkspace);
var experimentId = "" ;
var experiment = studioClient . GetExperiment ( workspace , experimentId ) ;
studioClient . ModifyNodeEdge ( workspace , experimentId , "CSV" , "Dataset" ) ;
}Modifiez la connexion dans les modules (nœuds) et enregistrez comme une nouvelle expérience:
static void ModifyConnectionWithinTheModulesAndSaveAsAnotherExperiment ( StudioClient studioClient )
{
var workspace = new WorkspaceSettings ( )
{
WorkspaceId = "" ,
AuthorizationToken = "" ,
Location = ""
} ;
//var experiments = studioClient.GetExperiments(sourceWorkspace);
var experimentId = "" ;
var experiment = studioClient . GetExperiment ( workspace , experimentId ) ;
studioClient . ModifyNodeEdge ( workspace , experimentId , "CSV" , "Dataset" , "Connect Modules - Experiment 2" ) ;
}Aaand de la vue du portail:





Ajouter un nouveau module à l'expérience et l'écraser:
static void AddModuleToTheExperimentAndOverwrite ( StudioClient studioClient )
{
var workspace = new WorkspaceSettings ( )
{
WorkspaceId = "" ,
AuthorizationToken = "" ,
Location = ""
} ;
//var experiments = studioClient.GetExperiments(sourceWorkspace);
var experimentId = "" ;
var experiment = studioClient . GetExperiment ( workspace , experimentId ) ;
var nameOfNewModule = "" ;
//nameOfNewModule hard-coded
//TODO: make a dictionary of <Module Names, Module IDs>
//EXAMPLES:
//Convert to TSV: 506153734175476c4f62416c57734963.1cdbcda42ece49088b87e6b636258d3d.v1-default-1644
//Convert to Dataset: 506153734175476c4f62416c57734963.72bf58e0fc874bb19704f1805003b975.v1-default-1642
studioClient . AddModule ( workspace , experimentId , nameOfNewModule ) ;
}Ajouter un nouveau module à l'expérience et l'enregistrement en tant que nouveau:
static void AddModuleToTheExperimentAndSaveAsAnotherExperiment ( StudioClient studioClient )
{
var workspace = new WorkspaceSettings ( )
{
WorkspaceId = "" ,
AuthorizationToken = "" ,
Location = ""
} ;
//var experiments = studioClient.GetExperiments(sourceWorkspace);
var experimentId = "" ;
var experiment = studioClient . GetExperiment ( workspace , experimentId ) ;
var nameOfNewModule = "" ;
//nameOfNewModule hard-coded
//TODO: make a dictionary of <Module Names, Module IDs>
//EXAMPLES:
//Convert to TSV: 506153734175476c4f62416c57734963.1cdbcda42ece49088b87e6b636258d3d.v1-default-1644
//Convert to Dataset: 506153734175476c4f62416c57734963.72bf58e0fc874bb19704f1805003b975.v1-default-1642
studioClient . AddModule ( workspace , experimentId , nameOfNewModule , "Connect Modules - Experiment 2" ) ;
}Code source du site Web et vue du portail:


Il y a beaucoup de pensées que j'ai eues lors du codage de cette solution. Surtout, il était difficile d'être cohérent en ce qui concerne les méthodes de dénomination, les classes ou même décrire des résumés de chaque instance. J'ai essayé d'être sûr que le code que j'ai créé ne serait pas un Spaghetti. La solution est toujours en développement et un support continu est nécessaire! À coup sûr, le refactorisation est un must dans de nombreux aspects et peu de principes doivent être mis en œuvre. De plus, peu de méthodes sont toujours un mystère pour moi, et je les ai laissées dans le SDK ( Managementservice.cs ) - vous devez les trouver!
De plus, j'ai rencontré plusieurs erreurs du portail lui-même. Ces bogues sont cachés quelque part dans ces opérations de copie / enregistrement.
Comme je l'ai écrit lors de la mendicité - c'est une version pré-libération qui contient de nombreuses erreurs et des exceptions non manquantes (la mise en œuvre de celles-ci figure sur ma liste de TOD). Savoir!!!
N'hésitez pas à contribuer, à fourche, à modifier, à coopérer. J'espère que cette bibliothèque sera utile.