# Google Cloud Logging API . projects . logServices . sinks

## Instance Methods

Creates the specified log service sink resource.

Deletes the specified log service sink.

Gets the specified log service sink resource.

Lists log service sinks associated with the specified service.

Creates or update the specified log service sink resource.

### Method Details

`create(projectsId, logServicesId, body, x__xgafv=None)`

    Creates the specified log service sink resource.

    Args:
      projectsId: string, Part of `serviceName`. The name of the service in which to create a sink. (required)
      logServicesId: string, Part of `serviceName`. See documentation of `projectsId`. (required)
      body: object, The request body. (required)
        The object takes the form of:

    { # An object that describes where a log may be written.
        "errors": [ # _Output only._ All active errors found for this sink.
          { # A problem in a sink or the sink's configuration.
            "status": { # Represents the RPC error status for Google APIs. See http://go/errormodel for details. # The description of the last error observed.
              "message": "A String", # A developer-facing error message, which should be in English. The user-facing error message should be localized and stored in the [google.rpc.Status.details][google.rpc.Status.details] field.
              "code": 42, # The status code, which should be an enum value of [google.rpc.Code][].
              "details": [ # A list of messages that carry the error details. There will be a common set of message types for APIs to use.
                {
                  "a_key": "", # Properties of the object. Contains field @ype with type URL.
                },
              ],
            },
            "timeNanos": "A String", # The last time the error was observed, in nanoseconds since the Unix epoch.
            "resource": "A String", # The resource associated with the error. It may be different from the sink destination. For example, the sink may point to a BigQuery dataset, but the error may refer to a table resource inside the dataset.
          },
        ],
        "destination": "A String", # The resource to send log entries to. The supported sink resource types are: + Google Cloud Storage: `storage.googleapis.com/BUCKET` or `BUCKET.storage.googleapis.com/` + Google BigQuery: `bigquery.googleapis.com/projects/PROJECT/datasets/DATASET` Currently the Cloud Logging API supports at most one sink for each resource type per log or log service resource.
        "name": "A String", # The name of this sink. This is a client-assigned identifier for the resource. This is ignored by UpdateLogSink and UpdateLogServicesSink.
      }

      x__xgafv: string, V1 error format.

    Returns:
      An object of the form:

        { # An object that describes where a log may be written.
          "errors": [ # _Output only._ All active errors found for this sink.
            { # A problem in a sink or the sink's configuration.
              "status": { # Represents the RPC error status for Google APIs. See http://go/errormodel for details. # The description of the last error observed.
                "message": "A String", # A developer-facing error message, which should be in English. The user-facing error message should be localized and stored in the [google.rpc.Status.details][google.rpc.Status.details] field.
                "code": 42, # The status code, which should be an enum value of [google.rpc.Code][].
                "details": [ # A list of messages that carry the error details. There will be a common set of message types for APIs to use.
                  {
                    "a_key": "", # Properties of the object. Contains field @ype with type URL.
                  },
                ],
              },
              "timeNanos": "A String", # The last time the error was observed, in nanoseconds since the Unix epoch.
              "resource": "A String", # The resource associated with the error. It may be different from the sink destination. For example, the sink may point to a BigQuery dataset, but the error may refer to a table resource inside the dataset.
            },
          ],
          "destination": "A String", # The resource to send log entries to. The supported sink resource types are: + Google Cloud Storage: `storage.googleapis.com/BUCKET` or `BUCKET.storage.googleapis.com/` + Google BigQuery: `bigquery.googleapis.com/projects/PROJECT/datasets/DATASET` Currently the Cloud Logging API supports at most one sink for each resource type per log or log service resource.
          "name": "A String", # The name of this sink. This is a client-assigned identifier for the resource. This is ignored by UpdateLogSink and UpdateLogServicesSink.
        }

