< Back
New-GcpsSubscription
Post
NAME New-GcpsSubscription
SYNOPSIS
Creates a new Google Cloud PubSub subscription.
SYNTAX
New-GcpsSubscription [-Project <string>] [-Subscription] <string> [-Topic] <string> [-AckDeadline <int>]
[-PushEndpoint <string>] [<CommonParameters>]
DESCRIPTION
Creates a new Google Cloud PubSub subscription. Will raise errors if the subscription already exist. The cmdlet
will create the subscription in the default project if -Project is not used. Subscription created will default to
pull mode if -PushEndPoint is not used.
PARAMETERS
-Project <string>
The project to create the subscription in. If not set via PowerShell parameter processing, will default to the
Cloud SDK's DefaultProject property.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Subscription <string>
The name of the subscription to be created. Subscription must not exist.
Required? true
Position? 0
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Name <string>
The name of the subscription to be created. Subscription must not exist.
This is an alias of the Subscription parameter.
Required? true
Position? 0
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Topic <string>
The name of the topic that the subscription belongs to.
Required? true
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
-AckDeadline <int>
The number of seconds after delivery, during which the subscriber must acknowledge the receipt of a pull or
push message. By default, the deadline is 10 seconds.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-PushEndpoint <string>
A URL locating the endpoint to which messages should be pushed. For example, a Webhook endpoint might use
"https://example.com/push".
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
---------- EXAMPLE 1 ----------
PS C:\\> New-GcpsSubscription -Topic "my-topic" -Subscription "my-subscription"
This command creates a new subscription called "my-subscription" that subscribes to "my-topic" in the default
project.
---------- EXAMPLE 2 ----------
PS C:\\> New-GcpsTopic -Topic "my-topic" -Subscription "my-subscription" -Project "my-project" -AckDeadline 30
This command creates a new subscription called "my-subscription" that subscribes to "my-topic" in the "my-project"
project with an acknowledgement deadline of 30s.
---------- EXAMPLE 3 ----------
PS C:\\> New-GcpsTopic -Topic "my-topic" `
-Subscription "my-subscription" `
-PushEndpoint https://www.example.com/push `
This command creates a new subscription called "my-subscription" that subscribes to "my-topic" in the "my-project"
project with a push endpoint at https://www.example.com/push and the attribute "x-goog-version" of the endpoint
set to "v1beta".
RELATED LINKS
[Subscription] (https://cloud.google.com/pubsub/docs/su ... scriptions)
[Push Config] (https://cloud.google.com/pubsub/docs/re ... PushConfig)
[Ack Deadline] (https://cloud.google.com/pubsub/docs/su ... k_deadline)
SYNOPSIS
Creates a new Google Cloud PubSub subscription.
SYNTAX
New-GcpsSubscription [-Project <string>] [-Subscription] <string> [-Topic] <string> [-AckDeadline <int>]
[-PushEndpoint <string>] [<CommonParameters>]
DESCRIPTION
Creates a new Google Cloud PubSub subscription. Will raise errors if the subscription already exist. The cmdlet
will create the subscription in the default project if -Project is not used. Subscription created will default to
pull mode if -PushEndPoint is not used.
PARAMETERS
-Project <string>
The project to create the subscription in. If not set via PowerShell parameter processing, will default to the
Cloud SDK's DefaultProject property.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Subscription <string>
The name of the subscription to be created. Subscription must not exist.
Required? true
Position? 0
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Name <string>
The name of the subscription to be created. Subscription must not exist.
This is an alias of the Subscription parameter.
Required? true
Position? 0
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Topic <string>
The name of the topic that the subscription belongs to.
Required? true
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
-AckDeadline <int>
The number of seconds after delivery, during which the subscriber must acknowledge the receipt of a pull or
push message. By default, the deadline is 10 seconds.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-PushEndpoint <string>
A URL locating the endpoint to which messages should be pushed. For example, a Webhook endpoint might use
"https://example.com/push".
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
---------- EXAMPLE 1 ----------
PS C:\\> New-GcpsSubscription -Topic "my-topic" -Subscription "my-subscription"
This command creates a new subscription called "my-subscription" that subscribes to "my-topic" in the default
project.
---------- EXAMPLE 2 ----------
PS C:\\> New-GcpsTopic -Topic "my-topic" -Subscription "my-subscription" -Project "my-project" -AckDeadline 30
This command creates a new subscription called "my-subscription" that subscribes to "my-topic" in the "my-project"
project with an acknowledgement deadline of 30s.
---------- EXAMPLE 3 ----------
PS C:\\> New-GcpsTopic -Topic "my-topic" `
-Subscription "my-subscription" `
-PushEndpoint https://www.example.com/push `
This command creates a new subscription called "my-subscription" that subscribes to "my-topic" in the "my-project"
project with a push endpoint at https://www.example.com/push and the attribute "x-goog-version" of the endpoint
set to "v1beta".
RELATED LINKS
[Subscription] (https://cloud.google.com/pubsub/docs/su ... scriptions)
[Push Config] (https://cloud.google.com/pubsub/docs/re ... PushConfig)
[Ack Deadline] (https://cloud.google.com/pubsub/docs/su ... k_deadline)