# 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).
require '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::ConfigFileLoader.load_config
# Initialize service client with default config file
marketplace_publisher_client =
OCI::MarketplacePublisher::MarketplacePublisherClient.new(config: config)
# Send the request to service, some parameters are not required, see API doc for more info
create_artifact_response =
marketplace_publisher_client.create_artifact(
OCI::MarketplacePublisher::Models::CreateMachineImageArtifactDetails.new(
artifact_type: 'MACHINE_IMAGE',
compartment_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value',
machine_image:
OCI::MarketplacePublisher::Models::CreateMachineImageDetails.new(
source_image_id:
'ocid1.test.oc1..<unique_ID>EXAMPLE-sourceImageId-Value',
is_snapshot_allowed: true,
image_shape_compatibility_entries: [
OCI::MarketplacePublisher::Models::ImageShapeCompatibility.new(
shape: 'EXAMPLE-shape-Value',
memory_constraints:
OCI::MarketplacePublisher::Models::ImageMemoryConstraints.new(
min_in_gbs: 891, max_in_gbs: 398
),
ocpu_constraints:
OCI::MarketplacePublisher::Models::ImageOcpuConstraints.new(
min: 180, max: 228
)
)
],
username: 'EXAMPLE-username-Value'
),
display_name: 'EXAMPLE-displayName-Value',
freeform_tags: {
'EXAMPLE_KEY_kHhuF' => 'EXAMPLE_VALUE_tbrg6GR7suQulCSC9lif'
},
defined_tags: {
'EXAMPLE_KEY_cRIWZ' => { 'EXAMPLE_KEY_MtbCC' => 'EXAMPLE--Value' }
}
)
)
# Get the data from response
puts "#{create_artifact_response.headers}"