Current section

Files

Jump to
google_api_dataproc lib google_api dataproc v1 api projects.ex
Raw

lib/google_api/dataproc/v1/api/projects.ex

# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# NOTE: This class is auto generated by the swagger code generator program.
# https://github.com/swagger-api/swagger-codegen.git
# Do not edit the class manually.
defmodule GoogleApi.Dataproc.V1.Api.Projects do
@moduledoc """
API calls for all endpoints tagged `Projects`.
"""
alias GoogleApi.Dataproc.V1.Connection
import GoogleApi.Dataproc.V1.RequestBuilder
@doc """
Creates a cluster in a project.
## Parameters
- connection (GoogleApi.Dataproc.V1.Connection): Connection to server
- project_id (String): Required. The ID of the Google Cloud Platform project that the cluster belongs to.
- region (String): Required. The Cloud Dataproc region in which to handle the request.
- opts (KeywordList): [optional] Optional parameters
- :upload_protocol (String): Upload protocol for media (e.g. \"raw\", \"multipart\").
- :pretty_print (Boolean): Returns response with indentations and line breaks.
- :fields (String): Selector specifying which fields to include in a partial response.
- :upload_type (String): Legacy upload protocol for media (e.g. \"media\", \"multipart\").
- :__/xgafv (String): V1 error format.
- :callback (String): JSONP
- :alt (String): Data format for response.
- :key (String): API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
- :access_token (String): OAuth access token.
- :quota_user (String): Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
- :pp (Boolean): Pretty-print response.
- :oauth_token (String): OAuth 2.0 token for the current user.
- :bearer_token (String): OAuth bearer token.
- :body (Cluster):
## Returns
{:ok, %GoogleApi.Dataproc.V1.Model.Operation{}} on success
{:error, info} on failure
"""
@spec dataproc_projects_regions_clusters_create(Tesla.Env.client, String.t, String.t, keyword()) :: {:ok, GoogleApi.Dataproc.V1.Model.Operation.t} | {:error, Tesla.Env.t}
def dataproc_projects_regions_clusters_create(connection, project_id, region, opts \\ []) do
optional_params = %{
:"upload_protocol" => :query,
:"prettyPrint" => :query,
:"fields" => :query,
:"uploadType" => :query,
:"$.xgafv" => :query,
:"callback" => :query,
:"alt" => :query,
:"key" => :query,
:"access_token" => :query,
:"quotaUser" => :query,
:"pp" => :query,
:"oauth_token" => :query,
:"bearer_token" => :query,
:"body" => :body
}
%{}
|> method(:post)
|> url("/v1/projects/{projectId}/regions/{region}/clusters", %{
"projectId" => URI.encode_www_form(project_id),
"region" => URI.encode_www_form(region)
})
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> decode(%GoogleApi.Dataproc.V1.Model.Operation{})
end
@doc """
Deletes a cluster in a project.
## Parameters
- connection (GoogleApi.Dataproc.V1.Connection): Connection to server
- project_id (String): Required. The ID of the Google Cloud Platform project that the cluster belongs to.
- region (String): Required. The Cloud Dataproc region in which to handle the request.
- cluster_name (String): Required. The cluster name.
- opts (KeywordList): [optional] Optional parameters
- :upload_protocol (String): Upload protocol for media (e.g. \"raw\", \"multipart\").
- :pretty_print (Boolean): Returns response with indentations and line breaks.
- :fields (String): Selector specifying which fields to include in a partial response.
- :upload_type (String): Legacy upload protocol for media (e.g. \"media\", \"multipart\").
- :__/xgafv (String): V1 error format.
- :callback (String): JSONP
- :alt (String): Data format for response.
- :key (String): API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
- :access_token (String): OAuth access token.
- :quota_user (String): Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
- :pp (Boolean): Pretty-print response.
- :oauth_token (String): OAuth 2.0 token for the current user.
- :bearer_token (String): OAuth bearer token.
## Returns
{:ok, %GoogleApi.Dataproc.V1.Model.Operation{}} on success
{:error, info} on failure
"""
@spec dataproc_projects_regions_clusters_delete(Tesla.Env.client, String.t, String.t, String.t, keyword()) :: {:ok, GoogleApi.Dataproc.V1.Model.Operation.t} | {:error, Tesla.Env.t}
def dataproc_projects_regions_clusters_delete(connection, project_id, region, cluster_name, opts \\ []) do
optional_params = %{
:"upload_protocol" => :query,
:"prettyPrint" => :query,
:"fields" => :query,
:"uploadType" => :query,
:"$.xgafv" => :query,
:"callback" => :query,
:"alt" => :query,
:"key" => :query,
:"access_token" => :query,
:"quotaUser" => :query,
:"pp" => :query,
:"oauth_token" => :query,
:"bearer_token" => :query
}
%{}
|> method(:delete)
|> url("/v1/projects/{projectId}/regions/{region}/clusters/{clusterName}", %{
"projectId" => URI.encode_www_form(project_id),
"region" => URI.encode_www_form(region),
"clusterName" => URI.encode_www_form(cluster_name)
})
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> decode(%GoogleApi.Dataproc.V1.Model.Operation{})
end
@doc """
Gets cluster diagnostic information. After the operation completes, the Operation.response field contains DiagnoseClusterOutputLocation.
## Parameters
- connection (GoogleApi.Dataproc.V1.Connection): Connection to server
- project_id (String): Required. The ID of the Google Cloud Platform project that the cluster belongs to.
- region (String): Required. The Cloud Dataproc region in which to handle the request.
- cluster_name (String): Required. The cluster name.
- opts (KeywordList): [optional] Optional parameters
- :upload_protocol (String): Upload protocol for media (e.g. \"raw\", \"multipart\").
- :pretty_print (Boolean): Returns response with indentations and line breaks.
- :fields (String): Selector specifying which fields to include in a partial response.
- :upload_type (String): Legacy upload protocol for media (e.g. \"media\", \"multipart\").
- :__/xgafv (String): V1 error format.
- :callback (String): JSONP
- :alt (String): Data format for response.
- :key (String): API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
- :access_token (String): OAuth access token.
- :quota_user (String): Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
- :pp (Boolean): Pretty-print response.
- :oauth_token (String): OAuth 2.0 token for the current user.
- :bearer_token (String): OAuth bearer token.
- :body (DiagnoseClusterRequest):
## Returns
{:ok, %GoogleApi.Dataproc.V1.Model.Operation{}} on success
{:error, info} on failure
"""
@spec dataproc_projects_regions_clusters_diagnose(Tesla.Env.client, String.t, String.t, String.t, keyword()) :: {:ok, GoogleApi.Dataproc.V1.Model.Operation.t} | {:error, Tesla.Env.t}
def dataproc_projects_regions_clusters_diagnose(connection, project_id, region, cluster_name, opts \\ []) do
optional_params = %{
:"upload_protocol" => :query,
:"prettyPrint" => :query,
:"fields" => :query,
:"uploadType" => :query,
:"$.xgafv" => :query,
:"callback" => :query,
:"alt" => :query,
:"key" => :query,
:"access_token" => :query,
:"quotaUser" => :query,
:"pp" => :query,
:"oauth_token" => :query,
:"bearer_token" => :query,
:"body" => :body
}
%{}
|> method(:post)
|> url("/v1/projects/{projectId}/regions/{region}/clusters/{clusterName}:diagnose", %{
"projectId" => URI.encode_www_form(project_id),
"region" => URI.encode_www_form(region),
"clusterName" => URI.encode_www_form(cluster_name)
})
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> decode(%GoogleApi.Dataproc.V1.Model.Operation{})
end
@doc """
Gets the resource representation for a cluster in a project.
## Parameters
- connection (GoogleApi.Dataproc.V1.Connection): Connection to server
- project_id (String): Required. The ID of the Google Cloud Platform project that the cluster belongs to.
- region (String): Required. The Cloud Dataproc region in which to handle the request.
- cluster_name (String): Required. The cluster name.
- opts (KeywordList): [optional] Optional parameters
- :upload_protocol (String): Upload protocol for media (e.g. \"raw\", \"multipart\").
- :pretty_print (Boolean): Returns response with indentations and line breaks.
- :fields (String): Selector specifying which fields to include in a partial response.
- :upload_type (String): Legacy upload protocol for media (e.g. \"media\", \"multipart\").
- :__/xgafv (String): V1 error format.
- :callback (String): JSONP
- :alt (String): Data format for response.
- :key (String): API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
- :access_token (String): OAuth access token.
- :quota_user (String): Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
- :pp (Boolean): Pretty-print response.
- :oauth_token (String): OAuth 2.0 token for the current user.
- :bearer_token (String): OAuth bearer token.
## Returns
{:ok, %GoogleApi.Dataproc.V1.Model.Cluster{}} on success
{:error, info} on failure
"""
@spec dataproc_projects_regions_clusters_get(Tesla.Env.client, String.t, String.t, String.t, keyword()) :: {:ok, GoogleApi.Dataproc.V1.Model.Cluster.t} | {:error, Tesla.Env.t}
def dataproc_projects_regions_clusters_get(connection, project_id, region, cluster_name, opts \\ []) do
optional_params = %{
:"upload_protocol" => :query,
:"prettyPrint" => :query,
:"fields" => :query,
:"uploadType" => :query,
:"$.xgafv" => :query,
:"callback" => :query,
:"alt" => :query,
:"key" => :query,
:"access_token" => :query,
:"quotaUser" => :query,
:"pp" => :query,
:"oauth_token" => :query,
:"bearer_token" => :query
}
%{}
|> method(:get)
|> url("/v1/projects/{projectId}/regions/{region}/clusters/{clusterName}", %{
"projectId" => URI.encode_www_form(project_id),
"region" => URI.encode_www_form(region),
"clusterName" => URI.encode_www_form(cluster_name)
})
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> decode(%GoogleApi.Dataproc.V1.Model.Cluster{})
end
@doc """
Lists all regions/{region}/clusters in a project.
## Parameters
- connection (GoogleApi.Dataproc.V1.Connection): Connection to server
- project_id (String): Required. The ID of the Google Cloud Platform project that the cluster belongs to.
- region (String): Required. The Cloud Dataproc region in which to handle the request.
- opts (KeywordList): [optional] Optional parameters
- :upload_protocol (String): Upload protocol for media (e.g. \"raw\", \"multipart\").
- :pretty_print (Boolean): Returns response with indentations and line breaks.
- :fields (String): Selector specifying which fields to include in a partial response.
- :upload_type (String): Legacy upload protocol for media (e.g. \"media\", \"multipart\").
- :__/xgafv (String): V1 error format.
- :callback (String): JSONP
- :alt (String): Data format for response.
- :key (String): API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
- :access_token (String): OAuth access token.
- :quota_user (String): Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
- :pp (Boolean): Pretty-print response.
- :oauth_token (String): OAuth 2.0 token for the current user.
- :bearer_token (String): OAuth bearer token.
- :page_size (Integer): Optional. The standard List page size.
- :filter (String): Optional. A filter constraining the clusters to list. Filters are case-sensitive and have the following syntax:field = value AND field = value ...where field is one of status.state, clusterName, or labels.[KEY], and [KEY] is a label key. value can be * to match all values. status.state can be one of the following: ACTIVE, INACTIVE, CREATING, RUNNING, ERROR, DELETING, or UPDATING. ACTIVE contains the CREATING, UPDATING, and RUNNING states. INACTIVE contains the DELETING and ERROR states. clusterName is the name of the cluster provided at creation time. Only the logical AND operator is supported; space-separated items are treated as having an implicit AND operator.Example filter:status.state = ACTIVE AND clusterName = mycluster AND labels.env = staging AND labels.starred = *
- :page_token (String): Optional. The standard List page token.
## Returns
{:ok, %GoogleApi.Dataproc.V1.Model.ListClustersResponse{}} on success
{:error, info} on failure
"""
@spec dataproc_projects_regions_clusters_list(Tesla.Env.client, String.t, String.t, keyword()) :: {:ok, GoogleApi.Dataproc.V1.Model.ListClustersResponse.t} | {:error, Tesla.Env.t}
def dataproc_projects_regions_clusters_list(connection, project_id, region, opts \\ []) do
optional_params = %{
:"upload_protocol" => :query,
:"prettyPrint" => :query,
:"fields" => :query,
:"uploadType" => :query,
:"$.xgafv" => :query,
:"callback" => :query,
:"alt" => :query,
:"key" => :query,
:"access_token" => :query,
:"quotaUser" => :query,
:"pp" => :query,
:"oauth_token" => :query,
:"bearer_token" => :query,
:"pageSize" => :query,
:"filter" => :query,
:"pageToken" => :query
}
%{}
|> method(:get)
|> url("/v1/projects/{projectId}/regions/{region}/clusters", %{
"projectId" => URI.encode_www_form(project_id),
"region" => URI.encode_www_form(region)
})
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> decode(%GoogleApi.Dataproc.V1.Model.ListClustersResponse{})
end
@doc """
Updates a cluster in a project.
## Parameters
- connection (GoogleApi.Dataproc.V1.Connection): Connection to server
- project_id (String): Required. The ID of the Google Cloud Platform project the cluster belongs to.
- region (String): Required. The Cloud Dataproc region in which to handle the request.
- cluster_name (String): Required. The cluster name.
- opts (KeywordList): [optional] Optional parameters
- :upload_protocol (String): Upload protocol for media (e.g. \"raw\", \"multipart\").
- :pretty_print (Boolean): Returns response with indentations and line breaks.
- :fields (String): Selector specifying which fields to include in a partial response.
- :upload_type (String): Legacy upload protocol for media (e.g. \"media\", \"multipart\").
- :__/xgafv (String): V1 error format.
- :callback (String): JSONP
- :alt (String): Data format for response.
- :key (String): API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
- :access_token (String): OAuth access token.
- :quota_user (String): Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
- :pp (Boolean): Pretty-print response.
- :oauth_token (String): OAuth 2.0 token for the current user.
- :bearer_token (String): OAuth bearer token.
- :update_mask (String): Required. Specifies the path, relative to Cluster, of the field to update. For example, to change the number of workers in a cluster to 5, the update_mask parameter would be specified as config.worker_config.num_instances, and the PATCH request body would specify the new value, as follows: { \"config\":{ \"workerConfig\":{ \"numInstances\":\"5\" } } } Similarly, to change the number of preemptible workers in a cluster to 5, the update_mask parameter would be config.secondary_worker_config.num_instances, and the PATCH request body would be set as follows: { \"config\":{ \"secondaryWorkerConfig\":{ \"numInstances\":\"5\" } } } <strong>Note:</strong> Currently, only the following fields can be updated:<table> <tbody> <tr> <td><strong>Mask</strong></td> <td><strong>Purpose</strong></td> </tr> <tr> <td><strong><em>labels</em></strong></td> <td>Update labels</td> </tr> <tr> <td><strong><em>config.worker_config.num_instances</em></strong></td> <td>Resize primary worker group</td> </tr> <tr> <td><strong><em>config.secondary_worker_config.num_instances</em></strong></td> <td>Resize secondary worker group</td> </tr> </tbody> </table>
- :body (Cluster):
## Returns
{:ok, %GoogleApi.Dataproc.V1.Model.Operation{}} on success
{:error, info} on failure
"""
@spec dataproc_projects_regions_clusters_patch(Tesla.Env.client, String.t, String.t, String.t, keyword()) :: {:ok, GoogleApi.Dataproc.V1.Model.Operation.t} | {:error, Tesla.Env.t}
def dataproc_projects_regions_clusters_patch(connection, project_id, region, cluster_name, opts \\ []) do
optional_params = %{
:"upload_protocol" => :query,
:"prettyPrint" => :query,
:"fields" => :query,
:"uploadType" => :query,
:"$.xgafv" => :query,
:"callback" => :query,
:"alt" => :query,
:"key" => :query,
:"access_token" => :query,
:"quotaUser" => :query,
:"pp" => :query,
:"oauth_token" => :query,
:"bearer_token" => :query,
:"updateMask" => :query,
:"body" => :body
}
%{}
|> method(:patch)
|> url("/v1/projects/{projectId}/regions/{region}/clusters/{clusterName}", %{
"projectId" => URI.encode_www_form(project_id),
"region" => URI.encode_www_form(region),
"clusterName" => URI.encode_www_form(cluster_name)
})
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> decode(%GoogleApi.Dataproc.V1.Model.Operation{})
end
@doc """
Starts a job cancellation request. To access the job resource after cancellation, call regions/{region}/jobs.list or regions/{region}/jobs.get.
## Parameters
- connection (GoogleApi.Dataproc.V1.Connection): Connection to server
- project_id (String): Required. The ID of the Google Cloud Platform project that the job belongs to.
- region (String): Required. The Cloud Dataproc region in which to handle the request.
- job_id (String): Required. The job ID.
- opts (KeywordList): [optional] Optional parameters
- :upload_protocol (String): Upload protocol for media (e.g. \"raw\", \"multipart\").
- :pretty_print (Boolean): Returns response with indentations and line breaks.
- :fields (String): Selector specifying which fields to include in a partial response.
- :upload_type (String): Legacy upload protocol for media (e.g. \"media\", \"multipart\").
- :__/xgafv (String): V1 error format.
- :callback (String): JSONP
- :alt (String): Data format for response.
- :key (String): API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
- :access_token (String): OAuth access token.
- :quota_user (String): Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
- :pp (Boolean): Pretty-print response.
- :oauth_token (String): OAuth 2.0 token for the current user.
- :bearer_token (String): OAuth bearer token.
- :body (CancelJobRequest):
## Returns
{:ok, %GoogleApi.Dataproc.V1.Model.Job{}} on success
{:error, info} on failure
"""
@spec dataproc_projects_regions_jobs_cancel(Tesla.Env.client, String.t, String.t, String.t, keyword()) :: {:ok, GoogleApi.Dataproc.V1.Model.Job.t} | {:error, Tesla.Env.t}
def dataproc_projects_regions_jobs_cancel(connection, project_id, region, job_id, opts \\ []) do
optional_params = %{
:"upload_protocol" => :query,
:"prettyPrint" => :query,
:"fields" => :query,
:"uploadType" => :query,
:"$.xgafv" => :query,
:"callback" => :query,
:"alt" => :query,
:"key" => :query,
:"access_token" => :query,
:"quotaUser" => :query,
:"pp" => :query,
:"oauth_token" => :query,
:"bearer_token" => :query,
:"body" => :body
}
%{}
|> method(:post)
|> url("/v1/projects/{projectId}/regions/{region}/jobs/{jobId}:cancel", %{
"projectId" => URI.encode_www_form(project_id),
"region" => URI.encode_www_form(region),
"jobId" => URI.encode_www_form(job_id)
})
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> decode(%GoogleApi.Dataproc.V1.Model.Job{})
end
@doc """
Deletes the job from the project. If the job is active, the delete fails, and the response returns FAILED_PRECONDITION.
## Parameters
- connection (GoogleApi.Dataproc.V1.Connection): Connection to server
- project_id (String): Required. The ID of the Google Cloud Platform project that the job belongs to.
- region (String): Required. The Cloud Dataproc region in which to handle the request.
- job_id (String): Required. The job ID.
- opts (KeywordList): [optional] Optional parameters
- :upload_protocol (String): Upload protocol for media (e.g. \"raw\", \"multipart\").
- :pretty_print (Boolean): Returns response with indentations and line breaks.
- :fields (String): Selector specifying which fields to include in a partial response.
- :upload_type (String): Legacy upload protocol for media (e.g. \"media\", \"multipart\").
- :__/xgafv (String): V1 error format.
- :callback (String): JSONP
- :alt (String): Data format for response.
- :key (String): API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
- :access_token (String): OAuth access token.
- :quota_user (String): Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
- :pp (Boolean): Pretty-print response.
- :oauth_token (String): OAuth 2.0 token for the current user.
- :bearer_token (String): OAuth bearer token.
## Returns
{:ok, %GoogleApi.Dataproc.V1.Model.Empty{}} on success
{:error, info} on failure
"""
@spec dataproc_projects_regions_jobs_delete(Tesla.Env.client, String.t, String.t, String.t, keyword()) :: {:ok, GoogleApi.Dataproc.V1.Model.Empty.t} | {:error, Tesla.Env.t}
def dataproc_projects_regions_jobs_delete(connection, project_id, region, job_id, opts \\ []) do
optional_params = %{
:"upload_protocol" => :query,
:"prettyPrint" => :query,
:"fields" => :query,
:"uploadType" => :query,
:"$.xgafv" => :query,
:"callback" => :query,
:"alt" => :query,
:"key" => :query,
:"access_token" => :query,
:"quotaUser" => :query,
:"pp" => :query,
:"oauth_token" => :query,
:"bearer_token" => :query
}
%{}
|> method(:delete)
|> url("/v1/projects/{projectId}/regions/{region}/jobs/{jobId}", %{
"projectId" => URI.encode_www_form(project_id),
"region" => URI.encode_www_form(region),
"jobId" => URI.encode_www_form(job_id)
})
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> decode(%GoogleApi.Dataproc.V1.Model.Empty{})
end
@doc """
Gets the resource representation for a job in a project.
## Parameters
- connection (GoogleApi.Dataproc.V1.Connection): Connection to server
- project_id (String): Required. The ID of the Google Cloud Platform project that the job belongs to.
- region (String): Required. The Cloud Dataproc region in which to handle the request.
- job_id (String): Required. The job ID.
- opts (KeywordList): [optional] Optional parameters
- :upload_protocol (String): Upload protocol for media (e.g. \"raw\", \"multipart\").
- :pretty_print (Boolean): Returns response with indentations and line breaks.
- :fields (String): Selector specifying which fields to include in a partial response.
- :upload_type (String): Legacy upload protocol for media (e.g. \"media\", \"multipart\").
- :__/xgafv (String): V1 error format.
- :callback (String): JSONP
- :alt (String): Data format for response.
- :key (String): API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
- :access_token (String): OAuth access token.
- :quota_user (String): Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
- :pp (Boolean): Pretty-print response.
- :oauth_token (String): OAuth 2.0 token for the current user.
- :bearer_token (String): OAuth bearer token.
## Returns
{:ok, %GoogleApi.Dataproc.V1.Model.Job{}} on success
{:error, info} on failure
"""
@spec dataproc_projects_regions_jobs_get(Tesla.Env.client, String.t, String.t, String.t, keyword()) :: {:ok, GoogleApi.Dataproc.V1.Model.Job.t} | {:error, Tesla.Env.t}
def dataproc_projects_regions_jobs_get(connection, project_id, region, job_id, opts \\ []) do
optional_params = %{
:"upload_protocol" => :query,
:"prettyPrint" => :query,
:"fields" => :query,
:"uploadType" => :query,
:"$.xgafv" => :query,
:"callback" => :query,
:"alt" => :query,
:"key" => :query,
:"access_token" => :query,
:"quotaUser" => :query,
:"pp" => :query,
:"oauth_token" => :query,
:"bearer_token" => :query
}
%{}
|> method(:get)
|> url("/v1/projects/{projectId}/regions/{region}/jobs/{jobId}", %{
"projectId" => URI.encode_www_form(project_id),
"region" => URI.encode_www_form(region),
"jobId" => URI.encode_www_form(job_id)
})
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> decode(%GoogleApi.Dataproc.V1.Model.Job{})
end
@doc """
Lists regions/{region}/jobs in a project.
## Parameters
- connection (GoogleApi.Dataproc.V1.Connection): Connection to server
- project_id (String): Required. The ID of the Google Cloud Platform project that the job belongs to.
- region (String): Required. The Cloud Dataproc region in which to handle the request.
- opts (KeywordList): [optional] Optional parameters
- :upload_protocol (String): Upload protocol for media (e.g. \"raw\", \"multipart\").
- :pretty_print (Boolean): Returns response with indentations and line breaks.
- :fields (String): Selector specifying which fields to include in a partial response.
- :upload_type (String): Legacy upload protocol for media (e.g. \"media\", \"multipart\").
- :__/xgafv (String): V1 error format.
- :callback (String): JSONP
- :alt (String): Data format for response.
- :key (String): API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
- :access_token (String): OAuth access token.
- :quota_user (String): Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
- :pp (Boolean): Pretty-print response.
- :oauth_token (String): OAuth 2.0 token for the current user.
- :bearer_token (String): OAuth bearer token.
- :cluster_name (String): Optional. If set, the returned jobs list includes only jobs that were submitted to the named cluster.
- :filter (String): Optional. A filter constraining the jobs to list. Filters are case-sensitive and have the following syntax:field = value AND field = value ...where field is status.state or labels.[KEY], and [KEY] is a label key. value can be * to match all values. status.state can be either ACTIVE or INACTIVE. Only the logical AND operator is supported; space-separated items are treated as having an implicit AND operator.Example filter:status.state = ACTIVE AND labels.env = staging AND labels.starred = *
- :job_state_matcher (String): Optional. Specifies enumerated categories of jobs to list (default = match ALL jobs).
- :page_token (String): Optional. The page token, returned by a previous call, to request the next page of results.
- :page_size (Integer): Optional. The number of results to return in each response.
## Returns
{:ok, %GoogleApi.Dataproc.V1.Model.ListJobsResponse{}} on success
{:error, info} on failure
"""
@spec dataproc_projects_regions_jobs_list(Tesla.Env.client, String.t, String.t, keyword()) :: {:ok, GoogleApi.Dataproc.V1.Model.ListJobsResponse.t} | {:error, Tesla.Env.t}
def dataproc_projects_regions_jobs_list(connection, project_id, region, opts \\ []) do
optional_params = %{
:"upload_protocol" => :query,
:"prettyPrint" => :query,
:"fields" => :query,
:"uploadType" => :query,
:"$.xgafv" => :query,
:"callback" => :query,
:"alt" => :query,
:"key" => :query,
:"access_token" => :query,
:"quotaUser" => :query,
:"pp" => :query,
:"oauth_token" => :query,
:"bearer_token" => :query,
:"clusterName" => :query,
:"filter" => :query,
:"jobStateMatcher" => :query,
:"pageToken" => :query,
:"pageSize" => :query
}
%{}
|> method(:get)
|> url("/v1/projects/{projectId}/regions/{region}/jobs", %{
"projectId" => URI.encode_www_form(project_id),
"region" => URI.encode_www_form(region)
})
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> decode(%GoogleApi.Dataproc.V1.Model.ListJobsResponse{})
end
@doc """
Updates a job in a project.
## Parameters
- connection (GoogleApi.Dataproc.V1.Connection): Connection to server
- project_id (String): Required. The ID of the Google Cloud Platform project that the job belongs to.
- region (String): Required. The Cloud Dataproc region in which to handle the request.
- job_id (String): Required. The job ID.
- opts (KeywordList): [optional] Optional parameters
- :upload_protocol (String): Upload protocol for media (e.g. \"raw\", \"multipart\").
- :pretty_print (Boolean): Returns response with indentations and line breaks.
- :fields (String): Selector specifying which fields to include in a partial response.
- :upload_type (String): Legacy upload protocol for media (e.g. \"media\", \"multipart\").
- :__/xgafv (String): V1 error format.
- :callback (String): JSONP
- :alt (String): Data format for response.
- :key (String): API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
- :access_token (String): OAuth access token.
- :quota_user (String): Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
- :pp (Boolean): Pretty-print response.
- :oauth_token (String): OAuth 2.0 token for the current user.
- :bearer_token (String): OAuth bearer token.
- :update_mask (String): Required. Specifies the path, relative to <code>Job</code>, of the field to update. For example, to update the labels of a Job the <code>update_mask</code> parameter would be specified as <code>labels</code>, and the PATCH request body would specify the new value. <strong>Note:</strong> Currently, <code>labels</code> is the only field that can be updated.
- :body (Job):
## Returns
{:ok, %GoogleApi.Dataproc.V1.Model.Job{}} on success
{:error, info} on failure
"""
@spec dataproc_projects_regions_jobs_patch(Tesla.Env.client, String.t, String.t, String.t, keyword()) :: {:ok, GoogleApi.Dataproc.V1.Model.Job.t} | {:error, Tesla.Env.t}
def dataproc_projects_regions_jobs_patch(connection, project_id, region, job_id, opts \\ []) do
optional_params = %{
:"upload_protocol" => :query,
:"prettyPrint" => :query,
:"fields" => :query,
:"uploadType" => :query,
:"$.xgafv" => :query,
:"callback" => :query,
:"alt" => :query,
:"key" => :query,
:"access_token" => :query,
:"quotaUser" => :query,
:"pp" => :query,
:"oauth_token" => :query,
:"bearer_token" => :query,
:"updateMask" => :query,
:"body" => :body
}
%{}
|> method(:patch)
|> url("/v1/projects/{projectId}/regions/{region}/jobs/{jobId}", %{
"projectId" => URI.encode_www_form(project_id),
"region" => URI.encode_www_form(region),
"jobId" => URI.encode_www_form(job_id)
})
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> decode(%GoogleApi.Dataproc.V1.Model.Job{})
end
@doc """
Submits a job to a cluster.
## Parameters
- connection (GoogleApi.Dataproc.V1.Connection): Connection to server
- project_id (String): Required. The ID of the Google Cloud Platform project that the job belongs to.
- region (String): Required. The Cloud Dataproc region in which to handle the request.
- opts (KeywordList): [optional] Optional parameters
- :upload_protocol (String): Upload protocol for media (e.g. \"raw\", \"multipart\").
- :pretty_print (Boolean): Returns response with indentations and line breaks.
- :fields (String): Selector specifying which fields to include in a partial response.
- :upload_type (String): Legacy upload protocol for media (e.g. \"media\", \"multipart\").
- :__/xgafv (String): V1 error format.
- :callback (String): JSONP
- :alt (String): Data format for response.
- :key (String): API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
- :access_token (String): OAuth access token.
- :quota_user (String): Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
- :pp (Boolean): Pretty-print response.
- :oauth_token (String): OAuth 2.0 token for the current user.
- :bearer_token (String): OAuth bearer token.
- :body (SubmitJobRequest):
## Returns
{:ok, %GoogleApi.Dataproc.V1.Model.Job{}} on success
{:error, info} on failure
"""
@spec dataproc_projects_regions_jobs_submit(Tesla.Env.client, String.t, String.t, keyword()) :: {:ok, GoogleApi.Dataproc.V1.Model.Job.t} | {:error, Tesla.Env.t}
def dataproc_projects_regions_jobs_submit(connection, project_id, region, opts \\ []) do
optional_params = %{
:"upload_protocol" => :query,
:"prettyPrint" => :query,
:"fields" => :query,
:"uploadType" => :query,
:"$.xgafv" => :query,
:"callback" => :query,
:"alt" => :query,
:"key" => :query,
:"access_token" => :query,
:"quotaUser" => :query,
:"pp" => :query,
:"oauth_token" => :query,
:"bearer_token" => :query,
:"body" => :body
}
%{}
|> method(:post)
|> url("/v1/projects/{projectId}/regions/{region}/jobs:submit", %{
"projectId" => URI.encode_www_form(project_id),
"region" => URI.encode_www_form(region)
})
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> decode(%GoogleApi.Dataproc.V1.Model.Job{})
end
@doc """
Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED.
## Parameters
- connection (GoogleApi.Dataproc.V1.Connection): Connection to server
- projects_id (String): Part of `name`. The name of the operation resource to be cancelled.
- regions_id (String): Part of `name`. See documentation of `projectsId`.
- operations_id (String): Part of `name`. See documentation of `projectsId`.
- opts (KeywordList): [optional] Optional parameters
- :upload_protocol (String): Upload protocol for media (e.g. \"raw\", \"multipart\").
- :pretty_print (Boolean): Returns response with indentations and line breaks.
- :fields (String): Selector specifying which fields to include in a partial response.
- :upload_type (String): Legacy upload protocol for media (e.g. \"media\", \"multipart\").
- :__/xgafv (String): V1 error format.
- :callback (String): JSONP
- :alt (String): Data format for response.
- :key (String): API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
- :access_token (String): OAuth access token.
- :quota_user (String): Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
- :pp (Boolean): Pretty-print response.
- :oauth_token (String): OAuth 2.0 token for the current user.
- :bearer_token (String): OAuth bearer token.
## Returns
{:ok, %GoogleApi.Dataproc.V1.Model.Empty{}} on success
{:error, info} on failure
"""
@spec dataproc_projects_regions_operations_cancel(Tesla.Env.client, String.t, String.t, String.t, keyword()) :: {:ok, GoogleApi.Dataproc.V1.Model.Empty.t} | {:error, Tesla.Env.t}
def dataproc_projects_regions_operations_cancel(connection, projects_id, regions_id, operations_id, opts \\ []) do
optional_params = %{
:"upload_protocol" => :query,
:"prettyPrint" => :query,
:"fields" => :query,
:"uploadType" => :query,
:"$.xgafv" => :query,
:"callback" => :query,
:"alt" => :query,
:"key" => :query,
:"access_token" => :query,
:"quotaUser" => :query,
:"pp" => :query,
:"oauth_token" => :query,
:"bearer_token" => :query
}
%{}
|> method(:post)
|> url("/v1/projects/{projectsId}/regions/{regionsId}/operations/{operationsId}:cancel", %{
"projectsId" => URI.encode_www_form(projects_id),
"regionsId" => URI.encode_www_form(regions_id),
"operationsId" => URI.encode_www_form(operations_id)
})
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> decode(%GoogleApi.Dataproc.V1.Model.Empty{})
end
@doc """
Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED.
## Parameters
- connection (GoogleApi.Dataproc.V1.Connection): Connection to server
- projects_id (String): Part of `name`. The name of the operation resource to be deleted.
- regions_id (String): Part of `name`. See documentation of `projectsId`.
- operations_id (String): Part of `name`. See documentation of `projectsId`.
- opts (KeywordList): [optional] Optional parameters
- :upload_protocol (String): Upload protocol for media (e.g. \"raw\", \"multipart\").
- :pretty_print (Boolean): Returns response with indentations and line breaks.
- :fields (String): Selector specifying which fields to include in a partial response.
- :upload_type (String): Legacy upload protocol for media (e.g. \"media\", \"multipart\").
- :__/xgafv (String): V1 error format.
- :callback (String): JSONP
- :alt (String): Data format for response.
- :key (String): API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
- :access_token (String): OAuth access token.
- :quota_user (String): Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
- :pp (Boolean): Pretty-print response.
- :oauth_token (String): OAuth 2.0 token for the current user.
- :bearer_token (String): OAuth bearer token.
## Returns
{:ok, %GoogleApi.Dataproc.V1.Model.Empty{}} on success
{:error, info} on failure
"""
@spec dataproc_projects_regions_operations_delete(Tesla.Env.client, String.t, String.t, String.t, keyword()) :: {:ok, GoogleApi.Dataproc.V1.Model.Empty.t} | {:error, Tesla.Env.t}
def dataproc_projects_regions_operations_delete(connection, projects_id, regions_id, operations_id, opts \\ []) do
optional_params = %{
:"upload_protocol" => :query,
:"prettyPrint" => :query,
:"fields" => :query,
:"uploadType" => :query,
:"$.xgafv" => :query,
:"callback" => :query,
:"alt" => :query,
:"key" => :query,
:"access_token" => :query,
:"quotaUser" => :query,
:"pp" => :query,
:"oauth_token" => :query,
:"bearer_token" => :query
}
%{}
|> method(:delete)
|> url("/v1/projects/{projectsId}/regions/{regionsId}/operations/{operationsId}", %{
"projectsId" => URI.encode_www_form(projects_id),
"regionsId" => URI.encode_www_form(regions_id),
"operationsId" => URI.encode_www_form(operations_id)
})
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> decode(%GoogleApi.Dataproc.V1.Model.Empty{})
end
@doc """
Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
## Parameters
- connection (GoogleApi.Dataproc.V1.Connection): Connection to server
- projects_id (String): Part of `name`. The name of the operation resource.
- regions_id (String): Part of `name`. See documentation of `projectsId`.
- operations_id (String): Part of `name`. See documentation of `projectsId`.
- opts (KeywordList): [optional] Optional parameters
- :upload_protocol (String): Upload protocol for media (e.g. \"raw\", \"multipart\").
- :pretty_print (Boolean): Returns response with indentations and line breaks.
- :fields (String): Selector specifying which fields to include in a partial response.
- :upload_type (String): Legacy upload protocol for media (e.g. \"media\", \"multipart\").
- :__/xgafv (String): V1 error format.
- :callback (String): JSONP
- :alt (String): Data format for response.
- :key (String): API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
- :access_token (String): OAuth access token.
- :quota_user (String): Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
- :pp (Boolean): Pretty-print response.
- :oauth_token (String): OAuth 2.0 token for the current user.
- :bearer_token (String): OAuth bearer token.
## Returns
{:ok, %GoogleApi.Dataproc.V1.Model.Operation{}} on success
{:error, info} on failure
"""
@spec dataproc_projects_regions_operations_get(Tesla.Env.client, String.t, String.t, String.t, keyword()) :: {:ok, GoogleApi.Dataproc.V1.Model.Operation.t} | {:error, Tesla.Env.t}
def dataproc_projects_regions_operations_get(connection, projects_id, regions_id, operations_id, opts \\ []) do
optional_params = %{
:"upload_protocol" => :query,
:"prettyPrint" => :query,
:"fields" => :query,
:"uploadType" => :query,
:"$.xgafv" => :query,
:"callback" => :query,
:"alt" => :query,
:"key" => :query,
:"access_token" => :query,
:"quotaUser" => :query,
:"pp" => :query,
:"oauth_token" => :query,
:"bearer_token" => :query
}
%{}
|> method(:get)
|> url("/v1/projects/{projectsId}/regions/{regionsId}/operations/{operationsId}", %{
"projectsId" => URI.encode_www_form(projects_id),
"regionsId" => URI.encode_www_form(regions_id),
"operationsId" => URI.encode_www_form(operations_id)
})
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> decode(%GoogleApi.Dataproc.V1.Model.Operation{})
end
@doc """
Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding allows API services to override the binding to use different resource name schemes, such as users/*/operations. To override the binding, API services can add a binding such as \"/v1/{name=users/*}/operations\" to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.
## Parameters
- connection (GoogleApi.Dataproc.V1.Connection): Connection to server
- projects_id (String): Part of `name`. The name of the operation's parent resource.
- regions_id (String): Part of `name`. See documentation of `projectsId`.
- opts (KeywordList): [optional] Optional parameters
- :upload_protocol (String): Upload protocol for media (e.g. \"raw\", \"multipart\").
- :pretty_print (Boolean): Returns response with indentations and line breaks.
- :fields (String): Selector specifying which fields to include in a partial response.
- :upload_type (String): Legacy upload protocol for media (e.g. \"media\", \"multipart\").
- :__/xgafv (String): V1 error format.
- :callback (String): JSONP
- :alt (String): Data format for response.
- :key (String): API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
- :access_token (String): OAuth access token.
- :quota_user (String): Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
- :pp (Boolean): Pretty-print response.
- :oauth_token (String): OAuth 2.0 token for the current user.
- :bearer_token (String): OAuth bearer token.
- :filter (String): The standard list filter.
- :page_token (String): The standard list page token.
- :page_size (Integer): The standard list page size.
## Returns
{:ok, %GoogleApi.Dataproc.V1.Model.ListOperationsResponse{}} on success
{:error, info} on failure
"""
@spec dataproc_projects_regions_operations_list(Tesla.Env.client, String.t, String.t, keyword()) :: {:ok, GoogleApi.Dataproc.V1.Model.ListOperationsResponse.t} | {:error, Tesla.Env.t}
def dataproc_projects_regions_operations_list(connection, projects_id, regions_id, opts \\ []) do
optional_params = %{
:"upload_protocol" => :query,
:"prettyPrint" => :query,
:"fields" => :query,
:"uploadType" => :query,
:"$.xgafv" => :query,
:"callback" => :query,
:"alt" => :query,
:"key" => :query,
:"access_token" => :query,
:"quotaUser" => :query,
:"pp" => :query,
:"oauth_token" => :query,
:"bearer_token" => :query,
:"filter" => :query,
:"pageToken" => :query,
:"pageSize" => :query
}
%{}
|> method(:get)
|> url("/v1/projects/{projectsId}/regions/{regionsId}/operations", %{
"projectsId" => URI.encode_www_form(projects_id),
"regionsId" => URI.encode_www_form(regions_id)
})
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> decode(%GoogleApi.Dataproc.V1.Model.ListOperationsResponse{})
end
end