stop_application.py - AWS Code Sample

stop_application.py

stop-application.py demonstrates how to stop a particular Kinesis Data Alanytics Application

# Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # This file is licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. A copy of the # License is located at # # http://aws.amazon.com/apache2.0/ # # This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS # OF ANY KIND, either express or implied. See the License for the specific # language governing permissions and limitations under the License. """ Usage: python stop_application.py appname """ import sys import boto3 from botocore.exceptions import ClientError ARGUMENTS = len(sys.argv) - 1 if ARGUMENTS < 1: print("You must supply an application name") else: APPLICATION_NAME = sys.argv[1] # Create kinesisanalyticsv2 client CLIENT = boto3.client('kinesisanalyticsv2') # Stop the Application try: RESP = CLIENT.stop_application( ApplicationName=APPLICATION_NAME ) print(RESP) except ClientError as client_error: print("Got the following error calling stop_application: {}".format(client_error))

Sample Details

Service: kinesisanalyticsv2

Last tested: 2019-10-04

Author: nprajilesh

Type: full-example