Skip to content

Commit 33600f5

Browse files
Sparsh SrivastavaNagaRajuPasunuri
authored andcommitted
Added - Capacity Management release 3.1 support
1 parent 54af481 commit 33600f5

File tree

57 files changed

+4183
-377
lines changed

Some content is hidden

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

57 files changed

+4183
-377
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// Copyright (c) 2017, 2024, 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+
variable "internal_namespace_occ_overview_from" {
12+
default = "2023-08-05T17:17:14.816Z"
13+
}
14+
15+
variable "internal_namespace_occ_overview_namespace" {
16+
default = "COMPUTE"
17+
}
18+
19+
variable "internal_namespace_occ_overview_to" {
20+
default = "2023-10-05T17:17:14.816Z"
21+
}
22+
23+
variable "internal_namespace_occ_overview_workload_type" {
24+
default = "workloadType"
25+
}
26+
27+
variable "occ_customer_group_id" {
28+
default = "customerGroupId"
29+
}
30+
31+
32+
provider "oci" {
33+
tenancy_ocid = var.tenancy_ocid
34+
user_ocid = var.user_ocid
35+
fingerprint = var.fingerprint
36+
private_key_path = var.private_key_path
37+
region = var.region
38+
}
39+
40+
data "oci_capacity_management_internal_namespace_occ_overviews" "test_internal_namespace_occ_overviews" {
41+
#Required
42+
compartment_id = var.compartment_id
43+
namespace = var.internal_namespace_occ_overview_namespace
44+
occ_customer_group_id = var.occ_customer_group_id
45+
46+
#Optional
47+
from = var.internal_namespace_occ_overview_from
48+
to = var.internal_namespace_occ_overview_to
49+
workload_type = var.internal_namespace_occ_overview_workload_type
50+
}

examples/capacity_management/InternalOccAvailabilityCatalogs/internal_occ_availability_catalog.tf

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved.
1+
// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
22
// Licensed under the Mozilla Public License v2.0
33

44
variable "tenancy_ocid" {}
@@ -9,7 +9,7 @@ variable "region" {}
99
variable "compartment_id" {}
1010

1111
variable "internal_occ_availability_catalog_catalog_state" {
12-
default = "NOT_UPLOADED"
12+
default = "STAGED"
1313
}
1414

