PATH:
usr
/
local
/
jetapps
/
var
/
lib
/
aws
/
lib
/
python2.7
/
site-packages
/
awscli
/
customizations
# Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # 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/ # # or in the "license" file accompanying this file. 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. from awscli.customizations.commands import BasicCommand from awscli.customizations.utils import create_client_from_parsed_globals from base64 import b64decode import sys def register_ecr_commands(cli): cli.register('building-command-table.ecr', _inject_get_login) def _inject_get_login(command_table, session, **kwargs): command_table['get-login'] = ECRLogin(session) class ECRLogin(BasicCommand): """Log in with docker login""" NAME = 'get-login' DESCRIPTION = BasicCommand.FROM_FILE('ecr/get-login_description.rst') ARG_TABLE = [ { 'name': 'registry-ids', 'help_text': 'A list of AWS account IDs that correspond to the ' 'Amazon ECR registries that you want to log in to.', 'required': False, 'nargs': '+' }, { 'name': 'include-email', 'action': 'store_true', 'group_name': 'include-email', 'dest': 'include_email', 'default': True, 'required': False, 'help_text': ( "Specify if the '-e' flag should be included in the " "'docker login' command. The '-e' option has been deprecated " "and is removed in docker version 17.06 and later. You must " "specify --no-include-email if you're using docker version " "17.06 or later. The default behavior is to include the " "'-e' flag in the 'docker login' output."), }, { 'name': 'no-include-email', 'help_text': 'Include email arg', 'action': 'store_false', 'default': True, 'group_name': 'include-email', 'dest': 'include_email', 'required': False, }, ] def _run_main(self, parsed_args, parsed_globals): ecr_client = create_client_from_parsed_globals( self._session, 'ecr', parsed_globals) if not parsed_args.registry_ids: result = ecr_client.get_authorization_token() else: result = ecr_client.get_authorization_token( registryIds=parsed_args.registry_ids) for auth in result['authorizationData']: auth_token = b64decode(auth['authorizationToken']).decode() username, password = auth_token.split(':') command = ['docker', 'login', '-u', username, '-p', password] if parsed_args.include_email: command.extend(['-e', 'none']) command.append(auth['proxyEndpoint']) sys.stdout.write(' '.join(command)) sys.stdout.write('\n') return 0
[-] codecommit.py
[edit]
[+]
eks
[-] iamvirtmfa.py
[edit]
[-] cloudsearchdomain.pyc
[edit]
[-] commands.py
[edit]
[-] opsworks.py
[edit]
[-] awslambda.py
[edit]
[-] scalarparse.py
[edit]
[-] utils.pyc
[edit]
[-] sagemaker.pyc
[edit]
[-] codecommit.pyc
[edit]
[-] ecr.py
[edit]
[-] cliinputjson.py
[edit]
[-] arguments.py
[edit]
[-] sessendemail.pyc
[edit]
[+]
configservice
[-] assumerole.py
[edit]
[-] route53.pyc
[edit]
[+]
datapipeline
[-] s3uploader.py
[edit]
[+]
servicecatalog
[-] commands.pyc
[edit]
[+]
..
[-] s3endpoint.py
[edit]
[-] argrename.py
[edit]
[-] translate.py
[edit]
[-] argrename.pyc
[edit]
[-] cliinputjson.pyc
[edit]
[-] kms.pyc
[edit]
[-] iot.py
[edit]
[-] ecr.pyc
[edit]
[-] generatecliskeleton.pyc
[edit]
[-] awslambda.pyc
[edit]
[-] iot_data.py
[edit]
[-] cloudsearch.py
[edit]
[-] streamingoutputarg.pyc
[edit]
[-] __init__.pyc
[edit]
[-] rds.py
[edit]
[-] preview.pyc
[edit]
[-] paginate.pyc
[edit]
[-] removals.py
[edit]
[-] arguments.pyc
[edit]
[-] rekognition.pyc
[edit]
[-] addexamples.py
[edit]
[-] globalargs.py
[edit]
[-] s3events.py
[edit]
[-] cloudsearch.pyc
[edit]
[-] toplevelbool.pyc
[edit]
[-] iot.pyc
[edit]
[+]
cloudtrail
[+]
configure
[+]
gamelift
[-] globalargs.pyc
[edit]
[-] cloudfront.py
[edit]
[-] streamingoutputarg.py
[edit]
[-] cloudsearchdomain.py
[edit]
[-] utils.py
[edit]
[-] opsworkscm.pyc
[edit]
[-] sagemaker.py
[edit]
[-] sessionmanager.py
[edit]
[+]
ecs
[+]
cloudformation
[-] s3errormsg.pyc
[edit]
[+]
history
[-] s3endpoint.pyc
[edit]
[-] opsworkscm.py
[edit]
[+]
ec2
[-] s3errormsg.py
[edit]
[+]
dlm
[-] scalarparse.pyc
[edit]
[-] putmetricdata.pyc
[edit]
[-] rekognition.py
[edit]
[-] addexamples.pyc
[edit]
[-] sessendemail.py
[edit]
[-] translate.pyc
[edit]
[-] s3events.pyc
[edit]
[-] rds.pyc
[edit]
[-] flatten.py
[edit]
[-] flatten.pyc
[edit]
[-] sessionmanager.pyc
[edit]
[-] __init__.py
[edit]
[-] paginate.py
[edit]
[-] removals.pyc
[edit]
[-] assumerole.pyc
[edit]
[+]
s3
[-] route53.py
[edit]
[-] putmetricdata.py
[edit]
[-] waiters.py
[edit]
[-] generatecliskeleton.py
[edit]
[-] waiters.pyc
[edit]
[-] mturk.py
[edit]
[-] sms_voice.py
[edit]
[-] mturk.pyc
[edit]
[-] kms.py
[edit]
[-] s3uploader.pyc
[edit]
[-] preview.py
[edit]
[-] iamvirtmfa.pyc
[edit]
[-] sms_voice.pyc
[edit]
[-] opsworks.pyc
[edit]
[+]
emr
[-] iot_data.pyc
[edit]
[+]
codedeploy
[-] toplevelbool.py
[edit]
[-] cloudfront.pyc
[edit]