Reference documentation and code samples for the Stackdriver Logging V2 Client class CreateSinkRequest.
The parameters toCreateSink.
Generated from protobuf messagegoogle.logging.v2.CreateSinkRequest
Namespace
Google \ Cloud \ Logging \ V2
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ parent
string
Required. The resource in which to create the sink: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" For examples:"projects/my-project""organizations/123456789"
Required. The new sink, whosenameparameter is a sink identifier that is not already in use.
↳ unique_writer_identity
bool
Optional. Determines the kind of IAM identity returned aswriter_identityin the new sink. If this value is omitted or set to false, and if the sink's parent is a project, then the value returned aswriter_identityis the same group or service account used by Cloud Logging before the addition of writer identities to this API. The sink's destination must be in the same project as the sink itself. If this field is set to true, or if the sink is owned by a non-project resource such as an organization, then the value ofwriter_identitywill be a unique service account used only for exports from the new sink. For more information, seewriter_identityinLogSink.
getParent
Required. The resource in which to create the sink:
"projects/[PROJECT_ID]"
"organizations/[ORGANIZATION_ID]"
"billingAccounts/[BILLING_ACCOUNT_ID]"
"folders/[FOLDER_ID]"
For examples:"projects/my-project""organizations/123456789"
Returns
Type
Description
string
setParent
Required. The resource in which to create the sink:
"projects/[PROJECT_ID]"
"organizations/[ORGANIZATION_ID]"
"billingAccounts/[BILLING_ACCOUNT_ID]"
"folders/[FOLDER_ID]"
For examples:"projects/my-project""organizations/123456789"
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getSink
Required. The new sink, whosenameparameter is a sink identifier that
is not already in use.
Optional. Determines the kind of IAM identity returned aswriter_identityin the new sink. If this value is omitted or set to false, and if the
sink's parent is a project, then the value returned aswriter_identityis
the same group or service account used by Cloud Logging before the addition
of writer identities to this API. The sink's destination must be in the
same project as the sink itself.
If this field is set to true, or if the sink is owned by a non-project
resource such as an organization, then the value ofwriter_identitywill
be a unique service account used only for exports from the new sink. For
more information, seewriter_identityinLogSink.
Returns
Type
Description
bool
setUniqueWriterIdentity
Optional. Determines the kind of IAM identity returned aswriter_identityin the new sink. If this value is omitted or set to false, and if the
sink's parent is a project, then the value returned aswriter_identityis
the same group or service account used by Cloud Logging before the addition
of writer identities to this API. The sink's destination must be in the
same project as the sink itself.
If this field is set to true, or if the sink is owned by a non-project
resource such as an organization, then the value ofwriter_identitywill
be a unique service account used only for exports from the new sink. For
more information, seewriter_identityinLogSink.
Parameter
Name
Description
var
bool
Returns
Type
Description
$this
static::build
Parameters
Name
Description
parent
string
Required. The resource in which to create the sink:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Stackdriver Logging V2 Client - Class CreateSinkRequest (1.32.3)\n\nVersion latestkeyboard_arrow_down\n\n- [1.32.3 (latest)](/php/docs/reference/cloud-logging/latest/V2.CreateSinkRequest)\n- [1.32.2](/php/docs/reference/cloud-logging/1.32.2/V2.CreateSinkRequest)\n- [1.31.3](/php/docs/reference/cloud-logging/1.31.3/V2.CreateSinkRequest)\n- [1.30.3](/php/docs/reference/cloud-logging/1.30.3/V2.CreateSinkRequest)\n- [1.29.0](/php/docs/reference/cloud-logging/1.29.0/V2.CreateSinkRequest)\n- [1.28.5](/php/docs/reference/cloud-logging/1.28.5/V2.CreateSinkRequest)\n- [1.27.1](/php/docs/reference/cloud-logging/1.27.1/V2.CreateSinkRequest)\n- [1.26.0](/php/docs/reference/cloud-logging/1.26.0/V2.CreateSinkRequest)\n- [1.25.5](/php/docs/reference/cloud-logging/1.25.5/V2.CreateSinkRequest)\n- [1.24.10](/php/docs/reference/cloud-logging/1.24.10/V2.CreateSinkRequest) \nReference documentation and code samples for the Stackdriver Logging V2 Client class CreateSinkRequest.\n\nThe parameters to `CreateSink`.\n\nGenerated from protobuf message `google.logging.v2.CreateSinkRequest`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Logging \\\\ V2\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getParent\n\nRequired. The resource in which to create the sink:\n\"projects/\\[PROJECT_ID\\]\"\n\"organizations/\\[ORGANIZATION_ID\\]\"\n\"billingAccounts/\\[BILLING_ACCOUNT_ID\\]\"\n\"folders/\\[FOLDER_ID\\]\"\nFor examples:\n`\"projects/my-project\"`\n`\"organizations/123456789\"`\n\n### setParent\n\nRequired. The resource in which to create the sink:\n\"projects/\\[PROJECT_ID\\]\"\n\"organizations/\\[ORGANIZATION_ID\\]\"\n\"billingAccounts/\\[BILLING_ACCOUNT_ID\\]\"\n\"folders/\\[FOLDER_ID\\]\"\nFor examples:\n`\"projects/my-project\"`\n`\"organizations/123456789\"`\n\n### getSink\n\nRequired. The new sink, whose `name` parameter is a sink identifier that\nis not already in use.\n\n### hasSink\n\n### clearSink\n\n### setSink\n\nRequired. The new sink, whose `name` parameter is a sink identifier that\nis not already in use.\n\n### getUniqueWriterIdentity\n\nOptional. Determines the kind of IAM identity returned as `writer_identity`\nin the new sink. If this value is omitted or set to false, and if the\nsink's parent is a project, then the value returned as `writer_identity` is\nthe same group or service account used by Cloud Logging before the addition\nof writer identities to this API. The sink's destination must be in the\nsame project as the sink itself.\n\nIf this field is set to true, or if the sink is owned by a non-project\nresource such as an organization, then the value of `writer_identity` will\nbe a unique service account used only for exports from the new sink. For\nmore information, see `writer_identity` in\n[LogSink](/php/docs/reference/cloud-logging/latest/V2.LogSink).\n\n### setUniqueWriterIdentity\n\nOptional. Determines the kind of IAM identity returned as `writer_identity`\nin the new sink. If this value is omitted or set to false, and if the\nsink's parent is a project, then the value returned as `writer_identity` is\nthe same group or service account used by Cloud Logging before the addition\nof writer identities to this API. The sink's destination must be in the\nsame project as the sink itself.\n\nIf this field is set to true, or if the sink is owned by a non-project\nresource such as an organization, then the value of `writer_identity` will\nbe a unique service account used only for exports from the new sink. For\nmore information, see `writer_identity` in\n[LogSink](/php/docs/reference/cloud-logging/latest/V2.LogSink).\n\n### static::build"]]