Skip to content

Commit

Permalink
Merge pull request #612 from samira-barouti/sbarouti-update-model-0.0…
Browse files Browse the repository at this point in the history
….186

Updated model to v0.0.186
  • Loading branch information
jhernand authored Mar 31, 2022
2 parents 6d61e21 + 3de3161 commit 9fa41bf
Show file tree
Hide file tree
Showing 8 changed files with 974 additions and 896 deletions.
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
This document describes the relevant changes between releases of the OCM API
SDK.

## 0.1.255 Mar 30 2022

- Update to model 0.0.186:
- Add ManagementCluster to ProvisionShard


## 0.1.254 Mar 30 2022

- Update to model 0.0.185:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
export CGO_ENABLED=0

# Details of the model to use:
model_version:=v0.0.185
model_version:=v0.0.186
model_url:=https://github.com/openshift-online/ocm-api-model.git

# Details of the metamodel to use:
Expand Down
1,793 changes: 905 additions & 888 deletions clustersmgmt/v1/openapi.go

Large diffs are not rendered by default.

16 changes: 14 additions & 2 deletions clustersmgmt/v1/provision_shard_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ type ProvisionShardBuilder struct {
gcpProjectOperator *ServerConfigBuilder
cloudProvider *CloudProviderBuilder
hiveConfig *ServerConfigBuilder
managementCluster string
region *CloudRegionBuilder
}

Expand Down Expand Up @@ -135,15 +136,24 @@ func (b *ProvisionShardBuilder) HiveConfig(value *ServerConfigBuilder) *Provisio
return b
}

// ManagementCluster sets the value of the 'management_cluster' attribute to the given value.
//
//
func (b *ProvisionShardBuilder) ManagementCluster(value string) *ProvisionShardBuilder {
b.managementCluster = value
b.bitmap_ |= 512
return b
}

// Region sets the value of the 'region' attribute to the given value.
//
// Description of a region of a cloud provider.
func (b *ProvisionShardBuilder) Region(value *CloudRegionBuilder) *ProvisionShardBuilder {
b.region = value
if value != nil {
b.bitmap_ |= 512
b.bitmap_ |= 1024
} else {
b.bitmap_ &^= 512
b.bitmap_ &^= 1024
}
return b
}
Expand Down Expand Up @@ -178,6 +188,7 @@ func (b *ProvisionShardBuilder) Copy(object *ProvisionShard) *ProvisionShardBuil
} else {
b.hiveConfig = nil
}
b.managementCluster = object.managementCluster
if object.region != nil {
b.region = NewCloudRegion().Copy(object.region)
} else {
Expand Down Expand Up @@ -218,6 +229,7 @@ func (b *ProvisionShardBuilder) Build() (object *ProvisionShard, err error) {
return
}
}
object.managementCluster = b.managementCluster
if b.region != nil {
object.region, err = b.region.Build()
if err != nil {
Expand Down
30 changes: 28 additions & 2 deletions clustersmgmt/v1/provision_shard_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ type ProvisionShard struct {
gcpProjectOperator *ServerConfig
cloudProvider *CloudProvider
hiveConfig *ServerConfig
managementCluster string
region *CloudRegion
}

Expand Down Expand Up @@ -242,12 +243,37 @@ func (o *ProvisionShard) GetHiveConfig() (value *ServerConfig, ok bool) {
return
}

// ManagementCluster returns the value of the 'management_cluster' attribute, or
// the zero value of the type if the attribute doesn't have a value.
//
// Contains the name of the managment cluster for Hypershift clusters that are assigned to this shard.
// This field is populated by OCM, and must not be overwritten via API.
func (o *ProvisionShard) ManagementCluster() string {
if o != nil && o.bitmap_&512 != 0 {
return o.managementCluster
}
return ""
}

// GetManagementCluster returns the value of the 'management_cluster' attribute and
// a flag indicating if the attribute has a value.
//
// Contains the name of the managment cluster for Hypershift clusters that are assigned to this shard.
// This field is populated by OCM, and must not be overwritten via API.
func (o *ProvisionShard) GetManagementCluster() (value string, ok bool) {
ok = o != nil && o.bitmap_&512 != 0
if ok {
value = o.managementCluster
}
return
}

// Region returns the value of the 'region' attribute, or
// the zero value of the type if the attribute doesn't have a value.
//
// Contains the cloud-provider region in which the provisioner spins up the cluster
func (o *ProvisionShard) Region() *CloudRegion {
if o != nil && o.bitmap_&512 != 0 {
if o != nil && o.bitmap_&1024 != 0 {
return o.region
}
return nil
Expand All @@ -258,7 +284,7 @@ func (o *ProvisionShard) Region() *CloudRegion {
//
// Contains the cloud-provider region in which the provisioner spins up the cluster
func (o *ProvisionShard) GetRegion() (value *CloudRegion, ok bool) {
ok = o != nil && o.bitmap_&512 != 0
ok = o != nil && o.bitmap_&1024 != 0
if ok {
value = o.region
}
Expand Down
17 changes: 15 additions & 2 deletions clustersmgmt/v1/provision_shard_type_json.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,16 @@ func writeProvisionShard(object *ProvisionShard, stream *jsoniter.Stream) {
writeServerConfig(object.hiveConfig, stream)
count++
}
present_ = object.bitmap_&512 != 0 && object.region != nil
present_ = object.bitmap_&512 != 0
if present_ {
if count > 0 {
stream.WriteMore()
}
stream.WriteObjectField("management_cluster")
stream.WriteString(object.managementCluster)
count++
}
present_ = object.bitmap_&1024 != 0 && object.region != nil
if present_ {
if count > 0 {
stream.WriteMore()
Expand Down Expand Up @@ -186,10 +195,14 @@ func readProvisionShard(iterator *jsoniter.Iterator) *ProvisionShard {
value := readServerConfig(iterator)
object.hiveConfig = value
object.bitmap_ |= 256
case "management_cluster":
value := iterator.ReadString()
object.managementCluster = value
object.bitmap_ |= 512
case "region":
value := readCloudRegion(iterator)
object.region = value
object.bitmap_ |= 512
object.bitmap_ |= 1024
default:
iterator.ReadAny()
}
Expand Down
4 changes: 4 additions & 0 deletions openapi/clusters_mgmt/v1/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -9523,6 +9523,10 @@
"description": "Contains the configuration for Hive",
"$ref": "#/components/schemas/ServerConfig"
},
"management_cluster": {
"description": "Contains the name of the managment cluster for Hypershift clusters that are assigned to this shard.\nThis field is populated by OCM, and must not be overwritten via API.",
"type": "string"
},
"region": {
"description": "Contains the cloud-provider region in which the provisioner spins up the cluster",
"$ref": "#/components/schemas/CloudRegion"
Expand Down
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ limitations under the License.

package sdk

const Version = "0.1.254"
const Version = "0.1.255"

0 comments on commit 9fa41bf

Please sign in to comment.