ChangeType values

ChangeType value

Description

Created

The resource is created or is added to HP OneView.

Updated

The resource state, attributes, or both are updated.

Deleted

The resource is permanently removed from HP OneView.

Example 2 JSON example

{

"resourceUri" : "/rest/enclosures/123xyz",

"changeType" : "Created",

"newState" : "Managed",

"eTag" : "123456",

"timestamp" : "2013-07-10T18:30:44Z",

"newSubState" : "null",

"resource" : {

"category" : "enclosures",

"created" : "2013-07-10T18:30:00Z",

...

},

"associatedTask" : "/rest/tasks/4321",

"userInitiatedTask" : "true",

"changedAttributes" : [],

"data" : {},

}

26.4 .NET C# code example

The .NET C# code examples show how to connect and subscribe to the SCMB. In addition to completing the prerequisites, you must complete the example-specific prerequisites before using the .NET C# code examples.

Prerequisites

Before you can use the .Net C# code examples, you must add the CA root certificate, the client certificate, and the private key to the Windows certificate store.

1.Download the root CA certificate.

GET /rest/certificates/ca

2.Save the contents in the response body into a text file named rootCA.crt. You must copy and paste everything from -----BEGINCERTIFICATE-----to -----ENDCERTIFICATE-----, including the dashes, but not including the quotes.

3.Import the rootCA.crt file into the Windows certificate store under Trusted Root Certification Authorities.

4.Download the client certificate and private key.

GET /rest/certificates/client/rabbitmq/keypair/default

5.Save the contents of the client certificate and private key in the response body into a text file named scmb.crt.

You must copy and paste everything from -----BEGINCERTIFICATE-----to -----ENDCERTIFICATE-----for the client certificate. Next, copy and paste everything from

-----BEGIN RSA PRIVATE KEY----- to -----END RSA PRIVATE KEY----- for the private key. You must include the dashes, but do not include the quotes.

188 Using the State-Change Message Bus (SCMB)

Page 188
Image 188
HP OneView manual NET C# code example, ChangeType values, Example 2 Json example