diff --git a/.gitignore b/.gitignore index 429d98b..79ddf3e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /vendor /*.phar /*.iml +composer.lock diff --git a/README.md b/README.md index ddcb02b..f211fed 100644 --- a/README.md +++ b/README.md @@ -125,28 +125,78 @@ With `cf-helper-php` you can say that you are in development and app will do the Simulate CloudFoundry environment --------------------------------- -You can half simulate a CloudFoudry environment by using a `manifest.yml`, your environment variable from manifest will be set in `$_ENV`. -You can also add simulate service by adding a key called `serviceSimulate` in your `manifest.yml`, example: - -```yml -#manifest.yml ---- -#manifest -applications: - - name: test - memory: 1G - env: - MYAPP_APP_DIR: /home/vcap/app - MYAPP_LOGS_DIR: /logs_dir -serviceSimulate: - DATABASE: {"host": "localhost", "username": "jojo", "password": "toto", "port": "3306"} # a service database will be accessible, prefer writing with {'key": 'value'} to simplify your cups command +You can simulate a CloudFoudry environment by using a `vcap.json`, your environment variable from manifest will be set in `$_ENV`. This JSON format will mimic what you would find in VCAP_APPLICATION and VCAP_SERVICES, with the addition of an 'ENV' parameter to add environment variables. + +```json +{ + "VCAP_SERVICES": { + "user-provided": [ + { + "label": "user-provided", + "name": "managed-ELK-logging", + "tags": [], + "instance_name": "managed-ELK-logging", + "binding_name": null, + "credentials": {}, + "syslog_drain_url": "syslog://tcplogs-epg.localdomain:5000", + "volume_mounts": [] + } + ], + "p.redis": [ + { + "label": "p.redis", + "provider": null, + "plan": "cache-large", + "name": "redis-sessions", + "tags": [ + "redis", + "pivotal", + "on-demand" + ], + "instance_name": "redis-sessions", + "binding_name": null, + "credentials": { + "host": "q-s0.redis-instance.svc-dmd.service-instance-8e8fb07f-9c0b-4313-8748-0cf61f0ee989.bosh", + "password": "redispassword", + "port": 6379 + }, + "syslog_drain_url": null, + "volume_mounts": [] + } + ] + }, + "VCAP_APPLICATION": { + "cf_api": "https://api.sys.pcf.localdomain", + "limits": { + "fds": 16384 + }, + "application_name": "api-active", + "application_uris": [ + "api-qa.apps.pcf.localdomain" + ], + "name": "api-active", + "space_name": "epg02-qa", + "space_id": "d3325332-9abb-4136-9232-f7e244f51817", + "organization_id": "4fe703b7-199c-4a63-aaa9-6261de724641", + "organization_name": "epg02-local-team", + "uris": [ + "api-qa.apps.pcf.localdomain" + ], + "users": null, + "application_id": "8bee55d9-5f5c-4d70-88a7-f1c159d9652e" + }, + "ENV": { + "APPLICATION_VERSION": "1.0.0" + } +} + ``` To run CloudFoundry simulation simply do: ```php -$cfHelper->simulateCloudFoundry(); //it use manifest.yml which is in the same folder where this script is called -//to set another manifest.yml: -$cfHelper->simulateCloudFoundry("your_manifest.yml); +$cfHelper->simulateCloudFoundry(); //it use vcap.json which is in the same folder where this script is called +//to set another vcap.json: +$cfHelper->simulateCloudFoundry("your_vcap.json"); ``` diff --git a/composer.json b/composer.json index 951d4b4..52b1836 100644 --- a/composer.json +++ b/composer.json @@ -25,6 +25,11 @@ "CfCommunity\\CfHelper\\": "src/CfCommunity/CfHelper/" } }, + "autoload-dev": { + "psr-4": { + "Test\\CfCommunity\\CfHelper\\": "tests/CfCommunity/CfHelper" + } + }, "suggest": { "predis/predis": "Let's you have a redis connection for RedisConnector", "mongodb/mongodb": "Use mongodb in for auto connection" diff --git a/src/CfCommunity/CfHelper/Application/ApplicationInfo.php b/src/CfCommunity/CfHelper/Application/ApplicationInfo.php index b424645..1e18c02 100644 --- a/src/CfCommunity/CfHelper/Application/ApplicationInfo.php +++ b/src/CfCommunity/CfHelper/Application/ApplicationInfo.php @@ -11,7 +11,6 @@ namespace CfCommunity\CfHelper\Application; - /** * Class ApplicationInfo * @package CfCommunity\CfHelper\Application @@ -38,13 +37,36 @@ class ApplicationInfo * @var int */ public $port; + /** + * @var string + */ + public $space_name; + /** + * @var string + */ + public $space_id; + /** + * @var string + */ + public $organization_name; + /** + * @var string + */ + public $organization_id; + /** + * @var string + */ + public $application_id; + /** + * @var object + */ + public $limits; /** * */ public function __construct() { - } @@ -128,4 +150,99 @@ public function setVersion($version) $this->version = $version; } -} \ No newline at end of file + /** + * @return string + */ + public function getSpaceName() + { + return $this->space_name; + } + + /** + * @param string $space_name + */ + public function setSpaceName(string $space_name) + { + $this->space_name = $space_name; + } + + /** + * @return string + */ + public function getSpaceId() + { + return $this->space_id; + } + + /** + * @param string $space_id + */ + public function setSpaceId(string $space_id) + { + $this->space_id = $space_id; + } + + /** + * @return string + */ + public function getOrganizationName() + { + return $this->organization_name; + } + + /** + * @param string $organization_name + */ + public function setOrganizationName(string $organization_name) + { + $this->organization_name = $organization_name; + } + + /** + * @return string + */ + public function getOrganizationId() + { + return $this->organization_id; + } + + /** + * @param string $organization_id + */ + public function setOrganizationId(string $organization_id) + { + $this->organization_id = $organization_id; + } + + /** + * @return string + */ + public function getApplicationId() + { + return $this->application_id; + } + + /** + * @param string $application_id + */ + public function setApplicationId(string $application_id) + { + $this->application_id = $application_id; + } + + /** + * @return object + */ + public function getLimits() + { + return $this->limits; + } + + /** + * @param object $limits + */ + public function setLimits(object $limits) + { + $this->limits = $limits; + } +} diff --git a/src/CfCommunity/CfHelper/CfHelper.php b/src/CfCommunity/CfHelper/CfHelper.php index 230fa3c..85ee9bf 100644 --- a/src/CfCommunity/CfHelper/CfHelper.php +++ b/src/CfCommunity/CfHelper/CfHelper.php @@ -32,7 +32,7 @@ */ class CfHelper { - const DETECT_CLOUDFOUNDRY = 'VCAP_APPLICATION'; + private const DETECT_CLOUDFOUNDRY = 'VCAP_APPLICATION'; private $serviceManager; @@ -46,6 +46,11 @@ class CfHelper */ private $connectorsState = array(); + /** + * CfHelper constructor. + * @param ServiceManager|null $serviceManager + * @throws ConnectorNotUniqException + */ public function __construct(ServiceManager $serviceManager = null) { if (empty($serviceManager)) { @@ -57,6 +62,10 @@ public function __construct(ServiceManager $serviceManager = null) $this->addConnector(new RedisConnector()); } + /** + * @param Connector $connector + * @throws ConnectorNotUniqException + */ public function addConnector(Connector $connector) { if ($this->hasConnector($connector)) { @@ -105,11 +114,11 @@ public function getApplicationInfo() } /** - * @param string $manifestYml + * @param string $jsonFile */ - public function simulateCloudFoundry($manifestYml = "services.json") + public function simulateCloudFoundry($jsonFile = 'vcap.json') { - CloudFoundrySimulator::simulate($manifestYml); + CloudFoundrySimulator::simulate($jsonFile); } public function isInCloudFoundry() @@ -159,4 +168,4 @@ public function getConnector($name) } throw new ConnectorNotFoundException($name); } -} \ No newline at end of file +} diff --git a/src/CfCommunity/CfHelper/Connectors/AbstractUriConnector.php b/src/CfCommunity/CfHelper/Connectors/AbstractUriConnector.php index beea068..694ab6d 100644 --- a/src/CfCommunity/CfHelper/Connectors/AbstractUriConnector.php +++ b/src/CfCommunity/CfHelper/Connectors/AbstractUriConnector.php @@ -10,10 +10,8 @@ * Date: 18/03/2015 */ - namespace CfCommunity\CfHelper\Connectors; - use CfCommunity\CfHelper\Services\Service; use CfCommunity\CfHelper\Services\ServiceManager; @@ -83,6 +81,4 @@ public function getCredentials() { return $this->credentials; } - - } diff --git a/src/CfCommunity/CfHelper/Connectors/Connector.php b/src/CfCommunity/CfHelper/Connectors/Connector.php index b86aa4e..4545025 100644 --- a/src/CfCommunity/CfHelper/Connectors/Connector.php +++ b/src/CfCommunity/CfHelper/Connectors/Connector.php @@ -1,5 +1,4 @@ connection->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); } - function getName() + public function getName() { return "database"; } diff --git a/src/CfCommunity/CfHelper/Connectors/MongoDbConnector.php b/src/CfCommunity/CfHelper/Connectors/MongoDbConnector.php index f97434a..3aa5e3e 100644 --- a/src/CfCommunity/CfHelper/Connectors/MongoDbConnector.php +++ b/src/CfCommunity/CfHelper/Connectors/MongoDbConnector.php @@ -10,7 +10,6 @@ * Date: 18/03/2015 */ - namespace CfCommunity\CfHelper\Connectors; /** @@ -19,7 +18,6 @@ */ class MongoDbConnector extends AbstractUriConnector implements Connector { - /** * @var \MongoDB\Client; */ @@ -66,8 +64,8 @@ private function loadMongoDbConnection() $this->connection = new MongoDB\Client($this->credentials['url']); } - function getName() + public function getName() { return "mongoDb"; } -} \ No newline at end of file +} diff --git a/src/CfCommunity/CfHelper/Connectors/RedisConnector.php b/src/CfCommunity/CfHelper/Connectors/RedisConnector.php index 9824658..f10327d 100644 --- a/src/CfCommunity/CfHelper/Connectors/RedisConnector.php +++ b/src/CfCommunity/CfHelper/Connectors/RedisConnector.php @@ -10,7 +10,6 @@ * Date: 18/03/2015 */ - namespace CfCommunity\CfHelper\Connectors; use Predis\Client; @@ -68,8 +67,8 @@ private function loadRedisConnection() ]); } - function getName() + public function getName() { return "redis"; } -} \ No newline at end of file +} diff --git a/src/CfCommunity/CfHelper/Exception/ConnectorNotFoundException.php b/src/CfCommunity/CfHelper/Exception/ConnectorNotFoundException.php index b91d43e..fb7958e 100644 --- a/src/CfCommunity/CfHelper/Exception/ConnectorNotFoundException.php +++ b/src/CfCommunity/CfHelper/Exception/ConnectorNotFoundException.php @@ -1,6 +1,4 @@ getName() . " already exists."); } -} \ No newline at end of file +} diff --git a/src/CfCommunity/CfHelper/Services/Populator.php b/src/CfCommunity/CfHelper/Services/Populator.php index c76f193..9c51e95 100644 --- a/src/CfCommunity/CfHelper/Services/Populator.php +++ b/src/CfCommunity/CfHelper/Services/Populator.php @@ -19,31 +19,30 @@ */ interface Populator { - /** * @param $name * @return null|Service */ - function getService($name); + public function getService($name); /** * @param $tags * @return null|Service[] */ - function getServicesByTags($tags); + public function getServicesByTags($tags); /** * */ - function load(); + public function load(); /** * @return Service[] */ - function getAllServices(); + public function getAllServices(); /** * @return ApplicationInfo */ - function getApplicationInfo(); -} \ No newline at end of file + public function getApplicationInfo(); +} diff --git a/src/CfCommunity/CfHelper/Services/PopulatorCloudFoundry.php b/src/CfCommunity/CfHelper/Services/PopulatorCloudFoundry.php index d13de5d..23f9352 100644 --- a/src/CfCommunity/CfHelper/Services/PopulatorCloudFoundry.php +++ b/src/CfCommunity/CfHelper/Services/PopulatorCloudFoundry.php @@ -19,8 +19,8 @@ */ class PopulatorCloudFoundry implements Populator { - const VCAP_APPLICATION = 'VCAP_APPLICATION'; - const VCAP_SERVICES = 'VCAP_SERVICES'; + private const VCAP_APPLICATION = 'VCAP_APPLICATION'; + private const VCAP_SERVICES = 'VCAP_SERVICES'; /** * @var array */ @@ -50,7 +50,7 @@ class PopulatorCloudFoundry implements Populator * @param $servicesJson * @param $appJson */ - function __construct($servicesJson = null, $appJson = null) + public function __construct($servicesJson = null, $appJson = null) { if (empty($servicesJson)) { $servicesJson = getenv(self::VCAP_SERVICES); @@ -75,11 +75,11 @@ public function getService($name) return $this->services[$name]; } $service = $this->getServiceFirst($name); - if (!empty($service)) { + if ($service !== null) { return $service; } $service = $this->getServiceInside($name); - if (!empty($service)) { + if ($service !== null) { return $service; } return null; @@ -204,4 +204,4 @@ public function load() } $this->vcapServices = json_decode($this->servicesJson, true); } -} \ No newline at end of file +} diff --git a/src/CfCommunity/CfHelper/Services/PopulatorCloudFoundryTest.php b/src/CfCommunity/CfHelper/Services/PopulatorCloudFoundryTest.php deleted file mode 100644 index d5a0b7c..0000000 --- a/src/CfCommunity/CfHelper/Services/PopulatorCloudFoundryTest.php +++ /dev/null @@ -1,20 +0,0 @@ -name = $name; $this->values = $values ? $values : array(); @@ -178,5 +177,4 @@ public function setValue($key, $value) $this->values[$key] = $value; return $this; } - } diff --git a/src/CfCommunity/CfHelper/Services/ServiceManager.php b/src/CfCommunity/CfHelper/Services/ServiceManager.php index 79723fe..66f7687 100644 --- a/src/CfCommunity/CfHelper/Services/ServiceManager.php +++ b/src/CfCommunity/CfHelper/Services/ServiceManager.php @@ -51,7 +51,6 @@ public function setPopulator(Populator $populator) $this->populator->load(); } - /** * @param $name * @return null|Service @@ -90,4 +89,4 @@ public function getAllServices() { return $this->populator->getAllServices(); } -} \ No newline at end of file +} diff --git a/src/CfCommunity/CfHelper/Simulator/CloudFoundrySimulator.php b/src/CfCommunity/CfHelper/Simulator/CloudFoundrySimulator.php index 2329ffd..3002032 100644 --- a/src/CfCommunity/CfHelper/Simulator/CloudFoundrySimulator.php +++ b/src/CfCommunity/CfHelper/Simulator/CloudFoundrySimulator.php @@ -20,15 +20,15 @@ class CloudFoundrySimulator /** * */ - const KEY_SIMULATE_SERVICE = 'services'; + const VCAP_SERVICE = 'VCAP_SERVICES'; /** * */ - const KEY_SERVICE = 'VCAP_SERVICES'; + const VCAP_APPLICATION = 'VCAP_APPLICATION'; /** * */ - const KEY_APPLICATION = 'applications'; + const ENV = 'ENV'; /** * @param $servicesJson @@ -36,6 +36,7 @@ class CloudFoundrySimulator public static function simulate($servicesJson) { CloudFoundrySimulator::loadEnv($servicesJson); + CloudFoundrySimulator::loadApplication($servicesJson); CloudFoundrySimulator::loadService($servicesJson); } @@ -48,18 +49,29 @@ public static function loadEnv($servicesJson) return; } $fileContent = file_get_contents($servicesJson); - $manifestUnparse = json_decode($fileContent, true);; - $applications = $manifestUnparse[self::KEY_APPLICATION]; - if (empty($applications)) { + $json = json_decode($fileContent, true); + if (!isset($json[self::ENV])) { return; } + CloudFoundrySimulator::loadVarEnv($json[self::ENV]); + } + + /** + * @param $servicesJson + */ + public static function loadApplication($servicesJson) + { + if (!is_file($servicesJson)) { + return; + } + $fileContent = file_get_contents($servicesJson); + $json = json_decode($fileContent, true); - foreach ($applications as $application) { - if (empty($application['env'])) { - continue; - } - CloudFoundrySimulator::loadVarEnv($application['env']); + if (!isset($json[self::VCAP_APPLICATION])) { + return; } + + CloudFoundrySimulator::loadVarEnv(array(self::VCAP_APPLICATION => json_encode($json[self::VCAP_APPLICATION]))); } /** @@ -94,20 +106,11 @@ public static function loadService($servicesJson) return; } $fileContent = file_get_contents($servicesJson); - $manifestUnparse = json_decode($fileContent, true); - $services = $manifestUnparse[self::KEY_SIMULATE_SERVICE]; - if (empty($services)) { + $json = json_decode($fileContent, true); + + if (!isset($json[self::VCAP_SERVICE])) { return; } - foreach ($services as $serviceName => $serviceCredentials) { - $service = array( - "name" => $serviceName, - "label" => "user-provided", - "tags" => array(), - "credentials" => $serviceCredentials - ); - $serviceUserProvided = array(array("user-provided" => $service)); - CloudFoundrySimulator::loadVarEnv(array(self::KEY_SERVICE => json_encode($serviceUserProvided))); - } + CloudFoundrySimulator::loadVarEnv(array(self::VCAP_SERVICE => json_encode($json[self::VCAP_SERVICE]))); } -} +} diff --git a/tests/CfCommunity/CfHelper/Simulator/CloudFoundrySimulatorTest.php b/tests/CfCommunity/CfHelper/Simulator/CloudFoundrySimulatorTest.php new file mode 100644 index 0000000..9cfae49 --- /dev/null +++ b/tests/CfCommunity/CfHelper/Simulator/CloudFoundrySimulatorTest.php @@ -0,0 +1,31 @@ +getApplicationInfo()->getName()); + } +} diff --git a/tests/data/vcap.json b/tests/data/vcap.json new file mode 100644 index 0000000..5e80693 --- /dev/null +++ b/tests/data/vcap.json @@ -0,0 +1,287 @@ +{ + "VCAP_SERVICES": { + "user-provided": [ + { + "label": "user-provided", + "name": "managed-ELK-logging", + "tags": [], + "instance_name": "managed-ELK-logging", + "binding_name": null, + "credentials": {}, + "syslog_drain_url": "syslog://tcplogs-epg.localdomain:5000", + "volume_mounts": [] + } + ], + "p.redis": [ + { + "label": "p.redis", + "provider": null, + "plan": "cache-large", + "name": "redis-sessions", + "tags": [ + "redis", + "pivotal", + "on-demand" + ], + "instance_name": "redis-sessions", + "binding_name": null, + "credentials": { + "host": "q-s0.redis-instance.svc-dmd.service-instance-8e8fb07f-9c0b-4313-8748-0cf61f0ee989.bosh", + "password": "password", + "port": 6379 + }, + "syslog_drain_url": null, + "volume_mounts": [] + } + ], + "p-rabbitmq": [ + { + "label": "p-rabbitmq", + "provider": null, + "plan": "standard", + "name": "rabbitmq", + "tags": [ + "rabbitmq", + "rabbit", + "messaging", + "message-queue", + "amqp", + "mqtt", + "stomp" + ], + "instance_name": "rabbitmq", + "binding_name": null, + "credentials": { + "dashboard_url": "https://pivotal-rabbitmq.sys.pcf.localdomain/#/login/username/password", + "hostname": "10.212.51.23", + "hostnames": [ + "10.212.51.23", + "10.212.51.32" + ], + "http_api_uri": "https://username:password@pivotal-rabbitmq.sys.pcf.localdomain/api/", + "http_api_uris": [ + "https://username:password@pivotal-rabbitmq.sys.pcf.localdomain/api/" + ], + "password": "password", + "protocols": { + "amqp+ssl": { + "host": "10.212.51.23", + "hosts": [ + "10.212.51.23", + "10.212.51.32" + ], + "password": "password", + "port": 5671, + "ssl": true, + "uri": "amqps://username:password@10.212.51.23:5671/02867b2e-e57e-4259-b941-22af75f67246", + "uris": [ + "amqps://username:password@10.212.51.23:5671/02867b2e-e57e-4259-b941-22af75f67246", + "amqps://username:password@10.212.51.32:5671/02867b2e-e57e-4259-b941-22af75f67246" + ], + "username": "username", + "vhost": "02867b2e-e57e-4259-b941-22af75f67246" + }, + "management": { + "host": "10.212.51.23", + "hosts": [ + "10.212.51.23", + "10.212.51.32" + ], + "password": "password", + "path": "/api/", + "port": 15672, + "ssl": false, + "uri": "http://username:password@10.212.51.23:15672/api/", + "uris": [ + "http://username:password@10.212.51.23:15672/api/", + "http://username:password@10.212.51.32:15672/api/" + ], + "username": "username" + }, + "management+ssl": { + "host": "10.212.51.23", + "hosts": [ + "10.212.51.23", + "10.212.51.32" + ], + "password": "password", + "path": "/api/", + "port": 15672, + "ssl": false, + "uri": "http://username:password@10.212.51.23:15672/api/", + "uris": [ + "http://username:password@10.212.51.23:15672/api/", + "http://username:password@10.212.51.32:15672/api/" + ], + "username": "username" + }, + "mqtt": { + "host": "10.212.51.23", + "hosts": [ + "10.212.51.23", + "10.212.51.32" + ], + "password": "password", + "port": 1883, + "ssl": false, + "uri": "mqtt://02867b2e-e57e-4259-b941-22af75f67246%3Ausername:password@10.212.51.23:1883", + "uris": [ + "mqtt://02867b2e-e57e-4259-b941-22af75f67246%3Ausername:password@10.212.51.23:1883", + "mqtt://02867b2e-e57e-4259-b941-22af75f67246%3Ausername:password@10.212.51.32:1883" + ], + "username": "02867b2e-e57e-4259-b941-22af75f67246:username" + }, + "mqtt+ssl": { + "host": "10.212.51.23", + "hosts": [ + "10.212.51.23", + "10.212.51.32" + ], + "password": "password", + "port": 8883, + "ssl": true, + "uri": "mqtt+ssl://02867b2e-e57e-4259-b941-22af75f67246%3Ausername:password@10.212.51.23:8883", + "uris": [ + "mqtt+ssl://02867b2e-e57e-4259-b941-22af75f67246%3Ausername:password@10.212.51.23:8883", + "mqtt+ssl://02867b2e-e57e-4259-b941-22af75f67246%3Ausername:password@10.212.51.32:8883" + ], + "username": "02867b2e-e57e-4259-b941-22af75f67246:username" + }, + "stomp": { + "host": "10.212.51.23", + "hosts": [ + "10.212.51.23", + "10.212.51.32" + ], + "password": "password", + "port": 61613, + "ssl": false, + "uri": "stomp://username:password@10.212.51.23:61613", + "uris": [ + "stomp://username:password@10.212.51.23:61613", + "stomp://username:password@10.212.51.32:61613" + ], + "username": "username", + "vhost": "02867b2e-e57e-4259-b941-22af75f67246" + }, + "stomp+ssl": { + "host": "10.212.51.23", + "hosts": [ + "10.212.51.23", + "10.212.51.32" + ], + "password": "password", + "port": 61614, + "ssl": true, + "uri": "stomp+ssl://username:password@10.212.51.23:61614", + "uris": [ + "stomp+ssl://username:password@10.212.51.23:61614", + "stomp+ssl://username:password@10.212.51.32:61614" + ], + "username": "username", + "vhost": "02867b2e-e57e-4259-b941-22af75f67246" + }, + "ws": { + "host": "10.212.51.23", + "hosts": [ + "10.212.51.23", + "10.212.51.32" + ], + "password": "password", + "port": 15674, + "ssl": false, + "uri": "http/web-stomp://username:password@10.212.51.23:15674/02867b2e-e57e-4259-b941-22af75f67246", + "uris": [ + "http/web-stomp://username:password@10.212.51.23:15674/02867b2e-e57e-4259-b941-22af75f67246", + "http/web-stomp://username:password@10.212.51.32:15674/02867b2e-e57e-4259-b941-22af75f67246" + ], + "username": "username", + "vhost": "02867b2e-e57e-4259-b941-22af75f67246" + } + }, + "ssl": true, + "uri": "amqps://username:password@10.212.51.23/02867b2e-e57e-4259-b941-22af75f67246", + "uris": [ + "amqps://username:password@10.212.51.23/02867b2e-e57e-4259-b941-22af75f67246", + "amqps://username:password@10.212.51.32/02867b2e-e57e-4259-b941-22af75f67246" + ], + "username": "username", + "vhost": "02867b2e-e57e-4259-b941-22af75f67246" + }, + "syslog_drain_url": null, + "volume_mounts": [] + } + ], + "app-autoscaler": [ + { + "label": "app-autoscaler", + "provider": null, + "plan": "standard", + "name": "autoscaler", + "tags": [ + "cfapi", + "runtime", + "autoscaling" + ], + "instance_name": "autoscaler", + "binding_name": null, + "credentials": {}, + "syslog_drain_url": null, + "volume_mounts": [] + } + ], + "hashicorp-vault": [ + { + "label": "hashicorp-vault", + "provider": null, + "plan": "shared", + "name": "vault", + "tags": [ + "" + ], + "instance_name": "vault", + "binding_name": null, + "credentials": { + "address": "https://vault.localdomain:8243/", + "auth": { + "accessor": "accessor", + "token": "token" + }, + "backends": { + "generic": "cf/d041c229-4125-47b1-bacf-bc064716620a/secret", + "transit": "cf/d041c229-4125-47b1-bacf-bc064716620a/transit" + }, + "backends_shared": { + "organization": "cf/4fe703b7-199c-4a63-aaa9-6261de724641/secret", + "space": "cf/d3325332-9abb-4136-9232-f7e244f51817/secret" + } + }, + "syslog_drain_url": null, + "volume_mounts": [] + } + ] + }, + "VCAP_APPLICATION": { + "cf_api": "https://api.sys.pcf.localdomain", + "limits": { + "fds": 16384 + }, + "application_name": "api-active", + "application_uris": [ + "api-qa.apps.pcf.localdomain" + ], + "name": "api-active", + "space_name": "epg02-qa", + "space_id": "d3325332-9abb-4136-9232-f7e244f51817", + "organization_id": "4fe703b7-199c-4a63-aaa9-6261de724641", + "organization_name": "epg02-local-team", + "uris": [ + "api-qa.apps.pcf.localdomain" + ], + "users": null, + "application_id": "8bee55d9-5f5c-4d70-88a7-f1c159d9652e" + }, + "ENV": { + "SOME_VAR": "abc" + } +}