Skip to content

Commit d7b336f

Browse files
varmax2511govindrao55
authored andcommitted
Support for Marketplace-Community Catalog
1 parent e6dcfc2 commit d7b336f

File tree

60 files changed

+3228
-234
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+3228
-234
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
- Support save report in cost analysis
66
- Support for Capacity Reservations
77
- Support for Renaming Analytics Service to HeatWave
8+
- Support for Marketplace-Community Catalog
9+
810
## 4.18.0 (March 17, 2021)
911

1012
### Added
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
// Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved.
2+
// Licensed under the Mozilla Public License v2.0
3+
4+
variable "tenancy_ocid" {}
5+
variable "user_ocid" {}
6+
variable "fingerprint" {}
7+
variable "private_key_path" {}
8+
variable "region" {}
9+
variable "compartment_id" {
10+
11+
}
12+
13+
variable "publication_freeform_tags" {
14+
default = { "Department" = "Finance" }
15+
}
16+
17+
variable "publication_is_agreement_acknowledged" {
18+
default = true
19+
}
20+
21+
variable "publication_listing_type" {
22+
default = "COMMUNITY"
23+
}
24+
25+
variable "publication_long_description" {
26+
default = "longDescription"
27+
}
28+
29+
variable "publication_name" {
30+
default = "name"
31+
}
32+
33+
variable "publication_names" {
34+
default = ["name"]
35+
}
36+
37+
variable "publication_operating_systems" {
38+
default = []
39+
}
40+
41+
variable "publication_package_details_eula_eula_type" {
42+
default = "TEXT"
43+
}
44+
45+
variable "publication_package_details_eula_license_text" {
46+
default = "licenseText"
47+
}
48+
49+
variable "publication_package_details_operating_system_name" {
50+
default = "name"
51+
}
52+
53+
variable "publication_package_details_package_type" {
54+
default = "IMAGE"
55+
}
56+
57+
variable "publication_package_details_package_version" {
58+
default = "packageVersion"
59+
}
60+
61+
variable "publication_short_description" {
62+
default = "shortDescription"
63+
}
64+
65+
variable "publication_support_contacts_email" {
66+
default = "email"
67+
}
68+
69+
variable "publication_support_contacts_name" {
70+
default = "name"
71+
}
72+
73+
variable "publication_support_contacts_phone" {
74+
default = "phone"
75+
}
76+
77+
variable "publication_support_contacts_subject" {
78+
default = "subject"
79+
}
80+
81+
variable "image_id" {
82+
83+
}
84+
85+
86+
provider "oci" {
87+
tenancy_ocid = var.tenancy_ocid
88+
user_ocid = var.user_ocid
89+
fingerprint = var.fingerprint
90+
private_key_path = var.private_key_path
91+
region = var.region
92+
}
93+
94+
resource "oci_marketplace_publication" "test_publication" {
95+
#Required
96+
compartment_id = var.compartment_id
97+
is_agreement_acknowledged = var.publication_is_agreement_acknowledged
98+
listing_type = var.publication_listing_type
99+
name = var.publication_name
100+
package_details {
101+
#Required
102+
eula {
103+
#Required
104+
eula_type = var.publication_package_details_eula_eula_type
105+
106+
#Optional
107+
license_text = var.publication_package_details_eula_license_text
108+
}
109+
operating_system {
110+
111+
#Optional
112+
name = var.publication_package_details_operating_system_name
113+
}
114+
package_type = var.publication_package_details_package_type
115+
package_version = var.publication_package_details_package_version
116+
117+
#Required
118+
image_id = var.image_id
119+
}
120+
short_description = var.publication_short_description
121+
support_contacts {
122+
123+
#Optional
124+
email = var.publication_support_contacts_email
125+
name = var.publication_support_contacts_name
126+
phone = var.publication_support_contacts_phone
127+
subject = var.publication_support_contacts_subject
128+
}
129+
130+
#Optional
131+
freeform_tags = var.publication_freeform_tags
132+
long_description = var.publication_long_description
133+
}
134+
135+
data "oci_marketplace_publications" "test_publications" {
136+
#Required
137+
compartment_id = var.compartment_id
138+
listing_type = var.publication_listing_type
139+
140+
#Optional
141+
name = var.publication_names
142+
operating_systems = var.publication_operating_systems
143+
publication_id = oci_marketplace_publication.test_publication.id
144+
}
145+

oci/core_image_data_source.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ func (s *CoreImageDataSourceCrud) SetData() error {
104104
s.D.Set("launch_options", nil)
105105
}
106106

107+
s.D.Set("listing_type", s.Res.ListingType)
108+
107109
if s.Res.OperatingSystem != nil {
108110
s.D.Set("operating_system", *s.Res.OperatingSystem)
109111
}

oci/core_image_resource.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,10 @@ func CoreImageResource() *schema.Resource {
204204
},
205205
},
206206
},
207+
"listing_type": {
208+
Type: schema.TypeString,
209+
Computed: true,
210+
},
207211
"operating_system": {
208212
Type: schema.TypeString,
209213
Computed: true,
@@ -475,6 +479,8 @@ func (s *CoreImageResourceCrud) SetData() error {
475479
s.D.Set("launch_options", nil)
476480
}
477481

482+
s.D.Set("listing_type", s.Res.ListingType)
483+
478484
if s.Res.OperatingSystem != nil {
479485
s.D.Set("operating_system", *s.Res.OperatingSystem)
480486
}

oci/core_images_data_source.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,8 @@ func (s *CoreImagesDataSourceCrud) SetData() error {
203203
image["launch_options"] = nil
204204
}
205205

206+
image["listing_type"] = r.ListingType
207+
206208
if r.OperatingSystem != nil {
207209
image["operating_system"] = *r.OperatingSystem
208210
}

oci/export_definitions.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import (
3232
oci_load_balancer "github.com/oracle/oci-go-sdk/v36/loadbalancer"
3333
oci_logging "github.com/oracle/oci-go-sdk/v36/logging"
3434
oci_management_agent "github.com/oracle/oci-go-sdk/v36/managementagent"
35+
oci_marketplace "github.com/oracle/oci-go-sdk/v36/marketplace"
3536
oci_monitoring "github.com/oracle/oci-go-sdk/v36/monitoring"
3637
oci_mysql "github.com/oracle/oci-go-sdk/v36/mysql"
3738
oci_nosql "github.com/oracle/oci-go-sdk/v36/nosql"
@@ -1586,6 +1587,17 @@ var exportMarketplaceAcceptedAgreementHints = &TerraformResourceHints{
15861587
requireResourceRefresh: true,
15871588
}
15881589

1590+
var exportMarketplacePublicationHints = &TerraformResourceHints{
1591+
resourceClass: "oci_marketplace_publication",
1592+
datasourceClass: "oci_marketplace_publications",
1593+
datasourceItemsAttr: "publications",
1594+
resourceAbbreviation: "publication",
1595+
requireResourceRefresh: true,
1596+
discoverableLifecycleStates: []string{
1597+
string(oci_marketplace.PublicationLifecycleStateActive),
1598+
},
1599+
}
1600+
15891601
var exportMeteringComputationQueryHints = &TerraformResourceHints{
15901602
resourceClass: "oci_metering_computation_query",
15911603
datasourceClass: "oci_metering_computation_queries",

0 commit comments

Comments
 (0)