CreateScriptCommand

Transforms a directed acyclic graph (DAG) into code.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { GlueClient, CreateScriptCommand } from "@aws-sdk/client-glue"; // ES Modules import
// const { GlueClient, CreateScriptCommand } = require("@aws-sdk/client-glue"); // CommonJS import
const client = new GlueClient(config);
const input = { // CreateScriptRequest
  DagNodes: [ // DagNodes
    { // CodeGenNode
      Id: "STRING_VALUE", // required
      NodeType: "STRING_VALUE", // required
      Args: [ // CodeGenNodeArgs // required
        { // CodeGenNodeArg
          Name: "STRING_VALUE", // required
          Value: "STRING_VALUE", // required
          Param: true || false,
        },
      ],
      LineNumber: Number("int"),
    },
  ],
  DagEdges: [ // DagEdges
    { // CodeGenEdge
      Source: "STRING_VALUE", // required
      Target: "STRING_VALUE", // required
      TargetParameter: "STRING_VALUE",
    },
  ],
  Language: "PYTHON" || "SCALA",
};
const command = new CreateScriptCommand(input);
const response = await client.send(command);
// { // CreateScriptResponse
//   PythonScript: "STRING_VALUE",
//   ScalaCode: "STRING_VALUE",
// };

CreateScriptCommand Input

See CreateScriptCommandInput for more details

Parameter
Type
Description
DagEdges
CodeGenEdge[] | undefined

A list of the edges in the DAG.

DagNodes
CodeGenNode[] | undefined

A list of the nodes in the DAG.

Language
Language | undefined

The programming language of the resulting code from the DAG.

CreateScriptCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
PythonScript
string | undefined

The Python script generated from the DAG.

ScalaCode
string | undefined

The Scala code generated from the DAG.

Throws

Name
Fault
Details
InternalServiceException
server

An internal service error occurred.

InvalidInputException
client

The input provided was not valid.

OperationTimeoutException
client

The operation timed out.

GlueServiceException
Base exception class for all service exceptions from Glue service.