Skip to content

Commit 4271ba1

Browse files
authored
add service log creation
1 parent 13eb942 commit 4271ba1

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

pipelines/samples/simple/mlpipeline_sample.ipynb

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,34 @@
353353
"print(res.data.lifecycle_state)"
354354
]
355355
},
356+
{
357+
"cell_type": "code",
358+
"execution_count": null,
359+
"id": "58c70cae",
360+
"metadata": {},
361+
"outputs": [],
362+
"source": [
363+
"#enable service logs - to catch issues during step provisioning\n",
364+
"logging_client = oci.logging.LoggingManagementClient(config)\n",
365+
"service_log_name = pipeline_name + \"-service_log\"\n",
366+
"create_log_response = logging_client.create_log(\n",
367+
" log_group_id=log_group_id,\n",
368+
" create_log_details=oci.logging.models.CreateLogDetails(\n",
369+
" display_name=service_log_name,\n",
370+
" log_type=\"SERVICE\",\n",
371+
" is_enabled=True,\n",
372+
" configuration=oci.logging.models.Configuration(\n",
373+
" source=oci.logging.models.OciService(\n",
374+
" source_type=\"OCISERVICE\",\n",
375+
" service=\"datascienceprod\",\n",
376+
" resource=pipeline_id,\n",
377+
" category=\"pipelinerunlog\"),\n",
378+
" compartment_id=compartment_id)))\n",
379+
"\n",
380+
"# Check the response\n",
381+
"print(create_log_response.status)"
382+
]
383+
},
356384
{
357385
"cell_type": "markdown",
358386
"id": "fddef232",

0 commit comments

Comments
 (0)