Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OCM-3746 | feat: bump api-model to v0.0.322 #841

Merged
merged 2 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.370
- Update model version to v0.0.322
- Add AdditionalComputeSecurityGroupIds to AWS type
- Add AdditionalSecurityGroupIds to AWS Machine Pool type
- Add AwsSecurityGroups to VPC type

## 0.1.369
- Update model version to v0.0.321
- Exposes `/api/clusters_mgmt/v1/aws_inquiries/sts_account_roles` in the SDK
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.321
model_version:=v0.0.322
model_url:=https://github.com/openshift-online/ocm-api-model.git

# Details of the metamodel to use:
Expand Down
81 changes: 50 additions & 31 deletions clustersmgmt/v1/aws_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,23 @@ package v1 // github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1
//
// _Amazon Web Services_ specific settings of a cluster.
type AWSBuilder struct {
bitmap_ uint32
kmsKeyArn string
sts *STSBuilder
accessKeyID string
accountID string
auditLog *AuditLogBuilder
billingAccountID string
ec2MetadataHttpTokens Ec2MetadataHttpTokens
etcdEncryption *AwsEtcdEncryptionBuilder
privateHostedZoneID string
privateHostedZoneRoleARN string
privateLinkConfiguration *PrivateLinkClusterConfigurationBuilder
secretAccessKey string
subnetIDs []string
tags map[string]string
privateLink bool
bitmap_ uint32
kmsKeyArn string
sts *STSBuilder
accessKeyID string
accountID string
additionalComputeSecurityGroupIds []string
auditLog *AuditLogBuilder
billingAccountID string
ec2MetadataHttpTokens Ec2MetadataHttpTokens
etcdEncryption *AwsEtcdEncryptionBuilder
privateHostedZoneID string
privateHostedZoneRoleARN string
privateLinkConfiguration *PrivateLinkClusterConfigurationBuilder
secretAccessKey string
subnetIDs []string
tags map[string]string
privateLink bool
}

// NewAWS creates a new builder of 'AWS' objects.
Expand Down Expand Up @@ -85,23 +86,31 @@ func (b *AWSBuilder) AccountID(value string) *AWSBuilder {
return b
}

// AdditionalComputeSecurityGroupIds sets the value of the 'additional_compute_security_group_ids' attribute to the given values.
func (b *AWSBuilder) AdditionalComputeSecurityGroupIds(values ...string) *AWSBuilder {
b.additionalComputeSecurityGroupIds = make([]string, len(values))
copy(b.additionalComputeSecurityGroupIds, values)
b.bitmap_ |= 16
return b
}

// AuditLog sets the value of the 'audit_log' attribute to the given value.
//
// Contains the necessary attributes to support audit log forwarding
func (b *AWSBuilder) AuditLog(value *AuditLogBuilder) *AWSBuilder {
b.auditLog = value
if value != nil {
b.bitmap_ |= 16
b.bitmap_ |= 32
} else {
b.bitmap_ &^= 16
b.bitmap_ &^= 32
}
return b
}

// BillingAccountID sets the value of the 'billing_account_ID' attribute to the given value.
func (b *AWSBuilder) BillingAccountID(value string) *AWSBuilder {
b.billingAccountID = value
b.bitmap_ |= 32
b.bitmap_ |= 64
return b
}

