def _get_solution_stack(): solution_string = commonops.get_default_solution_stack() soln_stk = None # Test out sstack and tier before we ask any questions (Fast Fail) if solution_string: if PlatformVersion.is_valid_arn(solution_string): try: elasticbeanstalk.describe_platform_version(solution_string)['PlatformDescription'] except NotFoundError: raise NotFoundError('Platform arn %s does not appear to be valid' % solution_string) soln_stk = PlatformVersion(solution_string) else: try: soln_stk = commonops.get_solution_stack(solution_string) except NotFoundError: raise NotFoundError('Solution stack ' + solution_string + ' does not appear to be valid') LOG.debug(soln_stk) if soln_stk is None: raise NotInitializedError else: return soln_stk
def get_solution_stack(self): # Get solution stack from command line arguments solution_string = self.app.pargs.platform # Get solution stack from config file, if exists if not solution_string: try: solution_string = commonops.get_default_solution_stack() except NotInitializedError: solution_string = None # Validate that the platform exists if solution_string: if is_platform_arn(solution_string): elasticbeanstalk.describe_platform_version(solution_string) else: commonops.get_solution_stack(solution_string) return solution_string
def _get_platform(platform_name, platform_version, owner=None): platforms = elasticbeanstalk.list_platform_versions( platform_name=platform_name, platform_version=platform_version, owner=owner) for platform in platforms: arn = platform['PlatformArn'] return elasticbeanstalk.describe_platform_version( arn)['PlatformDescription'] return None
def platform_arn_to_solution_stack(platform_arn): """ Method determines the EB-managed solution stack represented by a PlatformArn :param platform_arn: PlatformArn of a solution stack :return: SolutionStack representing the PlatformArn if it an EB-managed platform, otherwise None """ if not PlatformVersion.is_eb_managed_platform_arn(platform_arn): return platform_description = elasticbeanstalk.describe_platform_version(platform_arn) return SolutionStack(platform_description['SolutionStackName'])
def describe_custom_platform_version(owner=None, platform_arn=None, platform_name=None, platform_version=None, status=None): if not platform_arn: platforms = list_custom_platform_versions( platform_name=platform_name, platform_version=platform_version, status=status) platform_arn = platforms[0] return elasticbeanstalk.describe_platform_version(platform_arn)
def describe_custom_platform_version( owner=None, platform_arn=None, platform_name=None, platform_version=None, status=None ): if not platform_arn: platforms = list_custom_platform_versions( platform_name=platform_name, platform_version=platform_version, status=status ) platform_arn = platforms[0] return elasticbeanstalk.describe_platform_version(platform_arn)