Helper method to return the deployment id matching the desired deployment label for
        this Swagger object based on the given api_name, swagger_file
199795
def _get_desired_deployment_id(self):
        '''
        
        '''
        deployments = __salt__['boto_apigateway.describe_api_deployments'](restApiId=self.restApiId,
                                                                           **self._common_aws_args).get('deployments')
        if deployments:
            for deployment in deployments:
                if deployment.get('description') == self.deployment_label_json:
                    return deployment.get('id')
        return ''
367454
def _get_entity_id_if_container_metric(self, labels):
        
        if CadvisorPrometheusScraperMixin._is_container_metric(labels):
            pod = self._get_pod_by_metric_label(labels)
            if is_static_pending_pod(pod):
                # If the pod is static, ContainerStatus is unavailable.
                # Return the pod UID so that we can collect metrics from it later on.
                return self._get_pod_uid(labels)
            return self._get_container_id(labels)
174376
def tag(self, deploy_tag=''):
        
        if APISettings.SECURE_TAGGING and deploy_tag == APISettings.GIT_ACTIVATE_PRE_TAG:
            if self.check_existens_of_staging_tag_in_remote_repo():
                pass
            else:
                Shell.fail('SECURE TAGGING is TRUE! That means, before you are able to create a production tag, ' \
                           'you need to deploy the software on a staging envirnment.')
                return False
        if self.__git_tag(self.create_git_version_tag(deploy_tag)):
            return True
        return False
1160694
def get_release_id(self, package_name: str, version: str) -> bytes:
        
        validate_package_name(package_name)
        validate_package_version(version)
        self._validate_set_registry()
        return self.registry._get_release_id(package_name, version)
1087095
def _api_group_for_type(cls):
    
    _groups = {
        (u"v1beta1", u"Deployment"): u"extensions",
        (u"v1beta1", u"DeploymentList"): u"extensions",
        (u"v1beta1", u"ReplicaSet"): u"extensions",
        (u"v1beta1", u"ReplicaSetList"): u"extensions",
    }
    key = (
        cls.apiVersion,
        cls.__name__.rsplit(u".")[-1],
    )
    group = _groups.get(key, None)
    return group
719181
def app_model_id(obj):
    
    ct = ContentType.objects.get_for_model(obj)

    return '%s-%s-%s' % (ct.app_label, ct.model, obj.id)
53449
def describe_api_deployment(restApiId, deploymentId, region=None, key=None, keyid=None, profile=None):
    '''
    

    '''
    try:
        conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
        deployment = conn.get_deployment(restApiId=restApiId, deploymentId=deploymentId)
        return {'deployment': _convert_datetime_str(deployment)}
    except ClientError as e:
        return {'error': __utils__['boto3.get_error'](e)}
1118963
def get_data_urls(deployment_name,
                  endpoint_type='juttle',
                  token_manager=None,
                  app_url=defaults.APP_URL):
    
    deployment_details = deployments.get_deployment_details(deployment_name,
                                                            token_manager=token_manager,
                                                            app_url=app_url)

    # use a random juttle endpoint
    data_urls = []
    for endpoint in deployment_details['endpoints']:
        if endpoint_type in endpoint['type']:
            data_urls.append(endpoint['uri'])

    if len(data_urls) == 0:
        raise JutException('No data engine currently configured for '
                           'deployment "%s"' % deployment_name)

    return data_urls
1120668
def api_url(self):
        ''''''
        return pathjoin(Request.path, self.id, url=self.bin.api_url)
917287
def get_import_data_url(deployment_name,
                        token_manager=None,
                        app_url=defaults.APP_URL):
    
    return get_data_url(deployment_name,
                        endpoint_type='http-import',
                        app_url=app_url,
                        token_manager=token_manager)
