Current section

Files

Jump to
aws lib aws generated emr_serverless.ex
Raw

lib/aws/generated/emr_serverless.ex

# WARNING: DO NOT EDIT, AUTO-GENERATED CODE!
# See https://github.com/aws-beam/aws-codegen for more details.
defmodule AWS.EMRServerless do
@moduledoc """
Amazon EMR Serverless is a new deployment option for Amazon EMR.
EMR Serverless provides a serverless runtime environment that simplifies running
analytics applications using the latest open source frameworks such as Apache
Spark and Apache Hive. With EMR Serverless, you don’t have to configure,
optimize, secure, or operate clusters to run applications with these frameworks.
The API reference to Amazon EMR Serverless is `emr-serverless`. The
`emr-serverless` prefix is used in the following scenarios:
* It is the prefix in the CLI commands for Amazon EMR Serverless.
For example, `aws emr-serverless start-job-run`.
* It is the prefix before IAM policy actions for Amazon EMR
Serverless. For example, `"Action": ["emr-serverless:StartJobRun"]`. For more information, see [Policy actions for Amazon EMR
Serverless](https://docs.aws.amazon.com/emr/latest/EMR-Serverless-UserGuide/security_iam_service-with-iam.html#security_iam_service-with-iam-id-based-policies-actions).
* It is the prefix used in Amazon EMR Serverless service endpoints.
For example, `emr-serverless.us-east-2.amazonaws.com`.
"""
alias AWS.Client
alias AWS.Request
def metadata do
%{
abbreviation: nil,
api_version: "2021-07-13",
content_type: "application/x-amz-json-1.1",
credential_scope: nil,
endpoint_prefix: "emr-serverless",
global?: false,
protocol: "rest-json",
service_id: "EMR Serverless",
signature_version: "v4",
signing_name: "emr-serverless",
target_prefix: nil
}
end
@doc """
Cancels a job run.
"""
def cancel_job_run(%Client{} = client, application_id, job_run_id, input, options \\ []) do
url_path =
"/applications/#{AWS.Util.encode_uri(application_id)}/jobruns/#{AWS.Util.encode_uri(job_run_id)}"
headers = []
query_params = []
meta = metadata()
Request.request_rest(
client,
meta,
:delete,
url_path,
query_params,
headers,
input,
options,
200
)
end
@doc """
Creates an application.
"""
def create_application(%Client{} = client, input, options \\ []) do
url_path = "/applications"
headers = []
query_params = []
meta = metadata()
Request.request_rest(
client,
meta,
:post,
url_path,
query_params,
headers,
input,
options,
200
)
end
@doc """
Deletes an application.
An application has to be in a stopped or created state in order to be deleted.
"""
def delete_application(%Client{} = client, application_id, input, options \\ []) do
url_path = "/applications/#{AWS.Util.encode_uri(application_id)}"
headers = []
query_params = []
meta = metadata()
Request.request_rest(
client,
meta,
:delete,
url_path,
query_params,
headers,
input,
options,
200
)
end
@doc """
Displays detailed information about a specified application.
"""
def get_application(%Client{} = client, application_id, options \\ []) do
url_path = "/applications/#{AWS.Util.encode_uri(application_id)}"
headers = []
query_params = []
meta = metadata()
Request.request_rest(client, meta, :get, url_path, query_params, headers, nil, options, 200)
end
@doc """
Displays detailed information about a job run.
"""
def get_job_run(%Client{} = client, application_id, job_run_id, options \\ []) do
url_path =
"/applications/#{AWS.Util.encode_uri(application_id)}/jobruns/#{AWS.Util.encode_uri(job_run_id)}"
headers = []
query_params = []
meta = metadata()
Request.request_rest(client, meta, :get, url_path, query_params, headers, nil, options, 200)
end
@doc """
Lists applications based on a set of parameters.
"""
def list_applications(
%Client{} = client,
max_results \\ nil,
next_token \\ nil,
states \\ nil,
options \\ []
) do
url_path = "/applications"
headers = []
query_params = []
query_params =
if !is_nil(states) do
[{"states", states} | query_params]
else
query_params
end
query_params =
if !is_nil(next_token) do
[{"nextToken", next_token} | query_params]
else
query_params
end
query_params =
if !is_nil(max_results) do
[{"maxResults", max_results} | query_params]
else
query_params
end
meta = metadata()
Request.request_rest(client, meta, :get, url_path, query_params, headers, nil, options, 200)
end
@doc """
Lists job runs based on a set of parameters.
"""
def list_job_runs(
%Client{} = client,
application_id,
created_at_after \\ nil,
created_at_before \\ nil,
max_results \\ nil,
next_token \\ nil,
states \\ nil,
options \\ []
) do
url_path = "/applications/#{AWS.Util.encode_uri(application_id)}/jobruns"
headers = []
query_params = []
query_params =
if !is_nil(states) do
[{"states", states} | query_params]
else
query_params
end
query_params =
if !is_nil(next_token) do
[{"nextToken", next_token} | query_params]
else
query_params
end
query_params =
if !is_nil(max_results) do
[{"maxResults", max_results} | query_params]
else
query_params
end
query_params =
if !is_nil(created_at_before) do
[{"createdAtBefore", created_at_before} | query_params]
else
query_params
end
query_params =
if !is_nil(created_at_after) do
[{"createdAtAfter", created_at_after} | query_params]
else
query_params
end
meta = metadata()
Request.request_rest(client, meta, :get, url_path, query_params, headers, nil, options, 200)
end
@doc """
Lists the tags assigned to the resources.
"""
def list_tags_for_resource(%Client{} = client, resource_arn, options \\ []) do
url_path = "/tags/#{AWS.Util.encode_uri(resource_arn)}"
headers = []
query_params = []
meta = metadata()
Request.request_rest(client, meta, :get, url_path, query_params, headers, nil, options, 200)
end
@doc """
Starts a specified application and initializes initial capacity if configured.
"""
def start_application(%Client{} = client, application_id, input, options \\ []) do
url_path = "/applications/#{AWS.Util.encode_uri(application_id)}/start"
headers = []
query_params = []
meta = metadata()
Request.request_rest(
client,
meta,
:post,
url_path,
query_params,
headers,
input,
options,
200
)
end
@doc """
Starts a job run.
"""
def start_job_run(%Client{} = client, application_id, input, options \\ []) do
url_path = "/applications/#{AWS.Util.encode_uri(application_id)}/jobruns"
headers = []
query_params = []
meta = metadata()
Request.request_rest(
client,
meta,
:post,
url_path,
query_params,
headers,
input,
options,
200
)
end
@doc """
Stops a specified application and releases initial capacity if configured.
All scheduled and running jobs must be completed or cancelled before stopping an
application.
"""
def stop_application(%Client{} = client, application_id, input, options \\ []) do
url_path = "/applications/#{AWS.Util.encode_uri(application_id)}/stop"
headers = []
query_params = []
meta = metadata()
Request.request_rest(
client,
meta,
:post,
url_path,
query_params,
headers,
input,
options,
200
)
end
@doc """
Assigns tags to resources.
A tag is a label that you assign to an AWS resource. Each tag consists of a key
and an optional value, both of which you define. Tags enable you to categorize
your AWS resources by attributes such as purpose, owner, or environment. When
you have many resources of the same type, you can quickly identify a specific
resource based on the tags you've assigned to it.
"""
def tag_resource(%Client{} = client, resource_arn, input, options \\ []) do
url_path = "/tags/#{AWS.Util.encode_uri(resource_arn)}"
headers = []
query_params = []
meta = metadata()
Request.request_rest(
client,
meta,
:post,
url_path,
query_params,
headers,
input,
options,
200
)
end
@doc """
Removes tags from resources.
"""
def untag_resource(%Client{} = client, resource_arn, input, options \\ []) do
url_path = "/tags/#{AWS.Util.encode_uri(resource_arn)}"
headers = []
{query_params, input} =
[
{"tagKeys", "tagKeys"}
]
|> Request.build_params(input)
meta = metadata()
Request.request_rest(
client,
meta,
:delete,
url_path,
query_params,
headers,
input,
options,
200
)
end
@doc """
Updates a specified application.
An application has to be in a stopped or created state in order to be updated.
"""
def update_application(%Client{} = client, application_id, input, options \\ []) do
url_path = "/applications/#{AWS.Util.encode_uri(application_id)}"
headers = []
query_params = []
meta = metadata()
Request.request_rest(
client,
meta,
:patch,
url_path,
query_params,
headers,
input,
options,
200
)
end
end