Class: OCI::Audit::Models::Data
- Inherits:
-
Object
- Object
- OCI::Audit::Models::Data
- Defined in:
- lib/oci/audit/models/data.rb
Overview
The payload of the event. Information within ‘data` comes from the resource emitting the event.
Example:
-----
{
\"eventGroupingId\": null,
\"eventName\": \"GetInstance\",
\"compartmentId\": \"ocid1.tenancy.oc1..<unique_ID>\",
\"compartmentName\": \"compartmentA\",
\"resourceName\": \"my_instance\",
\"resourceId\": \"ocid1.instance.oc1.phx.<unique_ID>\",
\"availabilityDomain\": \"<availability_domain>\",
\"freeformTags\": null,
\"definedTags\": null,
\"identity\": {
\"principalName\": \"ExampleName\",
\"principalId\": \"ocid1.user.oc1..<unique_ID>\",
\"authType\": \"natv\",
\"callerName\": null,
\"callerId\": null,
\"tenantId\": \"ocid1.tenancy.oc1..<unique_ID>\",
\"ipAddress\": \"172.24.80.88\",
\"credentials\": null,
\"userAgent\": \"Jersey/2.23 (HttpUrlConnection 1.8.0_212)\",
\"consoleSessionId\": null
},
\"request\": {
\"id\": \"<unique_ID>\",
\"path\": \"/20160918/instances/ocid1.instance.oc1.phx.<unique_ID>\",
\"action\": \"GET\",
\"parameters\": {},
\"headers\": {
\"opc-principal\": [
\"{\\\"tenantId\\\":\\\"ocid1.tenancy.oc1..<unique_ID>\\\",\\\"subjectId\\\":\\\"ocid1.user.oc1..<unique_ID>\\\",\\\"claims\\\":[{\\\"key\\\":\\\"pstype\\\",\\\"value\\\":\\\"natv\\\",\\\"issuer\\\":\\\"authService.oracle.com\\\"},{\\\"key\\\":\\\"h_host\\\",\\\"value\\\":\\\"iaas.r2.oracleiaas.com\\\",\\\"issuer\\\":\\\"h\\\"},{\\\"key\\\":\\\"h_opc-request-id\\\",\\\"value\\\":\\\"<unique_ID>\\\",\\\"issuer\\\":\\\"h\\\"},{\\\"key\\\":\\\"ptype\\\",\\\"value\\\":\\\"user\\\",\\\"issuer\\\":\\\"authService.oracle.com\\\"},{\\\"key\\\":\\\"h_date\\\",\\\"value\\\":\\\"Wed, 18 Sep 2019 00:10:58 UTC\\\",\\\"issuer\\\":\\\"h\\\"},{\\\"key\\\":\\\"h_accept\\\",\\\"value\\\":\\\"application/json\\\",\\\"issuer\\\":\\\"h\\\"},{\\\"key\\\":\\\"authorization\\\",\\\"value\\\":\\\"Signature headers=\\\\\\\"date (request-target) host accept opc-request-id\\\\\\\",keyId=\\\\\\\"ocid1.tenancy.oc1..<unique_ID>/ocid1.user.oc1..<unique_ID>/8c:b4:5f:18:e7:ec:db:08:b8:fa:d2:2a:7d:11:76:ac\\\\\\\",algorithm=\\\\\\\"rsa-pss-sha256\\\\\\\",signature=\\\\\\\"<unique_ID>\\\\\\\",version=\\\\\\\"1\\\\\\\"\\\",\\\"issuer\\\":\\\"h\\\"},{\\\"key\\\":\\\"h_(request-target)\\\",\\\"value\\\":\\\"get /20160918/instances/ocid1.instance.oc1.phx.<unique_ID>\\\",\\\"issuer\\\":\\\"h\\\"}]}\"
],
\"Accept\": [
\"application/json\"
],
\"X-Oracle-Auth-Client-CN\": [
\"splat-proxy-se-02302.node.ad2.r2\"
],
\"X-Forwarded-Host\": [
\"compute-api.svc.ad1.r2\"
],
\"Connection\": [
\"close\"
],
\"User-Agent\": [
\"Jersey/2.23 (HttpUrlConnection 1.8.0_212)\"
],
\"X-Forwarded-For\": [
\"172.24.80.88\"
],
\"X-Real-IP\": [
\"172.24.80.88\"
],
\"oci-original-url\": [
\"https://iaas.r2.oracleiaas.com/20160918/instances/ocid1.instance.oc1.phx.<unique_ID>\"
],
\"opc-request-id\": [
\"<unique_ID>\"
],
\"Date\": [
\"Wed, 18 Sep 2019 00:10:58 UTC\"
]
}
},
\"response\": {
\"status\": \"200\",
\"responseTime\": \"2019-09-18T00:10:59.278Z\",
\"headers\": {
\"ETag\": [
\"<unique_ID>\"
],
\"Connection\": [
\"close\"
],
\"Content-Length\": [
\"1828\"
],
\"opc-request-id\": [
\"<unique_ID>\"
],
\"Date\": [
\"Wed, 18 Sep 2019 00:10:59 GMT\"
],
\"Content-Type\": [
\"application/json\"
]
},
\"payload\": {
\"resourceName\": \"my_instance\",
\"id\": \"ocid1.instance.oc1.phx.<unique_ID>\"
},
\"message\": null
},
\"stateChange\": {
\"previous\": null,
\"current\": null
},
\"additionalDetails\": {
\"imageId\": \"ocid1.image.oc1.phx.<unique_ID>\",
\"shape\": \"VM.Standard1.1\",
\"type\": \"CustomerVmi\"
}
}
-----
Instance Attribute Summary collapse
-
#additional_details ⇒ Hash<String, Object>
A container object for attribues unique to the resource emitting the event.
-
#availability_domain ⇒ String
The availability domain where the resource resides.
-
#compartment_id ⇒ String
The [OCID](docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment of the resource emitting the event.
-
#compartment_name ⇒ String
The name of the compartment.
-
#defined_tags ⇒ Hash<String, Hash<String, Object>>
Defined tags for this resource.
-
#event_grouping_id ⇒ String
This value links multiple audit events that are part of the same API operation.
-
#event_name ⇒ String
Name of the API operation that generated this event.
-
#freeform_tags ⇒ Hash<String, String>
Free-form tags for this resource.
- #identity ⇒ OCI::Audit::Models::Identity
- #request ⇒ OCI::Audit::Models::Request
-
#resource_id ⇒ String
An [OCID](docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) or some other ID for the resource emitting the event.
-
#resource_name ⇒ String
The name of the resource emitting the event.
- #response ⇒ OCI::Audit::Models::Response
- #state_change ⇒ OCI::Audit::Models::StateChange
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ Data
constructor
Initializes the object.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
Constructor Details
#initialize(attributes = {}) ⇒ Data
Initializes the object
271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 |
# File 'lib/oci/audit/models/data.rb', line 271 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } self.event_grouping_id = attributes[:'eventGroupingId'] if attributes[:'eventGroupingId'] raise 'You cannot provide both :eventGroupingId and :event_grouping_id' if attributes.key?(:'eventGroupingId') && attributes.key?(:'event_grouping_id') self.event_grouping_id = attributes[:'event_grouping_id'] if attributes[:'event_grouping_id'] self.event_name = attributes[:'eventName'] if attributes[:'eventName'] raise 'You cannot provide both :eventName and :event_name' if attributes.key?(:'eventName') && attributes.key?(:'event_name') self.event_name = attributes[:'event_name'] if attributes[:'event_name'] self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId'] raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id') self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id'] self.compartment_name = attributes[:'compartmentName'] if attributes[:'compartmentName'] raise 'You cannot provide both :compartmentName and :compartment_name' if attributes.key?(:'compartmentName') && attributes.key?(:'compartment_name') self.compartment_name = attributes[:'compartment_name'] if attributes[:'compartment_name'] self.resource_name = attributes[:'resourceName'] if attributes[:'resourceName'] raise 'You cannot provide both :resourceName and :resource_name' if attributes.key?(:'resourceName') && attributes.key?(:'resource_name') self.resource_name = attributes[:'resource_name'] if attributes[:'resource_name'] self.resource_id = attributes[:'resourceId'] if attributes[:'resourceId'] raise 'You cannot provide both :resourceId and :resource_id' if attributes.key?(:'resourceId') && attributes.key?(:'resource_id') self.resource_id = attributes[:'resource_id'] if attributes[:'resource_id'] self.availability_domain = attributes[:'availabilityDomain'] if attributes[:'availabilityDomain'] raise 'You cannot provide both :availabilityDomain and :availability_domain' if attributes.key?(:'availabilityDomain') && attributes.key?(:'availability_domain') self.availability_domain = attributes[:'availability_domain'] if attributes[:'availability_domain'] self. = attributes[:'freeformTags'] if attributes[:'freeformTags'] raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags') self. = attributes[:'freeform_tags'] if attributes[:'freeform_tags'] self. = attributes[:'definedTags'] if attributes[:'definedTags'] raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags') self. = attributes[:'defined_tags'] if attributes[:'defined_tags'] self.identity = attributes[:'identity'] if attributes[:'identity'] self.request = attributes[:'request'] if attributes[:'request'] self.response = attributes[:'response'] if attributes[:'response'] self.state_change = attributes[:'stateChange'] if attributes[:'stateChange'] raise 'You cannot provide both :stateChange and :state_change' if attributes.key?(:'stateChange') && attributes.key?(:'state_change') self.state_change = attributes[:'state_change'] if attributes[:'state_change'] self.additional_details = attributes[:'additionalDetails'] if attributes[:'additionalDetails'] raise 'You cannot provide both :additionalDetails and :additional_details' if attributes.key?(:'additionalDetails') && attributes.key?(:'additional_details') self.additional_details = attributes[:'additional_details'] if attributes[:'additional_details'] end |
Instance Attribute Details
#additional_details ⇒ Hash<String, Object>
A container object for attribues unique to the resource emitting the event.
Example:
-----
{
\"imageId\": \"ocid1.image.oc1.phx.<unique_ID>\",
\"shape\": \"VM.Standard1.1\",
\"type\": \"CustomerVmi\"
}
-----
205 206 207 |
# File 'lib/oci/audit/models/data.rb', line 205 def additional_details @additional_details end |
#availability_domain ⇒ String
The availability domain where the resource resides.
161 162 163 |
# File 'lib/oci/audit/models/data.rb', line 161 def availability_domain @availability_domain end |
#compartment_id ⇒ String
The [OCID](docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment of the resource emitting the event.
136 137 138 |
# File 'lib/oci/audit/models/data.rb', line 136 def compartment_id @compartment_id end |
#compartment_name ⇒ String
The name of the compartment. This value is the friendly name associated with compartmentId. This value can change, but the service logs the value that appeared at the time of the audit event.
Example: ‘CompartmentA`
145 146 147 |
# File 'lib/oci/audit/models/data.rb', line 145 def compartment_name @compartment_name end |
#defined_tags ⇒ Hash<String, Hash<String, Object>>
Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm).
Example: ‘{"CostCenter": "42"}`
178 179 180 |
# File 'lib/oci/audit/models/data.rb', line 178 def @defined_tags end |
#event_grouping_id ⇒ String
This value links multiple audit events that are part of the same API operation. For example, a long running API operations that emit an event at the start and the end of an operation would use the same value in this field for both events.
123 124 125 |
# File 'lib/oci/audit/models/data.rb', line 123 def event_grouping_id @event_grouping_id end |
#event_name ⇒ String
Name of the API operation that generated this event.
Example: ‘GetInstance`
130 131 132 |
# File 'lib/oci/audit/models/data.rb', line 130 def event_name @event_name end |
#freeform_tags ⇒ Hash<String, String>
Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. Exists for cross-compatibility only. For more information, see [Resource Tags](docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm).
Example: ‘"Finance"`
170 171 172 |
# File 'lib/oci/audit/models/data.rb', line 170 def @freeform_tags end |
#identity ⇒ OCI::Audit::Models::Identity
181 182 183 |
# File 'lib/oci/audit/models/data.rb', line 181 def identity @identity end |
#request ⇒ OCI::Audit::Models::Request
184 185 186 |
# File 'lib/oci/audit/models/data.rb', line 184 def request @request end |
#resource_id ⇒ String
An [OCID](docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) or some other ID for the resource emitting the event.
156 157 158 |
# File 'lib/oci/audit/models/data.rb', line 156 def resource_id @resource_id end |
#resource_name ⇒ String
The name of the resource emitting the event.
150 151 152 |
# File 'lib/oci/audit/models/data.rb', line 150 def resource_name @resource_name end |
#response ⇒ OCI::Audit::Models::Response
187 188 189 |
# File 'lib/oci/audit/models/data.rb', line 187 def response @response end |
#state_change ⇒ OCI::Audit::Models::StateChange
190 191 192 |
# File 'lib/oci/audit/models/data.rb', line 190 def state_change @state_change end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 |
# File 'lib/oci/audit/models/data.rb', line 208 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'event_grouping_id': :'eventGroupingId', 'event_name': :'eventName', 'compartment_id': :'compartmentId', 'compartment_name': :'compartmentName', 'resource_name': :'resourceName', 'resource_id': :'resourceId', 'availability_domain': :'availabilityDomain', 'freeform_tags': :'freeformTags', 'defined_tags': :'definedTags', 'identity': :'identity', 'request': :'request', 'response': :'response', 'state_change': :'stateChange', 'additional_details': :'additionalDetails' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 |
# File 'lib/oci/audit/models/data.rb', line 230 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'event_grouping_id': :'String', 'event_name': :'String', 'compartment_id': :'String', 'compartment_name': :'String', 'resource_name': :'String', 'resource_id': :'String', 'availability_domain': :'String', 'freeform_tags': :'Hash<String, String>', 'defined_tags': :'Hash<String, Hash<String, Object>>', 'identity': :'OCI::Audit::Models::Identity', 'request': :'OCI::Audit::Models::Request', 'response': :'OCI::Audit::Models::Response', 'state_change': :'OCI::Audit::Models::StateChange', 'additional_details': :'Hash<String, Object>' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 |
# File 'lib/oci/audit/models/data.rb', line 357 def ==(other) return true if equal?(other) self.class == other.class && event_grouping_id == other.event_grouping_id && event_name == other.event_name && compartment_id == other.compartment_id && compartment_name == other.compartment_name && resource_name == other.resource_name && resource_id == other.resource_id && availability_domain == other.availability_domain && == other. && == other. && identity == other.identity && request == other.request && response == other.response && state_change == other.state_change && additional_details == other.additional_details end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 |
# File 'lib/oci/audit/models/data.rb', line 400 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /^Array<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) public_method("#{key}=").call( attributes[self.class.attribute_map[key]] .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) } ) end elsif !attributes[self.class.attribute_map[key]].nil? public_method("#{key}=").call( OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]) ) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end |
#eql?(other) ⇒ Boolean
380 381 382 |
# File 'lib/oci/audit/models/data.rb', line 380 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
389 390 391 |
# File 'lib/oci/audit/models/data.rb', line 389 def hash [event_grouping_id, event_name, compartment_id, compartment_name, resource_name, resource_id, availability_domain, , , identity, request, response, state_change, additional_details].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
433 434 435 436 437 438 439 440 441 442 |
# File 'lib/oci/audit/models/data.rb', line 433 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = public_method(attr).call next if value.nil? && !instance_variable_defined?("@#{attr}") hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
427 428 429 |
# File 'lib/oci/audit/models/data.rb', line 427 def to_s to_hash.to_s end |