AWS neptune documentation change
Summary
Added comprehensive code examples for AWS CLI, SDK (Python), awscurl, and curl for Neptune ML data processing API operations (start, get status, cancel, list jobs), including incremental reprocessing and clean-up options.
Security assessment
The changes are purely documentation enhancements providing multiple client examples for existing API operations. There is no mention of security vulnerabilities, patches, or new security features. The examples include standard placeholders for endpoints and S3 paths, but no security-specific guidance beyond noting AWS credentials should be configured.
Diff
diff --git a/neptune/latest/userguide/machine-learning-api-dataprocessing.md b/neptune/latest/userguide/machine-learning-api-dataprocessing.md index c1d7b1c11..bdfa6cdb0 100644 --- a//neptune/latest/userguide/machine-learning-api-dataprocessing.md +++ b//neptune/latest/userguide/machine-learning-api-dataprocessing.md @@ -14,0 +15,55 @@ A typical Neptune ML `dataprocessing` command for creating a new job looks like +AWS CLI + + + + aws neptunedata start-ml-data-processing-job \ + --endpoint-url https://your-neptune-endpoint:port \ + --input-data-s3-location "s3://(S3 bucket name)/(path to your input folder)" \ + --id "(a job ID for the new job)" \ + --processed-data-s3-location "s3://(S3 bucket name)/(path to your output folder)" + +For more information, see [start-ml-data-processing-job](https://docs.aws.amazon.com/cli/latest/reference/neptunedata/start-ml-data-processing-job.html) in the AWS CLI Command Reference. + +SDK + + + + import boto3 + from botocore.config import Config + + client = boto3.client( + 'neptunedata', + endpoint_url='https://your-neptune-endpoint:port', + config=Config(read_timeout=None, retries={'total_max_attempts': 1}) + ) + + response = client.start_ml_data_processing_job( + inputDataS3Location='s3://(S3 bucket name)/(path to your input folder)', + id='(a job ID for the new job)', + processedDataS3Location='s3://(S3 bucket name)/(path to your output folder)' + ) + + print(response) + +awscurl + + + + awscurl https://your-neptune-endpoint:port/ml/dataprocessing \ + --region us-east-1 \ + --service neptune-db \ + -X POST \ + -H 'Content-Type: application/json' \ + -d '{ + "inputDataS3Location" : "s3://(S3 bucket name)/(path to your input folder)", + "id" : "(a job ID for the new job)", + "processedDataS3Location" : "s3://(S3 bucket name)/(path to your output folder)" + }' + +###### Note + +This example assumes that your AWS credentials are configured in your environment. Replace `us-east-1` with the Region of your Neptune cluster. + +curl + + @@ -17 +72 @@ A typical Neptune ML `dataprocessing` command for creating a new job looks like - -X POST https://(your Neptune endpoint)/ml/dataprocessing \ + -X POST https://your-neptune-endpoint:port/ml/dataprocessing \ @@ -20 +75 @@ A typical Neptune ML `dataprocessing` command for creating a new job looks like - "inputDataS3Location" : "s3://(Amazon S3 bucket name)/(path to your input folder)", + "inputDataS3Location" : "s3://(S3 bucket name)/(path to your input folder)", @@ -26,0 +82,58 @@ A command to initiate incremental re-processing looks like this: +AWS CLI + + + + aws neptunedata start-ml-data-processing-job \ + --endpoint-url https://your-neptune-endpoint:port \ + --input-data-s3-location "s3://(S3 bucket name)/(path to your input folder)" \ + --id "(a job ID for this job)" \ + --processed-data-s3-location "s3://(S3 bucket name)/(path to your output folder)" \ + --previous-data-processing-job-id "(the job ID of a previously completed job to update)" + +For more information, see [start-ml-data-processing-job](https://docs.aws.amazon.com/cli/latest/reference/neptunedata/start-ml-data-processing-job.html) in the AWS CLI Command Reference. + +SDK + + + + import boto3 + from botocore.config import Config + + client = boto3.client( + 'neptunedata', + endpoint_url='https://your-neptune-endpoint:port', + config=Config(read_timeout=None, retries={'total_max_attempts': 1}) + ) + + response = client.start_ml_data_processing_job( + inputDataS3Location='s3://(S3 bucket name)/(path to your input folder)', + id='(a job ID for this job)', + processedDataS3Location='s3://(S3 bucket name)/(path to your output folder)', + previousDataProcessingJobId='(the job ID of a previously completed job to update)' + ) + + print(response) + +awscurl + + + + awscurl https://your-neptune-endpoint:port/ml/dataprocessing \ + --region us-east-1 \ + --service neptune-db \ + -X POST \ + -H 'Content-Type: application/json' \ + -d '{ + "inputDataS3Location" : "s3://(S3 bucket name)/(path to your input folder)", + "id" : "(a job ID for this job)", + "processedDataS3Location" : "s3://(S3 bucket name)/(path to your output folder)", + "previousDataProcessingJobId" : "(the job ID of a previously completed job to update)" + }' + +###### Note + +This example assumes that your AWS credentials are configured in your environment. Replace `us-east-1` with the Region of your Neptune cluster. + +curl + + @@ -29 +142 @@ A command to initiate incremental re-processing looks like this: - -X POST https://(your Neptune endpoint)/ml/dataprocessing \ + -X POST https://your-neptune-endpoint:port/ml/dataprocessing \ @@ -32 +145 @@ A command to initiate incremental re-processing looks like this: - "inputDataS3Location" : "s3://(Amazon S3 bucket name)/(path to your input folder)", + "inputDataS3Location" : "s3://(S3 bucket name)/(path to your input folder)", @@ -34 +147 @@ A command to initiate incremental re-processing looks like this: - "processedDataS3Location" : "s3://(S3 bucket name)/(path to your output folder)" + "processedDataS3Location" : "s3://(S3 bucket name)/(path to your output folder)", @@ -122,0 +236,45 @@ A sample Neptune ML `dataprocessing` command for the status of a job looks like +AWS CLI + + + + aws neptunedata get-ml-data-processing-job \ + --endpoint-url https://your-neptune-endpoint:port \ + --id "(the job ID)" + +For more information, see [get-ml-data-processing-job](https://docs.aws.amazon.com/cli/latest/reference/neptunedata/get-ml-data-processing-job.html) in the AWS CLI Command Reference. + +SDK + + + + import boto3 + from botocore.config import Config + + client = boto3.client( + 'neptunedata', + endpoint_url='https://your-neptune-endpoint:port', + config=Config(read_timeout=None, retries={'total_max_attempts': 1}) + ) + + response = client.get_ml_data_processing_job( + id='(the job ID)' + ) + + print(response) + +awscurl + + + + awscurl https://your-neptune-endpoint:port/ml/dataprocessing/(the job ID) \ + --region us-east-1 \ + --service neptune-db \ + -X GET + +###### Note + +This example assumes that your AWS credentials are configured in your environment. Replace `us-east-1` with the Region of your Neptune cluster. + +curl + + @@ -125 +283 @@ A sample Neptune ML `dataprocessing` command for the status of a job looks like - "https://(your Neptune endpoint)/ml/dataprocessing/(the job ID)" \ + "https://your-neptune-endpoint:port/ml/dataprocessing/(the job ID)" \ @@ -144,0 +303,62 @@ A sample Neptune ML `dataprocessing` command for stopping a job looks like this: +AWS CLI + + + + aws neptunedata cancel-ml-data-processing-job \ + --endpoint-url https://your-neptune-endpoint:port \ + --id "(the job ID)" + +To also clean up Amazon S3 artifacts: + + + aws neptunedata cancel-ml-data-processing-job \ + --endpoint-url https://your-neptune-endpoint:port \ + --id "(the job ID)" \ + --clean +