`delete(projectsId, logServicesId, sinksId, x__xgafv=None)`

    Deletes the specified log service sink.

    Args:
      projectsId: string, Part of `sinkName`. The name of the sink to delete. (required)
      logServicesId: string, Part of `sinkName`. See documentation of `projectsId`. (required)
      sinksId: string, Part of `sinkName`. See documentation of `projectsId`. (required)
      x__xgafv: string, V1 error format.

    Returns:
      An object of the form:

        { # A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
      }

`get(projectsId, logServicesId, sinksId, x__xgafv=None)`

    Gets the specified log service sink resource.

    Args:
      projectsId: string, Part of `sinkName`. The name of the sink to return. (required)
      logServicesId: string, Part of `sinkName`. See documentation of `projectsId`. (required)
      sinksId: string, Part of `sinkName`. See documentation of `projectsId`. (required)
      x__xgafv: string, V1 error format.

    Returns:
      An object of the form:

        { # An object that describes where a log may be written.
          "errors": [ # _Output only._ All active errors found for this sink.
            { # A problem in a sink or the sink's configuration.
              "status": { # Represents the RPC error status for Google APIs. See http://go/errormodel for details. # The description of the last error observed.
                "message": "A String", # A developer-facing error message, which should be in English. The user-facing error message should be localized and stored in the [google.rpc.Status.details][google.rpc.Status.details] field.
                "code": 42, # The status code, which should be an enum value of [google.rpc.Code][].
                "details": [ # A list of messages that carry the error details. There will be a common set of message types for APIs to use.
                  {
                    "a_key": "", # Properties of the object. Contains field @ype with type URL.
                  },
                ],
              },
              "timeNanos": "A String", # The last time the error was observed, in nanoseconds since the Unix epoch.
              "resource": "A String", # The resource associated with the error. It may be different from the sink destination. For example, the sink may point to a BigQuery dataset, but the error may refer to a table resource inside the dataset.
            },
          ],
          "destination": "A String", # The resource to send log entries to. The supported sink resource types are: + Google Cloud Storage: `storage.googleapis.com/BUCKET` or `BUCKET.storage.googleapis.com/` + Google BigQuery: `bigquery.googleapis.com/projects/PROJECT/datasets/DATASET` Currently the Cloud Logging API supports at most one sink for each resource type per log or log service resource.
          "name": "A String", # The name of this sink. This is a client-assigned identifier for the resource. This is ignored by UpdateLogSink and UpdateLogServicesSink.
        }

`list(projectsId, logServicesId, x__xgafv=None)`

    Lists log service sinks associated with the specified service.

    Args:
      projectsId: string, Part of `serviceName`. The name of the service for which to list sinks. (required)
      logServicesId: string, Part of `serviceName`. See documentation of `projectsId`. (required)
      x__xgafv: string, V1 error format.

    Returns:
      An object of the form:

        { # Result returned from `ListLogServiceSinks`.
        "sinks": [ # The requested log service sinks. If any of the returned `LogSink` objects have an empty `destination` field, then call `logServices.sinks.get` to retrieve the complete `LogSink` object.
          { # An object that describes where a log may be written.
              "errors": [ # _Output only._ All active errors found for this sink.
                { # A problem in a sink or the sink's configuration.
                  "status": { # Represents the RPC error status for Google APIs. See http://go/errormodel for details. # The description of the last error observed.
                    "message": "A String", # A developer-facing error message, which should be in English. The user-facing error message should be localized and stored in the [google.rpc.Status.details][google.rpc.Status.details] field.
                    "code": 42, # The status code, which should be an enum value of [google.rpc.Code][].
                    "details": [ # A list of messages that carry the error details. There will be a common set of message types for APIs to use.
                      {
                        "a_key": "", # Properties of the object. Contains field @ype with type URL.
                      },
                    ],
                  },
                  "timeNanos": "A String", # The last time the error was observed, in nanoseconds since the Unix epoch.
                  "resource": "A String", # The resource associated with the error. It may be different from the sink destination. For example, the sink may point to a BigQuery dataset, but the error may refer to a table resource inside the dataset.
                },
              ],
              "destination": "A String", # The resource to send log entries to. The supported sink resource types are: + Google Cloud Storage: `storage.googleapis.com/BUCKET` or `BUCKET.storage.googleapis.com/` + Google BigQuery: `bigquery.googleapis.com/projects/PROJECT/datasets/DATASET` Currently the Cloud Logging API supports at most one sink for each resource type per log or log service resource.
              "name": "A String", # The name of this sink. This is a client-assigned identifier for the resource. This is ignored by UpdateLogSink and UpdateLogServicesSink.
            },
        ],
      }

