Skip to content

Commit f87a6a9

Browse files
committed
Rename Process stats instance_id to instance_guid
1 parent 5d7ac94 commit f87a6a9

File tree

6 files changed

+18
-18
lines changed

6 files changed

+18
-18
lines changed

docs/v3/source/includes/api_resources/_processes.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@
204204
{
205205
"type": "web",
206206
"index": 0,
207-
"instance_id": "e49f448e-54d2-4c33-61a3-5335",
207+
"instance_guid": "e49f448e-54d2-4c33-61a3-5335",
208208
"state": "RUNNING",
209209
"usage": {
210210
"time": "2016-03-23T23:17:30.476314154Z",

docs/v3/source/includes/resources/processes/_stats_object.md.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Name | Type | Description
1313
---- | ---- | -----------
1414
**type** | _string_ | Process type; a unique identifier for processes belonging to an app
1515
**index** | _integer_ | The zero-based index of running instances
16-
**instance_id** | _string_ | The unique identifier of the instance
16+
**instance_guid** | _string_ | The unique identifier of the instance
1717
**state** | _string_ | The state of the instance; valid values are `RUNNING`, `CRASHED`, `STARTING`, `STOPPING`, `DOWN`
1818
**routable** | _boolean_ | Whether or not the instance is routable (determined by the readiness check of the app). If app readiness checks and routability are unsupported by Diego, this will return as `null`.
1919
**usage** | _object_ | Object containing actual usage data for the instance; the value is `{}` when usage data is unavailable

lib/cloud_controller/diego/reporters/instances_stats_reporter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def build_info(state, actual_lrp, process, stats, quota_stats, log_cache_errors)
6868
name: process.name,
6969
uris: process.uris,
7070
host: actual_lrp.actual_lrp_net_info.address,
71-
instance_id: actual_lrp.actual_lrp_instance_key.instance_guid,
71+
instance_guid: actual_lrp.actual_lrp_instance_key.instance_guid,
7272
port: get_default_port(actual_lrp.actual_lrp_net_info),
7373
net_info: actual_lrp.actual_lrp_net_info.to_h,
7474
uptime: nanoseconds_to_seconds((Time.now.to_f * 1e9) - actual_lrp.since),

spec/request/processes_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@
528528
name: process.name,
529529
uris: process.uris,
530530
host: 'toast',
531-
instance_id: 'some-diego-instance-id',
531+
instance_guid: 'some-diego-instance-id',
532532
net_info: net_info_1,
533533
uptime: 12_345,
534534
mem_quota: process[:memory] * 1024 * 1024,
@@ -557,7 +557,7 @@
557557
'type' => 'worker',
558558
'index' => 0,
559559
'state' => 'RUNNING',
560-
'instance_id' => 'some-diego-instance-id',
560+
'instance_guid' => 'some-diego-instance-id',
561561
'routable' => true,
562562
'isolation_segment' => 'very-isolated',
563563
'details' => 'some-details',

spec/unit/lib/cloud_controller/diego/reporters/instances_stats_reporter_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def make_actual_lrp(instance_guid:, index:, state:, error:, since:)
8888
name: process.name,
8989
uris: process.uris,
9090
host: 'lrp-host',
91-
instance_id: 'instance-a',
91+
instance_guid: 'instance-a',
9292
port: 2222,
9393
net_info: lrp_1_net_info.to_h,
9494
uptime: two_days_in_seconds,
@@ -132,7 +132,7 @@ def make_actual_lrp(instance_guid:, index:, state:, error:, since:)
132132
name: process.name,
133133
uris: process.uris,
134134
host: 'lrp-host',
135-
instance_id: 'instance-a',
135+
instance_guid: 'instance-a',
136136
port: 2222,
137137
net_info: lrp_1_net_info.to_h,
138138
uptime: two_days_in_seconds,
@@ -400,7 +400,7 @@ def make_actual_lrp(instance_guid:, index:, state:, error:, since:)
400400
name: process.name,
401401
uris: process.uris,
402402
host: 'lrp-host',
403-
instance_id: 'instance-a',
403+
instance_guid: 'instance-a',
404404
port: 2222,
405405
net_info: lrp_1_net_info.to_h,
406406
uptime: two_days_in_seconds,
@@ -534,7 +534,7 @@ def make_actual_lrp(instance_guid:, index:, state:, error:, since:)
534534
name: process.name,
535535
uris: process.uris,
536536
host: 'lrp-host',
537-
instance_id: 'instance-a',
537+
instance_guid: 'instance-a',
538538
port: 2222,
539539
net_info: lrp_1_net_info.to_h,
540540
uptime: two_days_in_seconds,

spec/unit/presenters/v3/process_stats_presenter_spec.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ module VCAP::CloudController::Presenters::V3
6565
name: process.name,
6666
uris: process.uris,
6767
host: 'myhost',
68-
instance_id: 'instance-a',
68+
instance_guid: 'instance-a',
6969
net_info: net_info_1,
7070
uptime: 12_345,
7171
mem_quota: process[:memory] * 1024 * 1024,
@@ -90,7 +90,7 @@ module VCAP::CloudController::Presenters::V3
9090
name: process.name,
9191
uris: process.uris,
9292
host: 'toast',
93-
instance_id: 'instance-b',
93+
instance_guid: 'instance-b',
9494
net_info: net_info_2,
9595
uptime: 42,
9696
mem_quota: process[:memory] * 1024 * 1024,
@@ -124,7 +124,7 @@ module VCAP::CloudController::Presenters::V3
124124
expect(result[0][:type]).to eq(process.type)
125125
expect(result[0][:index]).to eq(0)
126126
expect(result[0][:state]).to eq('RUNNING')
127-
expect(result[0][:instance_id]).to eq('instance-a')
127+
expect(result[0][:instance_guid]).to eq('instance-a')
128128
expect(result[0][:routable]).to be(true)
129129
expect(result[0][:details]).to be_nil
130130
expect(result[0][:isolation_segment]).to eq('hecka-compliant')
@@ -146,7 +146,7 @@ module VCAP::CloudController::Presenters::V3
146146
expect(result[1][:type]).to eq(process.type)
147147
expect(result[1][:index]).to eq(1)
148148
expect(result[1][:state]).to eq('CRASHED')
149-
expect(result[1][:instance_id]).to eq('instance-b')
149+
expect(result[1][:instance_guid]).to eq('instance-b')
150150
expect(result[1][:routable]).to be(false)
151151
expect(result[1][:details]).to eq('some-details')
152152
expect(result[1][:isolation_segment]).to be_nil
@@ -182,7 +182,7 @@ module VCAP::CloudController::Presenters::V3
182182
name: process.name,
183183
uris: process.uris,
184184
host: 'myhost',
185-
instance_id: 'instance-a',
185+
instance_guid: 'instance-a',
186186
net_info: net_info_1,
187187
uptime: 12_345,
188188
mem_quota: process[:memory] * 1024 * 1024,
@@ -222,7 +222,7 @@ module VCAP::CloudController::Presenters::V3
222222
name: process.name,
223223
uris: process.uris,
224224
host: 'myhost',
225-
instance_id: 'instance-a',
225+
instance_guid: 'instance-a',
226226
net_info: net_info_1,
227227
uptime: 12_345,
228228
mem_quota: process[:memory] * 1024 * 1024,
@@ -292,7 +292,7 @@ module VCAP::CloudController::Presenters::V3
292292
expect(result[0][:details]).to be_nil
293293
expect(result[0][:isolation_segment]).to eq('hecka-compliant')
294294
expect(result[0][:host]).to eq('myhost')
295-
expect(result[0][:instance_id]).to eq('instance-a')
295+
expect(result[0][:instance_guid]).to eq('instance-a')
296296
expect(result[0][:instance_internal_ip]).to eq('5.6.7.8')
297297
expect(result[0][:instance_ports]).to eq(instance_ports_1)
298298
expect(result[0][:uptime]).to eq(12_345)
@@ -319,7 +319,7 @@ module VCAP::CloudController::Presenters::V3
319319
name: process.name,
320320
uris: process.uris,
321321
host: 'myhost',
322-
instance_id: 'instance-a',
322+
instance_guid: 'instance-a',
323323
net_info: net_info_1,
324324
uptime: 12_345,
325325
fds_quota: process.file_descriptors,
@@ -338,7 +338,7 @@ module VCAP::CloudController::Presenters::V3
338338
expect(result[0][:details]).to be_nil
339339
expect(result[0][:isolation_segment]).to eq('hecka-compliant')
340340
expect(result[0][:host]).to eq('myhost')
341-
expect(result[0][:instance_id]).to eq('instance-a')
341+
expect(result[0][:instance_guid]).to eq('instance-a')
342342
expect(result[0][:instance_internal_ip]).to eq('5.6.7.8')
343343
expect(result[0][:instance_ports]).to eq(instance_ports_1)
344344
expect(result[0][:uptime]).to eq(12_345)

0 commit comments

Comments
 (0)