app/RancherAccess/RancherService.php
private function getStackIdByName($stackName) {
		$url = implode('/', [
			$this->account->getUrl(),
			'environments'
		]);

		$headers = [];
		$this->addAuthHeader($headers);

		$jsonData = $this->apiService->get($url, $headers);
		$data = json_decode($jsonData, true);
		if( !array_key_exists('data', $data) )
			throw new MissingDataException('data', array_keys($data) );
		$stacks = $data['data'];

		try {
			$stack = $this->byNameService->findName($stacks, $stackName);
			return $stack['id'];
		} catch(NameNotFoundException $e) {
			throw new StackNotFoundException($stackName, 11);
		}

	}
private function getStackIdByName($stackName) {
		$url = implode('/', [
			$this->account->getUrl(),
			'environments'
		]);

		$headers = [];
		$this->addAuthHeader($headers);

		$jsonData = $this->apiService->get($url, $headers);
		$data = json_decode($jsonData, true);
		if( !array_key_exists('data', $data) )
			throw new MissingDataException('data', array_keys($data) );
		$stacks = $data['data'];

		try {
			$stack = $this->byNameService->findName($stacks, $stackName);
			return $stack['id'];
		} catch(NameNotFoundException $e) {
			throw new StackNotFoundException($stackName, 11);
		}

	}
private function getStackIdByName ( $ stackName ) { $ url = implode ( '/' , [ $ this -> account -> getUrl ( ) , 'environments' ] ) ; $ headers = [ ] ; $ this -> addAuthHeader ( $ headers ) ; $ jsonData = $ this -> apiService -> get ( $ url , $ headers ) ; $ data = json_decode ( $ jsonData , true ) ; if ( ! array_key_exists ( 'data' , $ data ) ) throw new MissingDataException ( 'data' , array_keys ( $ data ) ) ; $ stacks = $ data [ 'data' ] ; try { $ stack = $ this -> byNameService -> findName ( $ stacks , $ stackName ) ; return $ stack [ 'id' ] ; } catch ( NameNotFoundException $ e ) { throw new StackNotFoundException ( $ stackName , 11 ) ; } }
Translate the given Stackname into an id.
Throws StackNotFoundException if no matching stack was found

@param $stackName
@return string
@throws StackNotFoundException
Translate the given Stackname into an id . Throws StackNotFoundException if no matching stack was found