public NotebookResource CreateOrUpdateNotebook(string notebookName, NotebookResource notebook) { var operation = _notebookClient.StartCreateOrUpdateNotebook(notebookName, notebook); while (!operation.HasValue) { operation.UpdateStatus(); } return(operation.Value); }
public void CreateNotebook() { #region Snippet:CreateNotebook Notebook notebook = new Notebook( new NotebookMetadata { LanguageInfo = new NotebookLanguageInfo(name: "Python") }, nbformat: 4, nbformatMinor: 2, new List <NotebookCell>() ); var createdNotebook = notebookClient.StartCreateOrUpdateNotebook("MyNotebook", new NotebookResource(notebook)); #endregion }
public void CreateNotebook() { #region Snippet:CreateNotebook Notebook notebook = new Notebook( new NotebookMetadata { LanguageInfo = new NotebookLanguageInfo(name: "Python") }, nbformat: 4, nbformatMinor: 2, new List <NotebookCell>() ); var operation = notebookClient.StartCreateOrUpdateNotebook("MyNotebook", new NotebookResource(notebook)); NotebookResource notebookResource = operation.WaitForCompletionAsync().ConfigureAwait(true).GetAwaiter().GetResult(); #endregion }
public async Task NotebookSample() { #region Snippet:CreateNotebookClient // Replace the string below with your actual endpoint url. string endpoint = "<my-endpoint-url>"; /*@@*/ endpoint = TestEnvironment.EndpointUrl; NotebookClient client = new NotebookClient(endpoint: new Uri(endpoint), credential: new DefaultAzureCredential()); #endregion #region Snippet:CreateNotebook Notebook newNotebook = new Notebook( new NotebookMetadata { LanguageInfo = new NotebookLanguageInfo(name: "Python") }, nbformat: 4, nbformatMinor: 2, new List <NotebookCell>() ); string notebookName = "MyNotebook"; NotebookCreateOrUpdateNotebookOperation operation = client.StartCreateOrUpdateNotebook(notebookName, new NotebookResource(notebookName, newNotebook)); Response <NotebookResource> createdNotebook = await operation.WaitForCompletionAsync(); #endregion #region Snippet:RetrieveNotebook NotebookResource retrievedNotebook = client.GetNotebook("MyNotebook"); #endregion #region Snippet:ListNotebooks Pageable <NotebookResource> notebooks = client.GetNotebooksByWorkspace(); foreach (NotebookResource notebook in notebooks) { System.Console.WriteLine(notebook.Name); } #endregion #region Snippet:DeleteNotebook client.StartDeleteNotebook("MyNotebook"); #endregion }
public NotebookResource CreateOrUpdateNotebook(string notebookName, NotebookResource notebook) { var operation = _notebookClient.StartCreateOrUpdateNotebook(notebookName, notebook); return(operation.Poll().Value); }