Dataflow API . projects

Instance Methods

jobs()

Returns the jobs Resource.

locations()

Returns the locations Resource.

snapshots()

Returns the snapshots Resource.

templates()

Returns the templates Resource.

close()

Close httplib2 connections.

deleteSnapshots(projectId, location=None, snapshotId=None, x__xgafv=None)

Deletes a snapshot.

workerMessages(projectId, body=None, x__xgafv=None)

Send a worker_message to the service.

Method Details

close()
Close httplib2 connections.
deleteSnapshots(projectId, location=None, snapshotId=None, x__xgafv=None)
Deletes a snapshot.

Args:
  projectId: string, The ID of the Cloud Platform project that the snapshot belongs to. (required)
  location: string, The location that contains this snapshot.
  snapshotId: string, The ID of the snapshot.
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Response from deleting a snapshot.
}
workerMessages(projectId, body=None, x__xgafv=None)
Send a worker_message to the service.

Args:
  projectId: string, The project to send the WorkerMessages to. (required)
  body: object, The request body.
    The object takes the form of:

{ # A request for sending worker messages to the service.
  "location": "A String", # The [regional endpoint] (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that contains the job.
  "workerMessages": [ # The WorkerMessages to send.
    { # WorkerMessage provides information to the backend about a worker.
      "dataSamplingReport": { # Contains per-worker telemetry about the data sampling feature. # Optional. Contains metrics related to go/dataflow-data-sampling-telemetry.
        "bytesWrittenDelta": "A String", # Optional. Delta of bytes written to file from previous report.
        "elementsSampledBytes": "A String", # Optional. Delta of bytes sampled from previous report.
        "elementsSampledCount": "A String", # Optional. Delta of number of elements sampled from previous report.
        "exceptionsSampledCount": "A String", # Optional. Delta of number of samples taken from user code exceptions from previous report.
        "pcollectionsSampledCount": "A String", # Optional. Delta of number of PCollections sampled from previous report.
        "persistenceErrorsCount": "A String", # Optional. Delta of errors counts from persisting the samples from previous report.
        "translationErrorsCount": "A String", # Optional. Delta of errors counts from retrieving, or translating the samples from previous report.
      },
      "labels": { # Labels are used to group WorkerMessages. For example, a worker_message about a particular container might have the labels: { "JOB_ID": "2015-04-22", "WORKER_ID": "wordcount-vm-2015…" "CONTAINER_TYPE": "worker", "CONTAINER_ID": "ac1234def"} Label tags typically correspond to Label enum values. However, for ease of development other strings can be used as tags. LABEL_UNSPECIFIED should not be used here.
        "a_key": "A String",
      },
      "perWorkerMetrics": { # Per worker metrics. # System defined metrics for this worker.
        "perStepNamespaceMetrics": [ # Optional. Metrics for a particular unfused step and namespace.
          { # Metrics for a particular unfused step and namespace. A metric is uniquely identified by the `metrics_namespace`, `original_step`, `metric name` and `metric_labels`.
            "metricValues": [ # Optional. Metrics that are recorded for this namespace and unfused step.
              { # The value of a metric along with its name and labels.
                "metric": "A String", # Base name for this metric.
                "metricLabels": { # Optional. Set of metric labels for this metric.
                  "a_key": "A String",
                },
                "valueHistogram": { # Summary statistics for a population of values. HistogramValue contains a sequence of buckets and gives a count of values that fall into each bucket. Bucket boundares are defined by a formula and bucket widths are either fixed or exponentially increasing. # Histogram value of this metric.
                  "bucketCounts": [ # Optional. The number of values in each bucket of the histogram, as described in `bucket_options`. `bucket_counts` should contain N values, where N is the number of buckets specified in `bucket_options`. If `bucket_counts` has fewer than N values, the remaining values are assumed to be 0.
                    "A String",
                  ],
                  "bucketOptions": { # `BucketOptions` describes the bucket boundaries used in the histogram. # Describes the bucket boundaries used in the histogram.
                    "exponential": { # Exponential buckets where the growth factor between buckets is `2**(2**-scale)`. e.g. for `scale=1` growth factor is `2**(2**(-1))=sqrt(2)`. `n` buckets will have the following boundaries. - 0th: [0, gf) - i in [1, n-1]: [gf^(i), gf^(i+1)) # Bucket boundaries grow exponentially.
                      "numberOfBuckets": 42, # Must be greater than 0.
                      "scale": 42, # Must be between -3 and 3. This forces the growth factor of the bucket boundaries to be between `2^(1/8)` and `256`.
                    },
                    "linear": { # Linear buckets with the following boundaries for indices in 0 to n-1. - i in [0, n-1]: [start + (i)*width, start + (i+1)*width) # Bucket boundaries grow linearly.
                      "numberOfBuckets": 42, # Must be greater than 0.
                      "start": 3.14, # Lower bound of the first bucket.
                      "width": 3.14, # Distance between bucket boundaries. Must be greater than 0.
                    },
                  },
                  "count": "A String", # Number of values recorded in this histogram.
                  "outlierStats": { # Statistics for the underflow and overflow bucket. # Statistics on the values recorded in the histogram that fall out of the bucket boundaries.
                    "overflowCount": "A String", # Number of values that are larger than the upper bound of the largest bucket.
                    "overflowMean": 3.14, # Mean of values in the overflow bucket.
                    "underflowCount": "A String", # Number of values that are smaller than the lower bound of the smallest bucket.
                    "underflowMean": 3.14, # Mean of values in the undeflow bucket.
                  },
                },
                "valueInt64": "A String", # Integer value of this metric.
              },
            ],
            "metricsNamespace": "A String", # The namespace of these metrics on the worker.
            "originalStep": "A String", # The original system name of the unfused step that these metrics are reported from.
          },
        ],
      },
      "streamingScalingReport": { # Contains per-user worker telemetry used in streaming autoscaling. # Contains per-user worker telemetry used in streaming autoscaling.
        "activeBundleCount": 42,
        "activeThreadCount": 42, # Current acive thread count.
        "maximumBundleCount": 42, # Maximum bundle count.
        "maximumBytes": "A String", # Maximum bytes.
        "maximumBytesCount": 42,
        "maximumThreadCount": 42, # Maximum thread count limit.
        "outstandingBundleCount": 42, # Current outstanding bundle count.
        "outstandingBytes": "A String", # Current outstanding bytes.
        "outstandingBytesCount": 42,
      },
      "time": "A String", # The timestamp of the worker_message.
      "workerHealthReport": { # WorkerHealthReport contains information about the health of a worker. The VM should be identified by the labels attached to the WorkerMessage that this health ping belongs to. # The health of a worker.
        "msg": "A String", # Message describing any unusual health reports.
        "pods": [ # The pods running on the worker. See: http://kubernetes.io/v1.1/docs/api-reference/v1/definitions.html#_v1_pod This field is used by the worker to send the status of the indvidual containers running on each worker.
          {
            "a_key": "", # Properties of the object.
          },
        ],
        "reportInterval": "A String", # The interval at which the worker is sending health reports. The default value of 0 should be interpreted as the field is not being explicitly set by the worker.
        "vmBrokenCode": "A String", # Code to describe a specific reason, if known, that a VM has reported broken state.
        "vmIsBroken": True or False, # Whether the VM is in a permanently broken state. Broken VMs should be abandoned or deleted ASAP to avoid assigning or completing any work.
        "vmIsHealthy": True or False, # Whether the VM is currently healthy.
        "vmStartupTime": "A String", # The time the VM was booted.
      },
      "workerLifecycleEvent": { # A report of an event in a worker's lifecycle. The proto contains one event, because the worker is expected to asynchronously send each message immediately after the event. Due to this asynchrony, messages may arrive out of order (or missing), and it is up to the consumer to interpret. The timestamp of the event is in the enclosing WorkerMessage proto. # Record of worker lifecycle events.
        "containerStartTime": "A String", # The start time of this container. All events will report this so that events can be grouped together across container/VM restarts.
        "event": "A String", # The event being reported.
        "metadata": { # Other stats that can accompany an event. E.g. { "downloaded_bytes" : "123456" }
          "a_key": "A String",
        },
      },
      "workerMessageCode": { # A message code is used to report status and error messages to the service. The message codes are intended to be machine readable. The service will take care of translating these into user understandable messages if necessary. Example use cases: 1. Worker processes reporting successful startup. 2. Worker processes reporting specific errors (e.g. package staging failure). # A worker message code.
        "code": "A String", # The code is a string intended for consumption by a machine that identifies the type of message being sent. Examples: 1. "HARNESS_STARTED" might be used to indicate the worker harness has started. 2. "GCS_DOWNLOAD_ERROR" might be used to indicate an error downloading a Cloud Storage file as part of the boot process of one of the worker containers. This is a string and not an enum to make it easy to add new codes without waiting for an API change.
        "parameters": { # Parameters contains specific information about the code. This is a struct to allow parameters of different types. Examples: 1. For a "HARNESS_STARTED" message parameters might provide the name of the worker and additional data like timing information. 2. For a "GCS_DOWNLOAD_ERROR" parameters might contain fields listing the Cloud Storage objects being downloaded and fields containing errors. In general complex data structures should be avoided. If a worker needs to send a specific and complicated data structure then please consider defining a new proto and adding it to the data oneof in WorkerMessageResponse. Conventions: Parameters should only be used for information that isn't typically passed as a label. hostname and other worker identifiers should almost always be passed as labels since they will be included on most messages.
          "a_key": "", # Properties of the object.
        },
      },
      "workerMetrics": { # Worker metrics exported from workers. This contains resource utilization metrics accumulated from a variety of sources. For more information, see go/df-resource-signals. # Resource metrics reported by workers.
        "containers": { # Per container information. Key: container name.
          "a_key": # Object with schema name: ResourceUtilizationReport
        },
        "cpuTime": [ # CPU utilization samples.
          { # Modeled after information exposed by /proc/stat.
            "rate": 3.14, # Average CPU utilization rate (% non-idle cpu / second) since previous sample.
            "timestamp": "A String", # Timestamp of the measurement.
            "totalMs": "A String", # Total active CPU time across all cores (ie., non-idle) in milliseconds since start-up.
          },
        ],
        "memoryInfo": [ # Memory utilization samples.
          { # Information about the memory usage of a worker or a container within a worker.
            "currentLimitBytes": "A String", # Instantenous memory limit in bytes.
            "currentOoms": "A String", # Number of Out of Memory (OOM) events recorded since the previous measurement.
            "currentRssBytes": "A String", # Instantenous memory (RSS) size in bytes.
            "timestamp": "A String", # Timestamp of the measurement.
            "totalGbMs": "A String", # Total memory (RSS) usage since start up in GB * ms.
          },
        ],
      },
      "workerShutdownNotice": { # Shutdown notification from workers. This is to be sent by the shutdown script of the worker VM so that the backend knows that the VM is being shut down. # Shutdown notice by workers.
        "reason": "A String", # The reason for the worker shutdown. Current possible values are: "UNKNOWN": shutdown reason is unknown. "PREEMPTION": shutdown reason is preemption. Other possible reasons may be added in the future.
      },
      "workerThreadScalingReport": { # Contains information about the thread scaling information of a worker. # Thread scaling information reported by workers.
        "currentThreadCount": 42, # Current number of active threads in a worker.
      },
    },
  ],
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # The response to the worker messages.
  "workerMessageResponses": [ # The servers response to the worker messages.
    { # A worker_message response allows the server to pass information to the sender.
      "streamingScalingReportResponse": { # Contains per-user-worker streaming scaling recommendation from the backend. # Service's streaming scaling response for workers.
        "maximumThreadCount": 42, # Maximum thread count limit;
      },
      "workerHealthReportResponse": { # WorkerHealthReportResponse contains information returned to the worker in response to a health ping. # The service's response to a worker's health report.
        "reportInterval": "A String", # A positive value indicates the worker should change its reporting interval to the specified value. The default value of zero means no change in report rate is requested by the server.
      },
      "workerMetricsResponse": { # Service-side response to WorkerMessage reporting resource utilization. # Service's response to reporting worker metrics (currently empty).
      },
      "workerShutdownNoticeResponse": { # Service-side response to WorkerMessage issuing shutdown notice. # Service's response to shutdown notice (currently empty).
      },
      "workerThreadScalingReportResponse": { # Contains the thread scaling recommendation for a worker from the backend. # Service's thread scaling recommendation for workers.
        "recommendedThreadCount": 42, # Recommended number of threads for a worker.
      },
    },
  ],
}