Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite3bc89e

Browse files
docs(samples): Update Region Tags (#1128)
1 parent2b35e65 commite3bc89e

File tree

2 files changed

+27
-27
lines changed

2 files changed

+27
-27
lines changed

‎samples/snippets/publisher.py‎

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def create_topic(project_id: str, topic_id: str) -> None:
6060
# [END pubsub_create_topic]
6161

6262

63-
defcreate_topic_kinesis_ingestion(
63+
defcreate_topic_with_kinesis_ingestion(
6464
project_id:str,
6565
topic_id:str,
6666
stream_arn:str,
@@ -69,7 +69,7 @@ def create_topic_kinesis_ingestion(
6969
gcp_service_account:str,
7070
)->None:
7171
"""Create a new Pub/Sub topic with AWS Kinesis Ingestion Settings."""
72-
# [STARTpubsub_create_topic_kinesis_ingestion]
72+
# [STARTpubsub_create_topic_with_kinesis_ingestion]
7373
fromgoogle.cloudimportpubsub_v1
7474
fromgoogle.pubsub_v1.typesimportTopic
7575
fromgoogle.pubsub_v1.typesimportIngestionDataSourceSettings
@@ -100,10 +100,10 @@ def create_topic_kinesis_ingestion(
100100
topic=publisher.create_topic(request=request)
101101

102102
print(f"Created topic:{topic.name} with AWS Kinesis Ingestion Settings")
103-
# [ENDpubsub_create_topic_kinesis_ingestion]
103+
# [ENDpubsub_create_topic_with_kinesis_ingestion]
104104

105105

106-
defupdate_topic_kinesis_ingestion(
106+
defupdate_topic_type(
107107
project_id:str,
108108
topic_id:str,
109109
stream_arn:str,
@@ -112,7 +112,7 @@ def update_topic_kinesis_ingestion(
112112
gcp_service_account:str,
113113
)->None:
114114
"""Update Pub/Sub topic with AWS Kinesis Ingestion Settings."""
115-
# [STARTpubsub_update_topic_kinesis_ingestion]
115+
# [STARTpubsub_update_topic_type]
116116
fromgoogle.cloudimportpubsub_v1
117117
fromgoogle.pubsub_v1.typesimportTopic
118118
fromgoogle.pubsub_v1.typesimportIngestionDataSourceSettings
@@ -149,7 +149,7 @@ def update_topic_kinesis_ingestion(
149149
print(f"Updated topic:{topic.name} with AWS Kinesis Ingestion Settings")
150150

151151

152-
# [ENDpubsub_update_topic_kinesis_ingestion]
152+
# [ENDpubsub_update_topic_type]
153153

154154

155155
defdelete_topic(project_id:str,topic_id:str)->None:
@@ -522,23 +522,23 @@ def detach_subscription(project_id: str, subscription_id: str) -> None:
522522
create_parser=subparsers.add_parser("create",help=create_topic.__doc__)
523523
create_parser.add_argument("topic_id")
524524

525-
create_topic_kinesis_ingestion_parser=subparsers.add_parser(
526-
"create_kinesis_ingestion",help=create_topic_kinesis_ingestion.__doc__
525+
create_topic_with_kinesis_ingestion_parser=subparsers.add_parser(
526+
"create_kinesis_ingestion",help=create_topic_with_kinesis_ingestion.__doc__
527527
)
528-
create_topic_kinesis_ingestion_parser.add_argument("topic_id")
529-
create_topic_kinesis_ingestion_parser.add_argument("stream_arn")
530-
create_topic_kinesis_ingestion_parser.add_argument("consumer_arn")
531-
create_topic_kinesis_ingestion_parser.add_argument("aws_role_arn")
532-
create_topic_kinesis_ingestion_parser.add_argument("gcp_service_account")
533-
534-
update_topic_kinesis_ingestion_parser=subparsers.add_parser(
535-
"update_kinesis_ingestion",help=update_topic_kinesis_ingestion.__doc__
528+
create_topic_with_kinesis_ingestion_parser.add_argument("topic_id")
529+
create_topic_with_kinesis_ingestion_parser.add_argument("stream_arn")
530+
create_topic_with_kinesis_ingestion_parser.add_argument("consumer_arn")
531+
create_topic_with_kinesis_ingestion_parser.add_argument("aws_role_arn")
532+
create_topic_with_kinesis_ingestion_parser.add_argument("gcp_service_account")
533+
534+
update_topic_type_parser=subparsers.add_parser(
535+
"update_kinesis_ingestion",help=update_topic_type.__doc__
536536
)
537-
update_topic_kinesis_ingestion_parser.add_argument("topic_id")
538-
update_topic_kinesis_ingestion_parser.add_argument("stream_arn")
539-
update_topic_kinesis_ingestion_parser.add_argument("consumer_arn")
540-
update_topic_kinesis_ingestion_parser.add_argument("aws_role_arn")
541-
update_topic_kinesis_ingestion_parser.add_argument("gcp_service_account")
537+
update_topic_type_parser.add_argument("topic_id")
538+
update_topic_type_parser.add_argument("stream_arn")
539+
update_topic_type_parser.add_argument("consumer_arn")
540+
update_topic_type_parser.add_argument("aws_role_arn")
541+
update_topic_type_parser.add_argument("gcp_service_account")
542542

543543
delete_parser=subparsers.add_parser("delete",help=delete_topic.__doc__)
544544
delete_parser.add_argument("topic_id")
@@ -601,7 +601,7 @@ def detach_subscription(project_id: str, subscription_id: str) -> None:
601601
elifargs.command=="create":
602602
create_topic(args.project_id,args.topic_id)
603603
elifargs.command=="create_kinesis_ingestion":
604-
create_topic_kinesis_ingestion(
604+
create_topic_with_kinesis_ingestion(
605605
args.project_id,
606606
args.topic_id,
607607
args.stream_arn,
@@ -610,7 +610,7 @@ def detach_subscription(project_id: str, subscription_id: str) -> None:
610610
args.gcp_service_account,
611611
)
612612
elifargs.command=="update_kinesis_ingestion":
613-
update_topic_kinesis_ingestion(
613+
update_topic_type(
614614
args.project_id,
615615
args.topic_id,
616616
args.stream_arn,

‎samples/snippets/publisher_test.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def test_create(
127127
publisher_client.delete_topic(request={"topic":topic_path})
128128

129129

130-
deftest_create_kinesis_ingestion(
130+
deftest_create_topic_with_kinesis_ingestion(
131131
publisher_client:pubsub_v1.PublisherClient,capsys:CaptureFixture[str]
132132
)->None:
133133
# The scope of `topic_path` is limited to this function.
@@ -146,7 +146,7 @@ def test_create_kinesis_ingestion(
146146
exceptNotFound:
147147
pass
148148

149-
publisher.create_topic_kinesis_ingestion(
149+
publisher.create_topic_with_kinesis_ingestion(
150150
PROJECT_ID,
151151
TOPIC_ID,
152152
stream_arn,
@@ -162,7 +162,7 @@ def test_create_kinesis_ingestion(
162162
publisher_client.delete_topic(request={"topic":topic_path})
163163

164164

165-
deftest_update_kinesis_ingestion(
165+
deftest_update_topic_type(
166166
publisher_client:pubsub_v1.PublisherClient,capsys:CaptureFixture[str]
167167
)->None:
168168
# The scope of `topic_path` is limited to this function.
@@ -186,7 +186,7 @@ def test_update_kinesis_ingestion(
186186
out,_=capsys.readouterr()
187187
assertf"Created topic:{topic_path}"inout
188188

189-
publisher.update_topic_kinesis_ingestion(
189+
publisher.update_topic_type(
190190
PROJECT_ID,
191191
TOPIC_ID,
192192
stream_arn,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp