# 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).
from datetime import datetime
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
operator_access_control_client = oci.operator_access_control.OperatorControlAssignmentClient(
config)
# Send the request to service, some parameters are not required, see API
# doc for more info
update_operator_control_assignment_response = operator_access_control_client.update_operator_control_assignment(
operator_control_assignment_id="ocid1.test.oc1..<unique_ID>EXAMPLE-operatorControlAssignmentId-Value",
update_operator_control_assignment_details=oci.operator_access_control.models.UpdateOperatorControlAssignmentDetails(
is_enforced_always=True,
time_assignment_from=datetime.strptime(
"2041-12-08T14:13:52.611Z",
"%Y-%m-%dT%H:%M:%S.%fZ"),
time_assignment_to=datetime.strptime(
"2004-04-26T14:16:02.305Z",
"%Y-%m-%dT%H:%M:%S.%fZ"),
comment="EXAMPLE-comment-Value",
is_log_forwarded=False,
remote_syslog_server_address="EXAMPLE-remoteSyslogServerAddress-Value",
remote_syslog_server_port=946,
remote_syslog_server_ca_cert="EXAMPLE-remoteSyslogServerCACert-Value",
is_hypervisor_log_forwarded=False,
is_auto_approve_during_maintenance=False,
freeform_tags={
'EXAMPLE_KEY_xlRc8': 'EXAMPLE_VALUE_NxA55v2SfHw1RQpbISB6'},
defined_tags={
'EXAMPLE_KEY_iKNTQ': {
'EXAMPLE_KEY_3hsDy': 'EXAMPLE--Value'}}),
if_match="EXAMPLE-ifMatch-Value",
opc_request_id="LMDHR46TN3RFW8BKZGL4<unique_ID>")
# Get the data from response
print(update_operator_control_assignment_response.data)