AWS code-library documentation change
Summary
Removed the 'Get started' section and all associated code examples for listing SageMaker notebook instances in .NET, Java, JavaScript, and Kotlin.
Security assessment
The change removes introductory code samples demonstrating how to list notebook instances. There is no evidence of security vulnerabilities being addressed, security features being documented, or security-related content in the removed material. The deletion appears to be routine content cleanup without security implications.
Diff
diff --git a/code-library/latest/ug/sagemaker_code_examples.md b/code-library/latest/ug/sagemaker_code_examples.md index fc2f01ecc..7ce93a88a 100644 --- a//code-library/latest/ug/sagemaker_code_examples.md +++ b//code-library/latest/ug/sagemaker_code_examples.md @@ -28,196 +27,0 @@ _Scenarios_ are code examples that show you how to accomplish specific tasks by -**Get started** - -The following code examples show how to get started using SageMaker AI. - -.NET - - -**SDK for .NET** - - -###### Note - -There's more on GitHub. Find the complete example and learn how to set up and run in the [AWS Code Examples Repository](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/dotnetv3/SageMaker#code-examples). - - - using Amazon.SageMaker; - using Amazon.SageMaker.Model; - - namespace SageMakerActions; - - public static class HelloSageMaker - { - static async Task Main(string[] args) - { - var sageMakerClient = new AmazonSageMakerClient(); - - Console.WriteLine($"Hello Amazon SageMaker! Let's list some of your notebook instances:"); - Console.WriteLine(); - - // You can use await and any of the async methods to get a response. - // Let's get the first five notebook instances. - var response = await sageMakerClient.ListNotebookInstancesAsync( - new ListNotebookInstancesRequest() - { - MaxResults = 5 - }); - - if (!response.NotebookInstances.Any()) - { - Console.WriteLine($"No notebook instances found."); - Console.WriteLine("See https://docs.aws.amazon.com/sagemaker/latest/dg/howitworks-create-ws.html to create one."); - } - - foreach (var notebookInstance in response.NotebookInstances) - { - Console.WriteLine($"\tInstance: {notebookInstance.NotebookInstanceName}"); - Console.WriteLine($"\tArn: {notebookInstance.NotebookInstanceArn}"); - Console.WriteLine($"\tCreation Date: {notebookInstance.CreationTime.ToShortDateString()}"); - Console.WriteLine(); - } - } - } - - - - * For API details, see [ListNotebookInstances](https://docs.aws.amazon.com/goto/DotNetSDKV3/sagemaker-2017-07-24/ListNotebookInstances) in _AWS SDK for .NET API Reference_. - - - - -Java - - -**SDK for Java 2.x** - - -###### Note - -There's more on GitHub. Find the complete example and learn how to set up and run in the [AWS Code Examples Repository](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/javav2/example_code/sagemaker#code-examples). - - - /** - * Before running this Java V2 code example, set up your development - * environment, including your credentials. - * - * For more information, see the following documentation topic: - * - * https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/get-started.html - */ - public class HelloSageMaker { - public static void main(String[] args) { - Region region = Region.US_WEST_2; - SageMakerClient sageMakerClient = SageMakerClient.builder() - .region(region) - .build(); - - listBooks(sageMakerClient); - sageMakerClient.close(); - } - - public static void listBooks(SageMakerClient sageMakerClient) { - try { - ListNotebookInstancesResponse notebookInstancesResponse = sageMakerClient.listNotebookInstances(); - List<NotebookInstanceSummary> items = notebookInstancesResponse.notebookInstances(); - for (NotebookInstanceSummary item : items) { - System.out.println("The notebook name is: " + item.notebookInstanceName()); - } - - } catch (SageMakerException e) { - System.err.println(e.awsErrorDetails().errorMessage()); - System.exit(1); - } - } - } - - - - * For API details, see [ListNotebookInstances](https://docs.aws.amazon.com/goto/SdkForJavaV2/sagemaker-2017-07-24/ListNotebookInstances) in _AWS SDK for Java 2.x API Reference_. - - - - -JavaScript - - -**SDK for JavaScript (v3)** - - -###### Note - -There's more on GitHub. Find the complete example and learn how to set up and run in the [AWS Code Examples Repository](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/javascriptv3/example_code/sagemaker#code-examples). - - - import { - SageMakerClient, - ListNotebookInstancesCommand, - } from "@aws-sdk/client-sagemaker"; - - const client = new SageMakerClient({ - region: "us-west-2", - }); - - export const helloSagemaker = async () => { - const command = new ListNotebookInstancesCommand({ MaxResults: 5 }); - - const response = await client.send(command); - console.log( - "Hello Amazon SageMaker! Let's list some of your notebook instances:", - ); - - const instances = response.NotebookInstances || []; - - if (instances.length === 0) { - console.log( - "• No notebook instances found. Try creating one in the AWS Management Console or with the CreateNotebookInstanceCommand.", - ); - } else { - console.log( - instances - .map( - (i) => - `• Instance: ${i.NotebookInstanceName}\n Arn:${ - i.NotebookInstanceArn - } \n Creation Date: ${i.CreationTime.toISOString()}`, - ) - .join("\n"), - ); - } - - return response; - }; - - - - * For API details, see [ListNotebookInstances](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/sagemaker/command/ListNotebookInstancesCommand) in _AWS SDK for JavaScript API Reference_. - - - - -Kotlin - - -**SDK for Kotlin** - - -###### Note - -There's more on GitHub. Find the complete example and learn how to set up and run in the [AWS Code Examples Repository](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/kotlin/services/sagemaker#code-examples). - - - suspend fun listBooks() { - SageMakerClient.fromEnvironment { region = "us-west-2" }.use { sageMakerClient -> - val response = sageMakerClient.listNotebookInstances(ListNotebookInstancesRequest {}) - response.notebookInstances?.forEach { item -> - println("The notebook name is: ${item.notebookInstanceName}") - } - } - } - - - - * For API details, see [ListNotebookInstances](https://sdk.amazonaws.com/kotlin/api/latest/index.html) in _AWS SDK for Kotlin API reference_. - - -