// 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).
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Oci.ManagementdashboardService;
using Oci.Common;
using Oci.Common.Auth;
namespace Oci.Sdk.DotNet.Example.Managementdashboard
{
public class CreateManagementDashboardExample
{
public static async Task Main()
{
// Create a request and dependent object(s).
var createManagementDashboardDetails = new Oci.ManagementdashboardService.Models.CreateManagementDashboardDetails
{
DashboardId = "ocid1.test.oc1..<unique_ID>EXAMPLE-dashboardId-Value",
ProviderId = "ocid1.test.oc1..<unique_ID>EXAMPLE-providerId-Value",
ProviderName = "EXAMPLE-providerName-Value",
ProviderVersion = "EXAMPLE-providerVersion-Value",
Tiles = new List<Oci.ManagementdashboardService.Models.ManagementDashboardTileDetails>
{
new Oci.ManagementdashboardService.Models.ManagementDashboardTileDetails
{
DisplayName = "EXAMPLE-displayName-Value",
SavedSearchId = "ocid1.test.oc1..<unique_ID>EXAMPLE-savedSearchId-Value",
Row = 756,
Column = 488,
Height = 581,
Width = 47,
Nls = "EXAMPLE-nls-Value",
UiConfig = "EXAMPLE-uiConfig-Value",
DataConfig = new List<Object>
{
"EXAMPLE-dataConfig-Value"
},
State = Oci.ManagementdashboardService.Models.ManagementDashboardTileDetails.StateEnum.Default,
DrilldownConfig = "EXAMPLE-drilldownConfig-Value",
ParametersMap = "EXAMPLE-parametersMap-Value"
}
},
DisplayName = "EXAMPLE-displayName-Value",
Description = "EXAMPLE-description-Value",
CompartmentId = "ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
IsOobDashboard = true,
IsShowInHome = true,
MetadataVersion = "EXAMPLE-metadataVersion-Value",
IsShowDescription = true,
ScreenImage = "EXAMPLE-screenImage-Value",
Nls = "EXAMPLE-nls-Value",
UiConfig = "EXAMPLE-uiConfig-Value",
DataConfig = new List<Object>
{
"EXAMPLE-dataConfig-Value"
},
Type = "EXAMPLE-type-Value",
IsFavorite = false,
ParametersConfig = new List<Object>
{
"EXAMPLE-parametersConfig-Value"
},
FeaturesConfig = "EXAMPLE-featuresConfig-Value",
DrilldownConfig = new List<Object>
{
"EXAMPLE-drilldownConfig-Value"
},
FreeformTags = new Dictionary<string, string>()
{
{
"EXAMPLE_KEY_7k1yq",
"EXAMPLE_VALUE_DBo1jeWMVrVQLeF12D5T"
}
},
DefinedTags = new Dictionary<string, Dictionary<string, Object>>()
{
{
"EXAMPLE_KEY_FcPeO",
new Dictionary<string, Object>()
{
{
"EXAMPLE_KEY_vGP9Q",
"EXAMPLE--Value"
}
}
}
}
};
var createManagementDashboardRequest = new Oci.ManagementdashboardService.Requests.CreateManagementDashboardRequest
{
CreateManagementDashboardDetails = createManagementDashboardDetails,
OpcRetryToken = "EXAMPLE-opcRetryToken-Value",
OpcRequestId = "ZZCKJ0SP04QWJQP64K5Q<unique_ID>"
};
// Create a default authentication provider that uses the DEFAULT
// profile in the configuration file.
// Refer to <see href="https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm#SDK_and_CLI_Configuration_File>the public documentation</see> on how to prepare a configuration file.
var provider = new ConfigFileAuthenticationDetailsProvider("DEFAULT");
try
{
// Create a service client and send the request.
using (var client = new DashxApisClient(provider, new ClientConfiguration()))
{
var response = await client.CreateManagementDashboard(createManagementDashboardRequest);
// Retrieve value from the response.
var id = response.ManagementDashboard.Id;
}
}
catch (Exception e)
{
Console.WriteLine($"CreateManagementDashboard Failed with {e.Message}");
throw e;
}
}
}
}