Expand All @@ -110,7 +119,7 @@ func (b *AWSBuilder) BillingAccountID(value string) *AWSBuilder {
// Which Ec2MetadataHttpTokens to use for metadata service interaction options for EC2 instances
func (b *AWSBuilder) Ec2MetadataHttpTokens(value Ec2MetadataHttpTokens) *AWSBuilder {
b.ec2MetadataHttpTokens = value
b.bitmap_ |= 64
b.bitmap_ |= 128
return b
}

Expand All @@ -120,31 +129,31 @@ func (b *AWSBuilder) Ec2MetadataHttpTokens(value Ec2MetadataHttpTokens) *AWSBuil
func (b *AWSBuilder) EtcdEncryption(value *AwsEtcdEncryptionBuilder) *AWSBuilder {
b.etcdEncryption = value
if value != nil {
b.bitmap_ |= 128
b.bitmap_ |= 256
} else {
b.bitmap_ &^= 128
b.bitmap_ &^= 256
}
return b
}

// PrivateHostedZoneID sets the value of the 'private_hosted_zone_ID' attribute to the given value.
func (b *AWSBuilder) PrivateHostedZoneID(value string) *AWSBuilder {
b.privateHostedZoneID = value
b.bitmap_ |= 256
b.bitmap_ |= 512
return b
}

// PrivateHostedZoneRoleARN sets the value of the 'private_hosted_zone_role_ARN' attribute to the given value.
func (b *AWSBuilder) PrivateHostedZoneRoleARN(value string) *AWSBuilder {
b.privateHostedZoneRoleARN = value
b.bitmap_ |= 512
b.bitmap_ |= 1024
return b
}

// PrivateLink sets the value of the 'private_link' attribute to the given value.
func (b *AWSBuilder) PrivateLink(value bool) *AWSBuilder {
b.privateLink = value
b.bitmap_ |= 1024
b.bitmap_ |= 2048
return b
}

Expand All @@ -154,35 +163,35 @@ func (b *AWSBuilder) PrivateLink(value bool) *AWSBuilder {
func (b *AWSBuilder) PrivateLinkConfiguration(value *PrivateLinkClusterConfigurationBuilder) *AWSBuilder {
b.privateLinkConfiguration = value
if value != nil {
b.bitmap_ |= 2048
b.bitmap_ |= 4096
} else {
b.bitmap_ &^= 2048
b.bitmap_ &^= 4096
}
return b
}

// SecretAccessKey sets the value of the 'secret_access_key' attribute to the given value.
func (b *AWSBuilder) SecretAccessKey(value string) *AWSBuilder {
b.secretAccessKey = value
b.bitmap_ |= 4096
b.bitmap_ |= 8192
return b
}

// SubnetIDs sets the value of the 'subnet_IDs' attribute to the given values.
func (b *AWSBuilder) SubnetIDs(values ...string) *AWSBuilder {
b.subnetIDs = make([]string, len(values))
copy(b.subnetIDs, values)
b.bitmap_ |= 8192
b.bitmap_ |= 16384
return b
}

// Tags sets the value of the 'tags' attribute to the given value.
func (b *AWSBuilder) Tags(value map[string]string) *AWSBuilder {
b.tags = value
if value != nil {
b.bitmap_ |= 16384
b.bitmap_ |= 32768
} else {
b.bitmap_ &^= 16384
b.bitmap_ &^= 32768
}
return b
}
Expand All @@ -201,6 +210,12 @@ func (b *AWSBuilder) Copy(object *AWS) *AWSBuilder {
}
b.accessKeyID = object.accessKeyID
b.accountID = object.accountID
if object.additionalComputeSecurityGroupIds != nil {
b.additionalComputeSecurityGroupIds = make([]string, len(object.additionalComputeSecurityGroupIds))
copy(b.additionalComputeSecurityGroupIds, object.additionalComputeSecurityGroupIds)
} else {
b.additionalComputeSecurityGroupIds = nil
}
if object.auditLog != nil {
b.auditLog = NewAuditLog().Copy(object.auditLog)
} else {
Expand Down Expand Up @@ -252,6 +267,10 @@ func (b *AWSBuilder) Build() (object *AWS, err error) {
}
object.accessKeyID = b.accessKeyID
object.accountID = b.accountID
if b.additionalComputeSecurityGroupIds != nil {
object.additionalComputeSecurityGroupIds = make([]string, len(b.additionalComputeSecurityGroupIds))
copy(object.additionalComputeSecurityGroupIds, b.additionalComputeSecurityGroupIds)
}
if b.auditLog != nil {
object.auditLog, err = b.auditLog.Build()
if err != nil {
Expand Down
31 changes: 25 additions & 6 deletions clustersmgmt/v1/aws_machine_pool_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ package v1 // github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1
//
// Representation of aws machine pool specific parameters.
type AWSMachinePoolBuilder struct {
bitmap_ uint32
id string
href string
spotMarketOptions *AWSSpotMarketOptionsBuilder
bitmap_ uint32
id string
href string
additionalSecurityGroupIds []string
spotMarketOptions *AWSSpotMarketOptionsBuilder
}

// NewAWSMachinePool creates a new builder of 'AWS_machine_pool' objects.
Expand Down Expand Up @@ -59,15 +60,23 @@ func (b *AWSMachinePoolBuilder) Empty() bool {
return b == nil || b.bitmap_&^1 == 0
}

// AdditionalSecurityGroupIds sets the value of the 'additional_security_group_ids' attribute to the given values.
func (b *AWSMachinePoolBuilder) AdditionalSecurityGroupIds(values ...string) *AWSMachinePoolBuilder {
b.additionalSecurityGroupIds = make([]string, len(values))
copy(b.additionalSecurityGroupIds, values)
b.bitmap_ |= 8
return b
}

// SpotMarketOptions sets the value of the 'spot_market_options' attribute to the given value.
//
// Spot market options for AWS machine pool.
func (b *AWSMachinePoolBuilder) SpotMarketOptions(value *AWSSpotMarketOptionsBuilder) *AWSMachinePoolBuilder {
b.spotMarketOptions = value
if value != nil {
b.bitmap_ |= 8
b.bitmap_ |= 16
} else {
b.bitmap_ &^= 8
b.bitmap_ &^= 16
}
return b
}
Expand All @@ -80,6 +89,12 @@ func (b *AWSMachinePoolBuilder) Copy(object *AWSMachinePool) *AWSMachinePoolBuil
b.bitmap_ = object.bitmap_
b.id = object.id
b.href = object.href
if object.additionalSecurityGroupIds != nil {
b.additionalSecurityGroupIds = make([]string, len(object.additionalSecurityGroupIds))
copy(b.additionalSecurityGroupIds, object.additionalSecurityGroupIds)
} else {
b.additionalSecurityGroupIds = nil
}
if object.spotMarketOptions != nil {
b.spotMarketOptions = NewAWSSpotMarketOptions().Copy(object.spotMarketOptions)
} else {
Expand All @@ -94,6 +109,10 @@ func (b *AWSMachinePoolBuilder) Build() (object *AWSMachinePool, err error) {
object.id = b.id
object.href = b.href
object.bitmap_ = b.bitmap_
if b.additionalSecurityGroupIds != nil {
object.additionalSecurityGroupIds = make([]string, len(b.additionalSecurityGroupIds))
copy(object.additionalSecurityGroupIds, b.additionalSecurityGroupIds)
}
if b.spotMarketOptions != nil {
object.spotMarketOptions, err = b.spotMarketOptions.Build()
if err != nil {
Expand Down
36 changes: 30 additions & 6 deletions clustersmgmt/v1/aws_machine_pool_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,11 @@ const AWSMachinePoolNilKind = "AWSMachinePoolNil"
//
// Representation of aws machine pool specific parameters.
type AWSMachinePool struct {
bitmap_ uint32
id string
href string
spotMarketOptions *AWSSpotMarketOptions
bitmap_ uint32
id string
href string
additionalSecurityGroupIds []string
spotMarketOptions *AWSSpotMarketOptions
}

// Kind returns the name of the type of the object.
Expand Down Expand Up @@ -98,12 +99,35 @@ func (o *AWSMachinePool) Empty() bool {
return o == nil || o.bitmap_&^1 == 0
}

// AdditionalSecurityGroupIds returns the value of the 'additional_security_group_ids' attribute, or
// the zero value of the type if the attribute doesn't have a value.
//
// Additional AWS Security Groups to be added machine pool. Note that machine pools can only be worker node at the time.
func (o *AWSMachinePool) AdditionalSecurityGroupIds() []string {
if o != nil && o.bitmap_&8 != 0 {
return o.additionalSecurityGroupIds
}
return nil
}

// GetAdditionalSecurityGroupIds returns the value of the 'additional_security_group_ids' attribute and
// a flag indicating if the attribute has a value.
//
// Additional AWS Security Groups to be added machine pool. Note that machine pools can only be worker node at the time.
func (o *AWSMachinePool) GetAdditionalSecurityGroupIds() (value []string, ok bool) {
ok = o != nil && o.bitmap_&8 != 0
if ok {
value = o.additionalSecurityGroupIds
}
return
}

// SpotMarketOptions returns the value of the 'spot_market_options' attribute, or
// the zero value of the type if the attribute doesn't have a value.
//
// Use spot instances on this machine pool to reduce cost.
func (o *AWSMachinePool) SpotMarketOptions() *AWSSpotMarketOptions {
if o != nil && o.bitmap_&8 != 0 {
if o != nil && o.bitmap_&16 != 0 {
return o.spotMarketOptions
}
return nil
Expand All @@ -114,7 +138,7 @@ func (o *AWSMachinePool) SpotMarketOptions() *AWSSpotMarketOptions {
//
// Use spot instances on this machine pool to reduce cost.
func (o *AWSMachinePool) GetSpotMarketOptions() (value *AWSSpotMarketOptions, ok bool) {
ok = o != nil && o.bitmap_&8 != 0
ok = o != nil && o.bitmap_&16 != 0
if ok {
value = o.spotMarketOptions
}
Expand Down
17 changes: 15 additions & 2 deletions clustersmgmt/v1/aws_machine_pool_type_json.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,16 @@ func writeAWSMachinePool(object *AWSMachinePool, stream *jsoniter.Stream) {
count++
}
var present_ bool
present_ = object.bitmap_&8 != 0 && object.spotMarketOptions != nil
present_ = object.bitmap_&8 != 0 && object.additionalSecurityGroupIds != nil
if present_ {
if count > 0 {
stream.WriteMore()
}
stream.WriteObjectField("additional_security_group_ids")
writeStringList(object.additionalSecurityGroupIds, stream)
count++
}
present_ = object.bitmap_&16 != 0 && object.spotMarketOptions != nil
if present_ {
if count > 0 {
stream.WriteMore()
Expand Down Expand Up @@ -108,10 +117,14 @@ func readAWSMachinePool(iterator *jsoniter.Iterator) *AWSMachinePool {
case "href":
object.href = iterator.ReadString()
object.bitmap_ |= 4
case "additional_security_group_ids":
value := readStringList(iterator)
object.additionalSecurityGroupIds = value
object.bitmap_ |= 8
case "spot_market_options":
value := readAWSSpotMarketOptions(iterator)
object.spotMarketOptions = value
object.bitmap_ |= 8
object.bitmap_ |= 16
default:
iterator.ReadAny()
}
Expand Down
Loading
Loading