credhub-ref仅当密钥存在于以下 JSON 中时,我才尝试选择凭证对象:
{
"total_results": 23,
"total_pages": 1,
"prev_url": null,
"next_url": null,
"resources": [
{
"entity": {
"credentials": {},
"binding_options": {},
"gateway_data": null,
"gateway_name": "",
"syslog_drain_url": null,
"volume_mounts": [],
"name": null,
"last_operation": {
"type": "create",
"state": "succeeded",
"description": "",
"updated_at": "2018-10-15T19:13:57Z",
"created_at": "2018-10-15T19:13:57Z"
},
"app_url": "/v2/3"
}
},
{
"entity": {
"app_guid": "sd",
"service_instance_guid": "sd",
"credentials": {
"hostname": "w",
"port": 3306
},
"binding_options": {},
"gateway_data": null,
"gateway_name": "",
"syslog_drain_url": null,
"volume_mounts": [],
"name": null,
"last_operation": {
"type": "create",
"state": …Run Code Online (Sandbox Code Playgroud) 尝试从 JSON 数组中选择对象,其中值包含字符串且值不为空。
期望的输出:
{
"configurable": false,
"property_reference": ".properties.blobstore_certificate",
"property_type": "rsa_cert_credentials",
"product_guid": "p-blah-29d4678e926cf2069871",
"location": "ops_manager",
"variable_path": "something",
"issuer": "/C=US/O=Blah",
"valid_from": "2019-01-16T19:55:11Z",
"valid_until": "2021-01-16T19:55:11Z"
}
Run Code Online (Sandbox Code Playgroud)
选择时:
{
"certificates": [
{
"configurable": false,
"property_reference": ".properties.director_ssl",
"property_type": "rsa_cert_credentials",
"product_guid": "p-blah-29d4678e926cf2069871",
"location": "ops_manager",
"variable_path": null,
"issuer": "/C=US/O=Blah",
"valid_from": "2019-01-16T19:55:10Z",
"valid_until": "2021-01-16T19:55:10Z"
},
{
"configurable": false,
"property_reference": ".properties.uaa_ssl",
"property_type": "rsa_cert_credentials",
"product_guid": "p-blah-29d4678e926cf2069871",
"location": "ops_manager",
"variable_path": null,
"issuer": "/C=US/O=Blah",
"valid_from": "2019-01-16T19:55:10Z",
"valid_until": "2021-01-16T19:55:10Z"
},
{
"configurable": false,
"property_reference": ".properties.blobstore_certificate",
"property_type": "rsa_cert_credentials",
"product_guid": "p-blah-29d4678e926cf2069871",
"location": "ops_manager",
"variable_path": …Run Code Online (Sandbox Code Playgroud)