`update(projectsId, logServicesId, sinksId, body, x__xgafv=None)`

    Creates or update the specified log service sink resource.

    Args:
      projectsId: string, Part of `sinkName`. The name of the sink to update. (required)
      logServicesId: string, Part of `sinkName`. See documentation of `projectsId`. (required)
      sinksId: string, Part of `sinkName`. See documentation of `projectsId`. (required)
      body: object, The request body. (required)
        The object takes the form of:

    { # An object that describes where a log may be written.
        "errors": [ # _Output only._ All active errors found for this sink.
          { # A problem in a sink or the sink's configuration.
            "status": { # Represents the RPC error status for Google APIs. See http://go/errormodel for details. # The description of the last error observed.
              "message": "A String", # A developer-facing error message, which should be in English. The user-facing error message should be localized and stored in the [google.rpc.Status.details][google.rpc.Status.details] field.
              "code": 42, # The status code, which should be an enum value of [google.rpc.Code][].
              "details": [ # A list of messages that carry the error details. There will be a common set of message types for APIs to use.
                {
                  "a_key": "", # Properties of the object. Contains field @ype with type URL.
                },
              ],
            },
            "timeNanos": "A String", # The last time the error was observed, in nanoseconds since the Unix epoch.
            "resource": "A String", # The resource associated with the error. It may be different from the sink destination. For example, the sink may point to a BigQuery dataset, but the error may refer to a table resource inside the dataset.
          },
        ],
        "destination": "A String", # The resource to send log entries to. The supported sink resource types are: + Google Cloud Storage: `storage.googleapis.com/BUCKET` or `BUCKET.storage.googleapis.com/` + Google BigQuery: `bigquery.googleapis.com/projects/PROJECT/datasets/DATASET` Currently the Cloud Logging API supports at most one sink for each resource type per log or log service resource.
        "name": "A String", # The name of this sink. This is a client-assigned identifier for the resource. This is ignored by UpdateLogSink and UpdateLogServicesSink.
      }

      x__xgafv: string, V1 error format.

    Returns:
      An object of the form:

        { # An object that describes where a log may be written.
          "errors": [ # _Output only._ All active errors found for this sink.
            { # A problem in a sink or the sink's configuration.
              "status": { # Represents the RPC error status for Google APIs. See http://go/errormodel for details. # The description of the last error observed.
                "message": "A String", # A developer-facing error message, which should be in English. The user-facing error message should be localized and stored in the [google.rpc.Status.details][google.rpc.Status.details] field.
                "code": 42, # The status code, which should be an enum value of [google.rpc.Code][].
                "details": [ # A list of messages that carry the error details. There will be a common set of message types for APIs to use.
                  {
                    "a_key": "", # Properties of the object. Contains field @ype with type URL.
                  },
                ],
              },
              "timeNanos": "A String", # The last time the error was observed, in nanoseconds since the Unix epoch.
              "resource": "A String", # The resource associated with the error. It may be different from the sink destination. For example, the sink may point to a BigQuery dataset, but the error may refer to a table resource inside the dataset.
            },
          ],
          "destination": "A String", # The resource to send log entries to. The supported sink resource types are: + Google Cloud Storage: `storage.googleapis.com/BUCKET` or `BUCKET.storage.googleapis.com/` + Google BigQuery: `bigquery.googleapis.com/projects/PROJECT/datasets/DATASET` Currently the Cloud Logging API supports at most one sink for each resource type per log or log service resource.
          "name": "A String", # The name of this sink. This is a client-assigned identifier for the resource. This is ignored by UpdateLogSink and UpdateLogServicesSink.
        }