1515
variable "internal_occ_availability_catalog_display_name" {
@@ -24,7 +24,9 @@ variable "internal_occ_availability_catalog_namespace" {
2424
default = "COMPUTE"
2525
}
2626

27-
27+
variable "occ_customer_group_id" {
28+
default = "customerGroupId"
29+
}
2830

2931
provider "oci" {
3032
tenancy_ocid = var.tenancy_ocid
@@ -36,12 +38,12 @@ provider "oci" {
3638

3739
data "oci_capacity_management_internal_occ_availability_catalogs" "test_internal_occ_availability_catalogs" {
3840
#Required
39-
compartment_id = var.compartment_id
41+
compartment_id = var.compartment_id
42+
occ_customer_group_id = var.occ_customer_group_id
4043

4144
#Optional
42-
catalog_state = var.internal_occ_availability_catalog_catalog_state
43-
display_name = var.internal_occ_availability_catalog_display_name
44-
id = var.internal_occ_availability_catalog_id
45-
namespace = var.internal_occ_availability_catalog_namespace
46-
occ_customer_group_id = oci_capacity_management_occ_customer_group.test_occ_customer_group.id
45+
catalog_state = var.internal_occ_availability_catalog_catalog_state
46+
display_name = var.internal_occ_availability_catalog_display_name
47+
id = var.internal_occ_availability_catalog_id
48+
namespace = var.internal_occ_availability_catalog_namespace
4749
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// Copyright (c) 2017, 2024, 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+
10+
variable "occ_handover_resource_block_id" {
11+
default = "handoverResourceBlockId"
12+
}
13+
14+
variable "occ_handover_resource_host_id" {
15+
default = "hostId"
16+
}
17+
18+
19+
provider "oci" {
20+
tenancy_ocid = var.tenancy_ocid
21+
user_ocid = var.user_ocid
22+
fingerprint = var.fingerprint
23+
private_key_path = var.private_key_path
24+
region = var.region
25+
}
26+
27+
data "oci_capacity_management_internal_occ_handover_resource_block_details" "test_internal_occ_handover_resource_block_details" {
28+
#Required
29+
occ_handover_resource_block_id = var.occ_handover_resource_block_id
30+
31+
#Optional
32+
host_id = var.occ_handover_resource_host_id
33+
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
// Copyright (c) 2017, 2024, 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+
variable "internal_occ_handover_resource_block_handover_date_greater_than_or_equal_to" {
12+
default = "2023-08-05T17:17:14.816Z"
13+
}
14+
15+
variable "internal_occ_handover_resource_block_handover_date_less_than_or_equal_to" {
16+
default = "2024-08-05T17:17:14.816Z"
17+
}
18+
19+
variable "internal_occ_handover_resource_block_namespace" {
20+
default = "COMPUTE"
21+
}
22+
23+
variable "occ_customer_group_id" {
24+
default = "customerGroupId"
25+
}
26+
27+
variable "occ_handover_resource_block_id" {
28+
default = "handoverResourceBlockId"
29+
}
30+
31+
variable "occ_handover_resource_resource_name" {
32+
default = "handoverResource"
33+
}
34+
35+
36+
37+
provider "oci" {
38+
tenancy_ocid = var.tenancy_ocid
39+
user_ocid = var.user_ocid
40+
fingerprint = var.fingerprint
41+
private_key_path = var.private_key_path
42+
region = var.region
43+
}
44+
45+
data "oci_capacity_management_internal_occ_handover_resource_blocks" "test_internal_occ_handover_resource_blocks" {
46+
#Required
47+
compartment_id = var.compartment_id
48+
namespace = var.internal_occ_handover_resource_block_namespace
49+
occ_customer_group_id = var.occ_customer_group_id
50+
51+
#Optional
52+
handover_date_greater_than_or_equal_to = var.internal_occ_handover_resource_block_handover_date_greater_than_or_equal_to
53+
handover_date_less_than_or_equal_to = var.internal_occ_handover_resource_block_handover_date_less_than_or_equal_to
54+
handover_resource_name = var.occ_handover_resource_resource_name
55+
occ_handover_resource_block_id = var.occ_handover_resource_block_id
56+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// Copyright (c) 2017, 2024, 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+
variable "namespace_occ_overview_from" {
12+
default = "2023-08-05T17:17:14.816Z"
13+
}
14+
15+
variable "namespace_occ_overview_namespace" {
16+
default = "COMPUTE"
17+
}
18+
19+
variable "namespace_occ_overview_to" {
20+
default = "2024-08-05T17:17:14.816Z"
21+
}
22+
23+
variable "namespace_occ_overview_workload_type" {
24+
default = "workloadType"
25+
}
26+
27+
28+
29+
provider "oci" {
30+
tenancy_ocid = var.tenancy_ocid
31+
user_ocid = var.user_ocid
32+
fingerprint = var.fingerprint
33+
private_key_path = var.private_key_path
34+
region = var.region
35+
}
36+
37+
data "oci_capacity_management_namespace_occ_overviews" "test_namespace_occ_overviews" {
38+
#Required
39+
compartment_id = var.compartment_id
40+
namespace = var.namespace_occ_overview_namespace
41+
42+
#Optional
43+
from = var.namespace_occ_overview_from
44+
to = var.namespace_occ_overview_to
45+
workload_type = var.namespace_occ_overview_workload_type
46+
}

examples/capacity_management/OccCapacityRequests/occ_capacity_request.tf

Lines changed: 62 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved.
1+
// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
22
// Licensed under the Mozilla Public License v2.0
33

44
variable "tenancy_ocid" {}
@@ -13,7 +13,7 @@ variable "occ_capacity_request_availability_domain" {
1313
}
1414

1515
variable "occ_capacity_request_date_expected_capacity_handover" {
16-
default = "2023/12/17"
16+
default = "2023-08-05T17:17:14.816Z"
1717
}
1818

1919
variable "occ_capacity_request_defined_tags_value" {
@@ -28,12 +28,20 @@ variable "occ_capacity_request_details_actual_handover_quantity" {
2828
default = 10
2929
}
3030

31+
variable "occ_capacity_request_details_associated_occ_handover_resource_block_list_handover_quantity" {
32+
default = 10
33+
}
34+
35+
variable "occ_capacity_request_details_availability_domain" {
36+
default = "availabilityDomain"
37+
}
38+
3139
variable "occ_capacity_request_details_date_actual_handover" {
32-
default = "dateActualHandover"
40+
default = "2023-08-05T17:17:14.816Z"
3341
}
3442

3543
variable "occ_capacity_request_details_date_expected_handover" {
36-
default = "dateExpectedHandover"
44+
default = "2023-08-05T17:17:14.816Z"
3745
}
3846

3947
variable "occ_capacity_request_details_demand_quantity" {
@@ -48,6 +56,10 @@ variable "occ_capacity_request_details_resource_type" {
4856
default = "SERVER_HW"
4957
}
5058

59+
variable "occ_capacity_request_details_source_workload_type" {
60+
default = "sourceWorkloadType"
61+
}
62+
5163
variable "occ_capacity_request_details_workload_type" {
5264
default = "GENERIC"
5365
}
@@ -80,6 +92,18 @@ variable "occ_capacity_request_request_state" {
8092
default = "SUBMITTED"
8193
}
8294

95+
variable "occ_capacity_request_request_type" {
96+
default = "NEW"
97+
}
98+
99+
variable "occ_capacity_request_resource_name" {
100+
default="resourceName"
101+
}
102+
103+
variable "occ_availability_catalog_id" {
104+
default = "catalogId"
105+
}
106+
83107

84108

85109
provider "oci" {
@@ -92,46 +116,55 @@ provider "oci" {
92116

93117
resource "oci_capacity_management_occ_capacity_request" "test_occ_capacity_request" {
94118
#Required
95-
availability_domain = var.occ_capacity_request_availability_domain
96119
compartment_id = var.compartment_id
97120
date_expected_capacity_handover = var.occ_capacity_request_date_expected_capacity_handover
98121
details {
99122
#Required
100123
demand_quantity = var.occ_capacity_request_details_demand_quantity
101-
resource_name = oci_usage_proxy_resource.test_resource.name
124+
resource_name = var.occ_capacity_request_resource_name
102125
resource_type = var.occ_capacity_request_details_resource_type
103126
workload_type = var.occ_capacity_request_details_workload_type
104127

105128
#Optional
106-
actual_handover_quantity = var.occ_capacity_request_details_actual_handover_quantity
107-
date_actual_handover = var.occ_capacity_request_details_date_actual_handover
108-
date_expected_handover = var.occ_capacity_request_details_date_expected_handover
109-
expected_handover_quantity = var.occ_capacity_request_details_expected_handover_quantity
129+
# actual_handover_quantity = var.occ_capacity_request_details_actual_handover_quantity
130+
# associated_occ_handover_resource_block_list {
131+
#
132+
# #Optional
133+
# handover_quantity = var.occ_capacity_request_details_associated_occ_handover_resource_block_list_handover_quantity
134+
# occ_handover_resource_block_id = oci_capacity_management_occ_handover_resource_block.test_occ_handover_resource_block.id
135+
# }
136+
# availability_domain = var.occ_capacity_request_details_availability_domain
137+
# date_actual_handover = var.occ_capacity_request_details_date_actual_handover
138+
# date_expected_handover = var.occ_capacity_request_details_date_expected_handover
139+
# expected_handover_quantity = var.occ_capacity_request_details_expected_handover_quantity
140+
# source_workload_type = var.occ_capacity_request_details_source_workload_type
110141
}
111142
display_name = var.occ_capacity_request_display_name
112143
namespace = var.occ_capacity_request_namespace
113-
occ_availability_catalog_id = oci_capacity_management_occ_availability_catalog.test_occ_availability_catalog.id
114-
occ_capacity_request_id = var.occ_capacity_request_occ_capacity_request_id
144+
occ_availability_catalog_id = var.occ_availability_catalog_id
145+
# occ_capacity_request_id = var.occ_capacity_request_occ_capacity_request_id
115146
region = var.occ_capacity_request_region
116147

117148
#Optional
118-
defined_tags = map(oci_identity_tag_namespace.tag-namespace1.name.oci_identity_tag.tag1.name, var.occ_capacity_request_defined_tags_value)
119-
description = var.occ_capacity_request_description
120-
freeform_tags = var.occ_capacity_request_freeform_tags
121-
lifecycle_details = var.occ_capacity_request_lifecycle_details
122-
patch_operations {
123-
#Required
124-
operation = var.occ_capacity_request_patch_operations_operation
125-
selection = var.occ_capacity_request_patch_operations_selection
126-
127-
#Optional
128-
from = var.occ_capacity_request_patch_operations_from
129-
position = var.occ_capacity_request_patch_operations_position
130-
selected_item = var.occ_capacity_request_patch_operations_selected_item
131-
value = var.occ_capacity_request_patch_operations_value
132-
values = var.occ_capacity_request_patch_operations_values
133-
}
149+
availability_domain = var.occ_capacity_request_availability_domain
150+
defined_tags = map(oci_identity_tag_namespace.tag-namespace1.name.oci_identity_tag.tag1.name, var.occ_capacity_request_defined_tags_value)
151+
description = var.occ_capacity_request_description
152+
freeform_tags = var.occ_capacity_request_freeform_tags
153+
lifecycle_details = var.occ_capacity_request_lifecycle_details
154+
# patch_operations {
155+
# #Required
156+
# operation = var.occ_capacity_request_patch_operations_operation
157+
# selection = var.occ_capacity_request_patch_operations_selection
158+
#
159+
# #Optional
160+
# from = var.occ_capacity_request_patch_operations_from
161+
# position = var.occ_capacity_request_patch_operations_position
162+
# selected_item = var.occ_capacity_request_patch_operations_selected_item
163+
# value = var.occ_capacity_request_patch_operations_value
164+
# values = var.occ_capacity_request_patch_operations_values
165+
# }
134166
request_state = var.occ_capacity_request_request_state
167+
request_type = var.occ_capacity_request_request_type
135168
}
136169

137170
data "oci_capacity_management_occ_capacity_requests" "test_occ_capacity_requests" {
@@ -143,4 +176,5 @@ data "oci_capacity_management_occ_capacity_requests" "test_occ_capacity_requests
143176
id = var.occ_capacity_request_id
144177
namespace = var.occ_capacity_request_namespace
145178
occ_availability_catalog_id = oci_capacity_management_occ_availability_catalog.test_occ_availability_catalog.id
179+
request_type = var.occ_capacity_request_request_type
146180
}

0 commit comments

Comments
 (0)