1// Code generated by smithy-go-codegen DO NOT EDIT.
2
3package sagemaker
4
5import (
6	"context"
7	awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
8	"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
9	"github.com/aws/aws-sdk-go-v2/service/sagemaker/types"
10	"github.com/aws/smithy-go/middleware"
11	smithyhttp "github.com/aws/smithy-go/transport/http"
12)
13
14// Creates a processing job.
15func (c *Client) CreateProcessingJob(ctx context.Context, params *CreateProcessingJobInput, optFns ...func(*Options)) (*CreateProcessingJobOutput, error) {
16	if params == nil {
17		params = &CreateProcessingJobInput{}
18	}
19
20	result, metadata, err := c.invokeOperation(ctx, "CreateProcessingJob", params, optFns, addOperationCreateProcessingJobMiddlewares)
21	if err != nil {
22		return nil, err
23	}
24
25	out := result.(*CreateProcessingJobOutput)
26	out.ResultMetadata = metadata
27	return out, nil
28}
29
30type CreateProcessingJobInput struct {
31
32	// Configures the processing job to run a specified Docker container image.
33	//
34	// This member is required.
35	AppSpecification *types.AppSpecification
36
37	// The name of the processing job. The name must be unique within an AWS Region in
38	// the AWS account.
39	//
40	// This member is required.
41	ProcessingJobName *string
42
43	// Identifies the resources, ML compute instances, and ML storage volumes to deploy
44	// for a processing job. In distributed training, you specify more than one
45	// instance.
46	//
47	// This member is required.
48	ProcessingResources *types.ProcessingResources
49
50	// The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker can assume
51	// to perform tasks on your behalf.
52	//
53	// This member is required.
54	RoleArn *string
55
56	// Sets the environment variables in the Docker container.
57	Environment map[string]string
58
59	// Associates a SageMaker job as a trial component with an experiment and trial.
60	// Specified when you call the following APIs:
61	//
62	// * CreateProcessingJob
63	//
64	// *
65	// CreateTrainingJob
66	//
67	// * CreateTransformJob
68	ExperimentConfig *types.ExperimentConfig
69
70	// Networking options for a processing job.
71	NetworkConfig *types.NetworkConfig
72
73	// List of input configurations for the processing job.
74	ProcessingInputs []types.ProcessingInput
75
76	// Output configuration for the processing job.
77	ProcessingOutputConfig *types.ProcessingOutputConfig
78
79	// The time limit for how long the processing job is allowed to run.
80	StoppingCondition *types.ProcessingStoppingCondition
81
82	// (Optional) An array of key-value pairs. For more information, see Using Cost
83	// Allocation Tags
84	// (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html#allocation-whatURL)
85	// in the AWS Billing and Cost Management User Guide.
86	Tags []types.Tag
87}
88
89type CreateProcessingJobOutput struct {
90
91	// The Amazon Resource Name (ARN) of the processing job.
92	//
93	// This member is required.
94	ProcessingJobArn *string
95
96	// Metadata pertaining to the operation's result.
97	ResultMetadata middleware.Metadata
98}
99
100func addOperationCreateProcessingJobMiddlewares(stack *middleware.Stack, options Options) (err error) {
101	err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateProcessingJob{}, middleware.After)
102	if err != nil {
103		return err
104	}
105	err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateProcessingJob{}, middleware.After)
106	if err != nil {
107		return err
108	}
109	if err = addSetLoggerMiddleware(stack, options); err != nil {
110		return err
111	}
112	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
113		return err
114	}
115	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
116		return err
117	}
118	if err = addResolveEndpointMiddleware(stack, options); err != nil {
119		return err
120	}
121	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
122		return err
123	}
124	if err = addRetryMiddlewares(stack, options); err != nil {
125		return err
126	}
127	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
128		return err
129	}
130	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
131		return err
132	}
133	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
134		return err
135	}
136	if err = addClientUserAgent(stack); err != nil {
137		return err
138	}
139	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
140		return err
141	}
142	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
143		return err
144	}
145	if err = addOpCreateProcessingJobValidationMiddleware(stack); err != nil {
146		return err
147	}
148	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateProcessingJob(options.Region), middleware.Before); err != nil {
149		return err
150	}
151	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
152		return err
153	}
154	if err = addResponseErrorMiddleware(stack); err != nil {
155		return err
156	}
157	if err = addRequestResponseLogging(stack, options); err != nil {
158		return err
159	}
160	return nil
161}
162
163func newServiceMetadataMiddleware_opCreateProcessingJob(region string) *awsmiddleware.RegisterServiceMetadata {
164	return &awsmiddleware.RegisterServiceMetadata{
165		Region:        region,
166		ServiceID:     ServiceID,
167		SigningName:   "sagemaker",
168		OperationName: "CreateProcessingJob",
169	}
170}
171