MCPcopy Create free account
hub / github.com/awsdocs/aws-doc-sdk-examples / find

Method find

python/example_code/stepfunctions/activities.py:57–77  ·  view source on GitHub ↗

Find an activity by name. This requires listing activities until one is found with a matching name. :param name: The name of the activity to search for. :return: If found, the ARN of the activity; otherwise, None.

(self, name)

Source from the content-addressed store, hash-verified

55
56 # snippet-start:[python.example_code.sfn.ListActivities]
57 def find(self, name):
58 """
59 Find an activity by name. This requires listing activities until one is found
60 with a matching name.
61
62 :param name: The name of the activity to search for.
63 :return: If found, the ARN of the activity; otherwise, None.
64 """
65 try:
66 paginator = self.stepfunctions_client.get_paginator("list_activities")
67 for page in paginator.paginate():
68 for activity in page.get("activities", []):
69 if activity["name"] == name:
70 return activity["activityArn"]
71 except ClientError as err:
72 logger.error(
73 "Couldn't list activities. Here's why: %s: %s",
74 err.response["Error"]["Code"],
75 err.response["Error"]["Message"],
76 )
77 raise
78
79 # snippet-end:[python.example_code.sfn.ListActivities]
80

Callers 15

update_actionsFunction · 0.45
deploy-steps.jsFile · 0.45
signUpFunction · 0.45
findPolicyFunction · 0.45
findAutoScalingGroupFunction · 0.45
steps-demo.jsFile · 0.45
findLoadBalancerFunction · 0.45
findIdentityFunction · 0.45
findReceiptFilterFunction · 0.45
findReceiptRuleSetFunction · 0.45

Calls 1

getMethod · 0.45

Tested by 4

findReceiptFilterFunction · 0.36
findSAMLProviderFunction · 0.36
userInListUsersResponseFunction · 0.36
parseMessageCountsMethod · 0.36