385058
def method_id(self, api_info):
    """"""
    # This is done here for now because at __init__ time, the method is known
    # but not the api, and thus not the api name.  Later, in
    # ApiConfigGenerator.__method_descriptor, the api name is known.
    if api_info.resource_name:
      resource_part = '.%s' % self.__safe_name(api_info.resource_name)
    else:
      resource_part = ''
    return '%s%s.%s' % (self.__safe_name(api_info.name), resource_part,
                        self.__safe_name(self.name))
688233
def _get_deployment_instance_summary(awsclient, deployment_id, instance_id):
    
    client_codedeploy = awsclient.get_client('codedeploy')
    request = {
        'deploymentId': deployment_id,
        'instanceId': instance_id
    }
    response = client_codedeploy.get_deployment_instance(**request)
    return response['instanceSummary']['status'], \
           response['instanceSummary']['lifecycleEvents'][-1]['lifecycleEventName']
186714
def get_api_id(self):
        
        logger.debug('Connecting to AWS apigateway API')
        conn = client('apigateway')
        apis = conn.get_rest_apis()
        api_id = None
        for api in apis['items']:
            if api['name'] == self.config.func_name:
                api_id = api['id']
                logger.debug('Found API id: %s', api_id)
                break
        if api_id is None:
            raise Exception('Unable to find ReST API named %s' %
                            self.config.func_name)
        return api_id
811898
private String getArtifactIdFromName(PhpPackage phpPackage) {
        String artifactId = null;
        if (StringUtils.isNotBlank(phpPackage.getName())) {
            String packageName = phpPackage.getName();
            String[] gavCoordinates = packageName.split(FORWARD_SLASH);
            artifactId = gavCoordinates[1];
        }
        return artifactId;
    }
76637
function getUid() {

    if (opts.deploy) {
        // get the deploy repo location
        return promisedSpawn(
            ['git', 'config', 'deploy.dir'],
            {
                capture: true,
                errMessage: 'You must set the location of the deploy repo!\n' +
                    'Use git config deploy.dir /full/path/to/deploy/dir'
            }
        ).then((dir) => {
            opts.dir = dir;
            // make sure that the dir exists and it is a git repo
            return fs.statAsync(`${dir}/.git`);
        }).then((stat) => {
            opts.uid = stat.uid;
            opts.gid = stat.gid;
        }).catch(() => {
            console.error(`ERROR: The deploy repo dir ${opts.dir} does not exist or is not a git repo!`);
            process.exit(3);
        });
    }

    // get the uid/gid from statting package.json
    return fs.statAsync('package.json')
    .then((stat) => {
        opts.uid = stat.uid;
        opts.gid = stat.gid;
    }).catch(() => {
        console.error('ERROR: package.json does not exist!');
        process.exit(4);
    });
}
730592
def get_package_id(self, name):
        
        json_scheme = self.gen_def_json_scheme('GetPreConfiguredPackages', dict(HypervisorType=4))
        json_obj = self.call_method_post(method='GetPreConfiguredPackages ', json_scheme=json_scheme)
        for package in json_obj['Value']:
            packageId  = package['PackageID']
            for description in package['Descriptions']:
                languageID = description['LanguageID']
                packageName = description['Text']
                if languageID == 2 and packageName.lower() == name.lower():
                    return packageId
706725
public static String pathNameOfDeployment(final DeploymentUnit deploymentUnit, final JBossWebMetaData metaData) {
		String pathName;
		if (metaData.getContextRoot() == null) {
			final EEModuleDescription description = deploymentUnit
					.getAttachment(org.jboss.as.ee.component.Attachments.EE_MODULE_DESCRIPTION);
			if (description != null) {
				// if there is an EEModuleDescription we need to take into
				// account that the module name may have been
				// overridden
				pathName = "/" + description.getModuleName();
			} else {
				pathName = "/" + deploymentUnit.getName().substring(0, deploymentUnit.getName().length() - 4);
			}
		} else {
			pathName = metaData.getContextRoot();
			if (pathName.length() > 0 && pathName.charAt(0) != '/') {
				pathName = "/" + pathName;
			}
		}
		return pathName;
	}