# This is an automatically generated code sample.
# To make this code sample work in your Oracle Cloud tenancy,
# please replace the values for any parameters whose current values do not fit
# your use case (such as resource IDs, strings containing ‘EXAMPLE’ or ‘unique_id’, and
# boolean, number, and enum parameters with values not fitting your use case).
import oci
# Create a default config using DEFAULT profile in default location
# Refer to
# https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm#SDK_and_CLI_Configuration_File
# for more info
config = oci.config.from_file()
# Initialize service client with default config file
cims_client = oci.cims.IncidentClient(config)
# Send the request to service, some parameters are not required, see API
# doc for more info
create_incident_response = cims_client.create_incident(
create_incident_details=oci.cims.models.CreateIncident(
compartment_id="ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
ticket=oci.cims.models.CreateTicketDetails(
severity="HIGH",
title="EXAMPLE-title-Value",
description="EXAMPLE-description-Value",
resource_list=[
oci.cims.models.CreateResourceDetails(
item=oci.cims.models.CreateAccountItemDetails(
type="account",
category=oci.cims.models.CreateCategoryDetails(
category_key="EXAMPLE-categoryKey-Value"),
sub_category=oci.cims.models.CreateSubCategoryDetails(
sub_category_key="EXAMPLE-subCategoryKey-Value"),
issue_type=oci.cims.models.CreateIssueTypeDetails(
issue_type_key="EXAMPLE-issueTypeKey-Value"),
name="EXAMPLE-name-Value"),
region="EXAMPLE-region-Value")],
contextual_data=oci.cims.models.ContextualData(
client_id="ocid1.test.oc1..<unique_ID>EXAMPLE-clientId-Value",
schema_name="EXAMPLE-schemaName-Value",
schema_version="EXAMPLE-schemaVersion-Value",
payload="EXAMPLE-payload-Value")),
problem_type="TECH",
csi="EXAMPLE-csi-Value",
user_group_id="ocid1.test.oc1..<unique_ID>EXAMPLE-userGroupId-Value",
contacts=[
oci.cims.models.Contact(
contact_name="EXAMPLE-contactName-Value",
contact_email="EXAMPLE-contactEmail-Value",
email="EXAMPLE-email-Value",
contact_phone="EXAMPLE-contactPhone-Value",
contact_type="ADMIN")],
referrer="EXAMPLE-referrer-Value"),
opc_request_id="U7N0ZV4ZSPNUGLJVOMFO<unique_ID>",
ocid="EXAMPLE-ocid-Value",
homeregion="EXAMPLE-homeregion-Value",
bearertokentype="EXAMPLE-bearertokentype-Value",
bearertoken="EXAMPLE-bearertoken-Value",
idtoken="EXAMPLE-idtoken-Value",
domainid="EXAMPLE-domainid-Value")
# Get the data from response
print(create_incident_response.data)