123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632 |
- // Copyright 2022 Google LLC
- //
- // 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.
- syntax = "proto3";
- package google.dataflow.v1beta3;
- import "google/api/annotations.proto";
- import "google/api/client.proto";
- import "google/dataflow/v1beta3/environment.proto";
- import "google/dataflow/v1beta3/jobs.proto";
- import "google/rpc/status.proto";
- option csharp_namespace = "Google.Cloud.Dataflow.V1Beta3";
- option go_package = "google.golang.org/genproto/googleapis/dataflow/v1beta3;dataflow";
- option java_multiple_files = true;
- option java_outer_classname = "TemplatesProto";
- option java_package = "com.google.dataflow.v1beta3";
- option php_namespace = "Google\\Cloud\\Dataflow\\V1beta3";
- option ruby_package = "Google::Cloud::Dataflow::V1beta3";
- // Provides a method to create Cloud Dataflow jobs from templates.
- service TemplatesService {
- option (google.api.default_host) = "dataflow.googleapis.com";
- option (google.api.oauth_scopes) =
- "https://www.googleapis.com/auth/cloud-platform,"
- "https://www.googleapis.com/auth/compute,"
- "https://www.googleapis.com/auth/compute.readonly,"
- "https://www.googleapis.com/auth/userinfo.email";
- // Creates a Cloud Dataflow job from a template.
- rpc CreateJobFromTemplate(CreateJobFromTemplateRequest) returns (Job) {
- option (google.api.http) = {
- post: "/v1b3/projects/{project_id}/locations/{location}/templates"
- body: "*"
- additional_bindings {
- post: "/v1b3/projects/{project_id}/templates"
- body: "*"
- }
- };
- }
- // Launch a template.
- rpc LaunchTemplate(LaunchTemplateRequest) returns (LaunchTemplateResponse) {
- option (google.api.http) = {
- post: "/v1b3/projects/{project_id}/locations/{location}/templates:launch"
- body: "launch_parameters"
- additional_bindings {
- post: "/v1b3/projects/{project_id}/templates:launch"
- body: "launch_parameters"
- }
- };
- }
- // Get the template associated with a template.
- rpc GetTemplate(GetTemplateRequest) returns (GetTemplateResponse) {
- option (google.api.http) = {
- get: "/v1b3/projects/{project_id}/locations/{location}/templates:get"
- additional_bindings {
- get: "/v1b3/projects/{project_id}/templates:get"
- }
- };
- }
- }
- // Provides a service for Flex templates. This feature is not ready yet.
- service FlexTemplatesService {
- option (google.api.default_host) = "dataflow.googleapis.com";
- option (google.api.oauth_scopes) =
- "https://www.googleapis.com/auth/cloud-platform,"
- "https://www.googleapis.com/auth/compute,"
- "https://www.googleapis.com/auth/compute.readonly,"
- "https://www.googleapis.com/auth/userinfo.email";
- // Launch a job with a FlexTemplate.
- rpc LaunchFlexTemplate(LaunchFlexTemplateRequest) returns (LaunchFlexTemplateResponse) {
- option (google.api.http) = {
- post: "/v1b3/projects/{project_id}/locations/{location}/flexTemplates:launch"
- body: "*"
- };
- }
- }
- // Response to the request to launch a job from Flex Template.
- message LaunchFlexTemplateResponse {
- // The job that was launched, if the request was not a dry run and
- // the job was successfully launched.
- Job job = 1;
- }
- // Container Spec.
- message ContainerSpec {
- // Name of the docker container image. E.g., gcr.io/project/some-image
- string image = 1;
- // Metadata describing a template including description and validation rules.
- TemplateMetadata metadata = 2;
- // Required. SDK info of the Flex Template.
- SDKInfo sdk_info = 3;
- // Default runtime environment for the job.
- FlexTemplateRuntimeEnvironment default_environment = 4;
- }
- // Launch FlexTemplate Parameter.
- message LaunchFlexTemplateParameter {
- // Required. The job name to use for the created job. For update job request,
- // job name should be same as the existing running job.
- string job_name = 1;
- // Launch Mechanism.
- oneof template {
- // Spec about the container image to launch.
- ContainerSpec container_spec = 4;
- // Cloud Storage path to a file with json serialized ContainerSpec as
- // content.
- string container_spec_gcs_path = 5;
- }
- // The parameters for FlexTemplate.
- // Ex. {"num_workers":"5"}
- map<string, string> parameters = 2;
- // Launch options for this flex template job. This is a common set of options
- // across languages and templates. This should not be used to pass job
- // parameters.
- map<string, string> launch_options = 6;
- // The runtime environment for the FlexTemplate job
- FlexTemplateRuntimeEnvironment environment = 7;
- // Set this to true if you are sending a request to update a running
- // streaming job. When set, the job name should be the same as the
- // running job.
- bool update = 8;
- // Use this to pass transform_name_mappings for streaming update jobs.
- // Ex:{"oldTransformName":"newTransformName",...}'
- map<string, string> transform_name_mappings = 9;
- }
- // The environment values to be set at runtime for flex template.
- message FlexTemplateRuntimeEnvironment {
- // The initial number of Google Compute Engine instances for the job.
- int32 num_workers = 1;
- // The maximum number of Google Compute Engine instances to be made
- // available to your pipeline during execution, from 1 to 1000.
- int32 max_workers = 2;
- // The Compute Engine [availability
- // zone](https://cloud.google.com/compute/docs/regions-zones/regions-zones)
- // for launching worker instances to run your pipeline.
- // In the future, worker_zone will take precedence.
- string zone = 3;
- // The email address of the service account to run the job as.
- string service_account_email = 4;
- // The Cloud Storage path to use for temporary files.
- // Must be a valid Cloud Storage URL, beginning with `gs://`.
- string temp_location = 5;
- // The machine type to use for the job. Defaults to the value from the
- // template if not specified.
- string machine_type = 6;
- // Additional experiment flags for the job.
- repeated string additional_experiments = 7;
- // Network to which VMs will be assigned. If empty or unspecified,
- // the service will use the network "default".
- string network = 8;
- // Subnetwork to which VMs will be assigned, if desired. You can specify a
- // subnetwork using either a complete URL or an abbreviated path. Expected to
- // be of the form
- // "https://www.googleapis.com/compute/v1/projects/HOST_PROJECT_ID/regions/REGION/subnetworks/SUBNETWORK"
- // or "regions/REGION/subnetworks/SUBNETWORK". If the subnetwork is located in
- // a Shared VPC network, you must use the complete URL.
- string subnetwork = 9;
- // Additional user labels to be specified for the job.
- // Keys and values must follow the restrictions specified in the [labeling
- // restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions)
- // page.
- // An object containing a list of "key": value pairs.
- // Example: { "name": "wrench", "mass": "1kg", "count": "3" }.
- map<string, string> additional_user_labels = 10;
- // Name for the Cloud KMS key for the job.
- // Key format is:
- // projects/<project>/locations/<location>/keyRings/<keyring>/cryptoKeys/<key>
- string kms_key_name = 11;
- // Configuration for VM IPs.
- WorkerIPAddressConfiguration ip_configuration = 12;
- // The Compute Engine region
- // (https://cloud.google.com/compute/docs/regions-zones/regions-zones) in
- // which worker processing should occur, e.g. "us-west1". Mutually exclusive
- // with worker_zone. If neither worker_region nor worker_zone is specified,
- // default to the control plane's region.
- string worker_region = 13;
- // The Compute Engine zone
- // (https://cloud.google.com/compute/docs/regions-zones/regions-zones) in
- // which worker processing should occur, e.g. "us-west1-a". Mutually exclusive
- // with worker_region. If neither worker_region nor worker_zone is specified,
- // a zone in the control plane's region is chosen based on available capacity.
- // If both `worker_zone` and `zone` are set, `worker_zone` takes precedence.
- string worker_zone = 14;
- // Whether to enable Streaming Engine for the job.
- bool enable_streaming_engine = 15;
- // Set FlexRS goal for the job.
- // https://cloud.google.com/dataflow/docs/guides/flexrs
- FlexResourceSchedulingGoal flexrs_goal = 16;
- // The Cloud Storage path for staging local files.
- // Must be a valid Cloud Storage URL, beginning with `gs://`.
- string staging_location = 17;
- // Docker registry location of container image to use for the 'worker harness.
- // Default is the container for the version of the SDK. Note this field is
- // only valid for portable pipelines.
- string sdk_container_image = 18;
- // Worker disk size, in gigabytes.
- int32 disk_size_gb = 20;
- // The algorithm to use for autoscaling
- AutoscalingAlgorithm autoscaling_algorithm = 21;
- // If true, save a heap dump before killing a thread or process which is GC
- // thrashing or out of memory. The location of the heap file will either be
- // echoed back to the user, or the user will be given the opportunity to
- // download the heap file.
- bool dump_heap_on_oom = 22;
- // Cloud Storage bucket (directory) to upload heap dumps to the given
- // location. Enabling this implies that heap dumps should be generated on OOM
- // (dump_heap_on_oom is set to true).
- string save_heap_dumps_to_gcs_path = 23;
- // The machine type to use for launching the job. The default is
- // n1-standard-1.
- string launcher_machine_type = 24;
- }
- // A request to launch a Cloud Dataflow job from a FlexTemplate.
- message LaunchFlexTemplateRequest {
- // Required. The ID of the Cloud Platform project that the job belongs to.
- string project_id = 1;
- // Required. Parameter to launch a job form Flex Template.
- LaunchFlexTemplateParameter launch_parameter = 2;
- // Required. The [regional endpoint]
- // (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) to
- // which to direct the request. E.g., us-central1, us-west1.
- string location = 3;
- // If true, the request is validated but not actually executed.
- // Defaults to false.
- bool validate_only = 4;
- }
- // The environment values to set at runtime.
- message RuntimeEnvironment {
- // The initial number of Google Compute Engine instnaces for the job.
- int32 num_workers = 11;
- // The maximum number of Google Compute Engine instances to be made
- // available to your pipeline during execution, from 1 to 1000.
- int32 max_workers = 1;
- // The Compute Engine [availability
- // zone](https://cloud.google.com/compute/docs/regions-zones/regions-zones)
- // for launching worker instances to run your pipeline.
- // In the future, worker_zone will take precedence.
- string zone = 2;
- // The email address of the service account to run the job as.
- string service_account_email = 3;
- // The Cloud Storage path to use for temporary files.
- // Must be a valid Cloud Storage URL, beginning with `gs://`.
- string temp_location = 4;
- // Whether to bypass the safety checks for the job's temporary directory.
- // Use with caution.
- bool bypass_temp_dir_validation = 5;
- // The machine type to use for the job. Defaults to the value from the
- // template if not specified.
- string machine_type = 6;
- // Additional experiment flags for the job, specified with the
- // `--experiments` option.
- repeated string additional_experiments = 7;
- // Network to which VMs will be assigned. If empty or unspecified,
- // the service will use the network "default".
- string network = 8;
- // Subnetwork to which VMs will be assigned, if desired. You can specify a
- // subnetwork using either a complete URL or an abbreviated path. Expected to
- // be of the form
- // "https://www.googleapis.com/compute/v1/projects/HOST_PROJECT_ID/regions/REGION/subnetworks/SUBNETWORK"
- // or "regions/REGION/subnetworks/SUBNETWORK". If the subnetwork is located in
- // a Shared VPC network, you must use the complete URL.
- string subnetwork = 9;
- // Additional user labels to be specified for the job.
- // Keys and values should follow the restrictions specified in the [labeling
- // restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions)
- // page.
- // An object containing a list of "key": value pairs.
- // Example: { "name": "wrench", "mass": "1kg", "count": "3" }.
- map<string, string> additional_user_labels = 10;
- // Name for the Cloud KMS key for the job.
- // Key format is:
- // projects/<project>/locations/<location>/keyRings/<keyring>/cryptoKeys/<key>
- string kms_key_name = 12;
- // Configuration for VM IPs.
- WorkerIPAddressConfiguration ip_configuration = 14;
- // The Compute Engine region
- // (https://cloud.google.com/compute/docs/regions-zones/regions-zones) in
- // which worker processing should occur, e.g. "us-west1". Mutually exclusive
- // with worker_zone. If neither worker_region nor worker_zone is specified,
- // default to the control plane's region.
- string worker_region = 15;
- // The Compute Engine zone
- // (https://cloud.google.com/compute/docs/regions-zones/regions-zones) in
- // which worker processing should occur, e.g. "us-west1-a". Mutually exclusive
- // with worker_region. If neither worker_region nor worker_zone is specified,
- // a zone in the control plane's region is chosen based on available capacity.
- // If both `worker_zone` and `zone` are set, `worker_zone` takes precedence.
- string worker_zone = 16;
- // Whether to enable Streaming Engine for the job.
- bool enable_streaming_engine = 17;
- }
- // Metadata for a specific parameter.
- message ParameterMetadata {
- // Required. The name of the parameter.
- string name = 1;
- // Required. The label to display for the parameter.
- string label = 2;
- // Required. The help text to display for the parameter.
- string help_text = 3;
- // Optional. Whether the parameter is optional. Defaults to false.
- bool is_optional = 4;
- // Optional. Regexes that the parameter must match.
- repeated string regexes = 5;
- // Optional. The type of the parameter.
- // Used for selecting input picker.
- ParameterType param_type = 6;
- // Optional. Additional metadata for describing this parameter.
- map<string, string> custom_metadata = 7;
- }
- // ParameterType specifies what kind of input we need for this parameter.
- enum ParameterType {
- // Default input type.
- DEFAULT = 0;
- // The parameter specifies generic text input.
- TEXT = 1;
- // The parameter specifies a Cloud Storage Bucket to read from.
- GCS_READ_BUCKET = 2;
- // The parameter specifies a Cloud Storage Bucket to write to.
- GCS_WRITE_BUCKET = 3;
- // The parameter specifies a Cloud Storage file path to read from.
- GCS_READ_FILE = 4;
- // The parameter specifies a Cloud Storage file path to write to.
- GCS_WRITE_FILE = 5;
- // The parameter specifies a Cloud Storage folder path to read from.
- GCS_READ_FOLDER = 6;
- // The parameter specifies a Cloud Storage folder to write to.
- GCS_WRITE_FOLDER = 7;
- // The parameter specifies a Pub/Sub Topic.
- PUBSUB_TOPIC = 8;
- // The parameter specifies a Pub/Sub Subscription.
- PUBSUB_SUBSCRIPTION = 9;
- }
- // Metadata describing a template.
- message TemplateMetadata {
- // Required. The name of the template.
- string name = 1;
- // Optional. A description of the template.
- string description = 2;
- // The parameters for the template.
- repeated ParameterMetadata parameters = 3;
- }
- // SDK Information.
- message SDKInfo {
- // SDK Language.
- enum Language {
- // UNKNOWN Language.
- UNKNOWN = 0;
- // Java.
- JAVA = 1;
- // Python.
- PYTHON = 2;
- }
- // Required. The SDK Language.
- Language language = 1;
- // Optional. The SDK version.
- string version = 2;
- }
- // RuntimeMetadata describing a runtime environment.
- message RuntimeMetadata {
- // SDK Info for the template.
- SDKInfo sdk_info = 1;
- // The parameters for the template.
- repeated ParameterMetadata parameters = 2;
- }
- // A request to create a Cloud Dataflow job from a template.
- message CreateJobFromTemplateRequest {
- // Required. The ID of the Cloud Platform project that the job belongs to.
- string project_id = 1;
- // Required. The job name to use for the created job.
- string job_name = 4;
- // The template from which to create the job.
- oneof template {
- // Required. A Cloud Storage path to the template from which to
- // create the job.
- // Must be a valid Cloud Storage URL, beginning with `gs://`.
- string gcs_path = 2;
- }
- // The runtime parameters to pass to the job.
- map<string, string> parameters = 3;
- // The runtime environment for the job.
- RuntimeEnvironment environment = 5;
- // The [regional endpoint]
- // (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) to
- // which to direct the request.
- string location = 6;
- }
- // A request to retrieve a Cloud Dataflow job template.
- message GetTemplateRequest {
- // The various views of a template that may be retrieved.
- enum TemplateView {
- // Template view that retrieves only the metadata associated with the
- // template.
- METADATA_ONLY = 0;
- }
- // Required. The ID of the Cloud Platform project that the job belongs to.
- string project_id = 1;
- // The template from which to create the job.
- oneof template {
- // Required. A Cloud Storage path to the template from which to
- // create the job.
- // Must be valid Cloud Storage URL, beginning with 'gs://'.
- string gcs_path = 2;
- }
- // The view to retrieve. Defaults to METADATA_ONLY.
- TemplateView view = 3;
- // The [regional endpoint]
- // (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) to
- // which to direct the request.
- string location = 4;
- }
- // The response to a GetTemplate request.
- message GetTemplateResponse {
- // Template Type.
- enum TemplateType {
- // Unknown Template Type.
- UNKNOWN = 0;
- // Legacy Template.
- LEGACY = 1;
- // Flex Template.
- FLEX = 2;
- }
- // The status of the get template request. Any problems with the
- // request will be indicated in the error_details.
- google.rpc.Status status = 1;
- // The template metadata describing the template name, available
- // parameters, etc.
- TemplateMetadata metadata = 2;
- // Template Type.
- TemplateType template_type = 3;
- // Describes the runtime metadata with SDKInfo and available parameters.
- RuntimeMetadata runtime_metadata = 4;
- }
- // Parameters to provide to the template being launched.
- message LaunchTemplateParameters {
- // Required. The job name to use for the created job.
- string job_name = 1;
- // The runtime parameters to pass to the job.
- map<string, string> parameters = 2;
- // The runtime environment for the job.
- RuntimeEnvironment environment = 3;
- // If set, replace the existing pipeline with the name specified by jobName
- // with this pipeline, preserving state.
- bool update = 4;
- // Only applicable when updating a pipeline. Map of transform name prefixes of
- // the job to be replaced to the corresponding name prefixes of the new job.
- map<string, string> transform_name_mapping = 5;
- }
- // A request to launch a template.
- message LaunchTemplateRequest {
- // Required. The ID of the Cloud Platform project that the job belongs to.
- string project_id = 1;
- // If true, the request is validated but not actually executed.
- // Defaults to false.
- bool validate_only = 2;
- // The template from which to create the job.
- oneof template {
- // A Cloud Storage path to the template from which to create
- // the job.
- // Must be valid Cloud Storage URL, beginning with 'gs://'.
- string gcs_path = 3;
- // Params for launching a dynamic template.
- DynamicTemplateLaunchParams dynamic_template = 6;
- }
- // The parameters of the template to launch. This should be part of the
- // body of the POST request.
- LaunchTemplateParameters launch_parameters = 4;
- // The [regional endpoint]
- // (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) to
- // which to direct the request.
- string location = 5;
- }
- // Response to the request to launch a template.
- message LaunchTemplateResponse {
- // The job that was launched, if the request was not a dry run and
- // the job was successfully launched.
- Job job = 1;
- }
- // Used in the error_details field of a google.rpc.Status message, this
- // indicates problems with the template parameter.
- message InvalidTemplateParameters {
- // A specific template-parameter violation.
- message ParameterViolation {
- // The parameter that failed to validate.
- string parameter = 1;
- // A description of why the parameter failed to validate.
- string description = 2;
- }
- // Describes all parameter violations in a template request.
- repeated ParameterViolation parameter_violations = 1;
- }
- // Params which should be passed when launching a dynamic template.
- message DynamicTemplateLaunchParams {
- // Path to dynamic template spec file on Cloud Storage.
- // The file must be a Json serialized DynamicTemplateFieSpec object.
- string gcs_path = 1;
- // Cloud Storage path for staging dependencies.
- // Must be a valid Cloud Storage URL, beginning with `gs://`.
- string staging_location = 2;
- }
|