Skip to content

Commit adfefb0

Browse files
committed
ENI support
Signed-off-by: Sameer Shaikh <[email protected]> ENI support Signed-off-by: Sameer Shaikh <[email protected]> ENI support Signed-off-by: Sameer Shaikh <[email protected]> ENI support Signed-off-by: Sameer Shaikh <[email protected]> ENI support Signed-off-by: Sameer Shaikh <[email protected]> ENI support Signed-off-by: Sameer Shaikh <[email protected]> ENI support Signed-off-by: Sameer Shaikh <[email protected]> ENI support Signed-off-by: Sameer Shaikh <[email protected]> ENI support Signed-off-by: Sameer Shaikh <[email protected]> ENI support Signed-off-by: Sameer Shaikh <[email protected]> ENI support Signed-off-by: Sameer Shaikh <[email protected]> ENI support Signed-off-by: Sameer Shaikh <[email protected]> PrimaryIP support Signed-off-by: Sameer Shaikh <[email protected]> Review comments Signed-off-by: Sameer Shaikh <[email protected]> Review comments Signed-off-by: Sameer Shaikh <[email protected]> Review comments Signed-off-by: Sameer Shaikh <[email protected]> Review comments Signed-off-by: Sameer Shaikh <[email protected]> Review comments Signed-off-by: Sameer Shaikh <[email protected]> Review comments Signed-off-by: Sameer Shaikh <[email protected]> Review comments Signed-off-by: Sameer Shaikh <[email protected]> Review comments Signed-off-by: Sameer Shaikh <[email protected]> Review Comments Signed-off-by: Sameer Shaikh <[email protected]> Review Comments Signed-off-by: Sameer Shaikh <[email protected]> Review Comments Signed-off-by: Sameer Shaikh <[email protected]> Review Comments Signed-off-by: Sameer Shaikh <[email protected]> Review Comments Signed-off-by: Sameer Shaikh <[email protected]> Review Comments Signed-off-by: Sameer Shaikh <[email protected]> Review Comments Signed-off-by: Sameer Shaikh <[email protected]> Review Comments Signed-off-by: Sameer Shaikh <[email protected]> Review Comments Signed-off-by: Sameer Shaikh <[email protected]> Review Comments Signed-off-by: Sameer Shaikh <[email protected]> Rebase master Signed-off-by: Sameer Shaikh <[email protected]> Review Comments Signed-off-by: Sameer Shaikh <[email protected]> Review Comments Signed-off-by: Sameer Shaikh <[email protected]> Adding support for GetSecurityGroupByName Signed-off-by: Sameer Shaikh <[email protected]> Adding support for GetSecurityGroupByName Signed-off-by: Sameer Shaikh <[email protected]> Adding support for GetSecurityGroupByName Signed-off-by: Sameer Shaikh <[email protected]> Adding support for GetSecurityGroupByName Signed-off-by: Sameer Shaikh <[email protected]> Adding support for GetSecurityGroupByName Signed-off-by: Sameer Shaikh <[email protected]> Adding support for GetSecurityGroupByName
1 parent a6bbd08 commit adfefb0

25 files changed

+1410
-50
lines changed

common/messages/messages_en.go

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,62 @@ var messagesEn = map[string]util.Message{
170170
RC: 500,
171171
Action: "Wait for file share deletion",
172172
},
173+
"ListSubnetsFailed": {
174+
Code: "ListSubnetsFailed",
175+
Description: "Unable to fetch list of subnets.",
176+
Type: util.RetrivalFailed,
177+
RC: 500,
178+
Action: "Unable to list subnets. Run 'ibmcloud is subnets' to list available subnets in your account.",
179+
},
180+
"NextSubnetPageParsingError": {
181+
Code: "NextSubnetPageParsingError",
182+
Description: "The next field '%s' specified in the next parameter of the list subnet call could not be parsed.",
183+
Type: util.RetrivalFailed,
184+
RC: 500,
185+
Action: "Please verify that the next field is correct.",
186+
},
187+
"StartSubnetIDEmpty": {
188+
Code: "StartSubnetIDEmpty",
189+
Description: "The start '%s' specified in the next parameter of the list subnet call is empty.",
190+
Type: util.RetrivalFailed,
191+
RC: 500,
192+
Action: "Please verify that the start field is correct.",
193+
},
194+
"SubnetFindFailedWithZoneAndSubnetID": {
195+
Code: "SubnetFindFailedWithZoneAndSubnetID",
196+
Description: "A subnet with the specified zone '%s' and available cluster subnet list '%s' could not be found.",
197+
Type: util.RetrivalFailed,
198+
RC: 404,
199+
Action: "Verify that the subnet from the cluster subnet list exists. Run 'ibmcloud is subnets' to list available subnets in your account.",
200+
},
201+
"ListSecurityGroupsFailed": {
202+
Code: "ListSecurityGroupsFailed",
203+
Description: "Unable to fetch list of securityGroups.",
204+
Type: util.RetrivalFailed,
205+
RC: 500,
206+
Action: "Unable to list securityGroups. Run 'ibmcloud is securityGroups' to list available securityGroups in your account.",
207+
},
208+
"NextSecurityGroupPageParsingError": {
209+
Code: "NextSecurityGroupPageParsingError",
210+
Description: "The next field '%s' specified in the next parameter of the list securityGroup call could not be parsed.",
211+
Type: util.RetrivalFailed,
212+
RC: 500,
213+
Action: "Please verify that the next field is correct.",
214+
},
215+
"StartSecurityGroupIDEmpty": {
216+
Code: "StartSecurityGroupIDEmpty",
217+
Description: "The start '%s' specified in the next parameter of the list securityGroup call is empty.",
218+
Type: util.RetrivalFailed,
219+
RC: 500,
220+
Action: "Please verify that the start field is correct.",
221+
},
222+
"SecurityGroupFindFailedWithVPCAndSecurityGroupName": {
223+
Code: "SecurityGroupFindFailedWithVPCAndSecurityGroupName",
224+
Description: "A securityGroup with the specified cluster securityGroup name '%s' could not be found.",
225+
Type: util.RetrivalFailed,
226+
RC: 404,
227+
Action: "Verify that the securityGroup from the cluster securityGroup list exists. Run 'ibmcloud is securityGroups' to list available securityGroups in your account.",
228+
},
173229
"ListVolumesFailed": {
174230
Code: "ListVolumesFailed",
175231
Description: "Unable to fetch list of file shares.",

common/vpcclient/models/constants.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,11 @@ package models
1919

2020
const (
2121
// APIVersion is the target RIaaS API spec version
22-
APIVersion = "2023-05-30"
22+
APIVersion = "2023-07-11"
2323

2424
// APIGeneration ...
2525
APIGeneration = 1
2626

2727
// UserAgent identifies IKS to the RIaaS API
2828
UserAgent = "IBM-Kubernetes-Service"
29-
30-
// MaturityBeta flag
31-
MaturityBeta = "beta"
3229
)
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*******************************************************************************
2+
* IBM Confidential
3+
* OCO Source Materials
4+
* IBM Cloud Kubernetes Service, 5737-D43
5+
* (C) Copyright IBM Corp. 2023 All Rights Reserved.
6+
* The source code for this program is not published or otherwise divested of
7+
* its trade secrets, irrespective of what has been deposited with
8+
* the U.S. Copyright Office.
9+
******************************************************************************/
10+
11+
// Package models ...
12+
package models
13+
14+
import (
15+
"github.com/IBM/ibmcloud-volume-interface/lib/provider"
16+
)
17+
18+
// SecurityGroup ...
19+
type SecurityGroup struct {
20+
CRN string `json:"crn,omitempty"`
21+
Href string `json:"href,omitempty"`
22+
ID string `json:"id,omitempty"`
23+
Name string `json:"name,omitempty"`
24+
ResourceGroup *ResourceGroup `json:"resource_group,omitempty"`
25+
VPC *provider.VPC `json:"vpc,omitempty"`
26+
}
27+
28+
// SecurityGroupList ...
29+
type SecurityGroupList struct {
30+
First *HReference `json:"first,omitempty"`
31+
Next *HReference `json:"next,omitempty"`
32+
SecurityGroups []SecurityGroup `json:"security_groups,omitempty"`
33+
Limit int `json:"limit,omitempty"`
34+
TotalCount int `json:"total_count,omitempty"`
35+
}
36+
37+
// ListSecurityGroupFilters ...
38+
type ListSecurityGroupFilters struct {
39+
ResourceGroupID string `json:"resource_group.id,omitempty"`
40+
VPCID string `json:"vpc.id,omitempty"`
41+
}

common/vpcclient/models/share.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,10 @@ type Share struct {
3535
Profile *Profile `json:"profile,omitempty"`
3636
CreatedAt *time.Time `json:"created_at,omitempty"`
3737
// Status of share named - deleted, deleting, failed, pending, stable, updating, waiting, suspended
38-
Status StatusType `json:"lifecycle_state,omitempty"`
39-
ShareTargets *[]ShareTarget `json:"mount_targets,omitempty"`
40-
Zone *Zone `json:"zone,omitempty"`
38+
Status StatusType `json:"lifecycle_state,omitempty"`
39+
ShareTargets *[]ShareTarget `json:"mount_targets,omitempty"`
40+
Zone *Zone `json:"zone,omitempty"`
41+
AccessControlMode string `json:"access_control_mode,omitempty"`
4142
}
4243

4344
// ListShareTargerFilters ...

common/vpcclient/models/share_target.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ type ShareTarget struct {
3232
// Status of share target named - deleted, deleting, failed, pending, stable, updating, waiting, suspended
3333
Status string `json:"lifecycle_state,omitempty"`
3434
VPC *provider.VPC `json:"vpc,omitempty"`
35+
//EncryptionInTransit
36+
EncryptionInTransit string `json:"transit_encryption,omitempty"`
37+
VirtualNetworkInterface *VirtualNetworkInterface `json:"virtual_network_interface,omitempty"`
3538
//Share ID this target is associated to
3639
ShareID string `json:"-"`
3740
Zone *Zone `json:"zone,omitempty"`
@@ -47,6 +50,15 @@ type ShareTargetList struct {
4750
TotalCount int `json:"total_count,omitempty"`
4851
}
4952

53+
// VirtualNetworkInterface
54+
type VirtualNetworkInterface struct {
55+
Name string `json:"name,omitempty"`
56+
Subnet *SubnetRef `json:"subnet,omitempty"`
57+
SecurityGroups *[]provider.SecurityGroup `json:"security_groups,omitempty"`
58+
PrimaryIP *provider.PrimaryIP `json:"primary_ip,omitempty"`
59+
ResourceGroup *provider.ResourceGroup `json:"resource_group,omitempty"`
60+
}
61+
5062
// NewShareTarget creates ShareTarget from VolumeAccessPointRequest
5163
func NewShareTarget(volumeAccessPointRequest provider.VolumeAccessPointRequest) ShareTarget {
5264
va := ShareTarget{

common/vpcclient/models/subnet.go

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/*******************************************************************************
2+
* IBM Confidential
3+
* OCO Source Materials
4+
* IBM Cloud Kubernetes Service, 5737-D43
5+
* (C) Copyright IBM Corp. 2023 All Rights Reserved.
6+
* The source code for this program is not published or otherwise divested of
7+
* its trade secrets, irrespective of what has been deposited with
8+
* the U.S. Copyright Office.
9+
******************************************************************************/
10+
11+
// Package models ...
12+
package models
13+
14+
import (
15+
"github.com/IBM/ibmcloud-volume-interface/lib/provider"
16+
)
17+
18+
// Subnet ...
19+
type Subnet struct {
20+
CRN string `json:"crn,omitempty"`
21+
Href string `json:"href,omitempty"`
22+
ID string `json:"id,omitempty"`
23+
Name string `json:"name,omitempty"`
24+
ResourceGroup *ResourceGroup `json:"resource_group,omitempty"`
25+
VPC *provider.VPC `json:"vpc,omitempty"`
26+
Zone *Zone `json:"zone,omitempty"`
27+
}
28+
29+
// SubnetRef ...
30+
type SubnetRef struct {
31+
CRN string `json:"crn,omitempty"`
32+
ID string `json:"id,omitempty"`
33+
Href string `json:"href,omitempty"`
34+
}
35+
36+
// SubnetList ...
37+
type SubnetList struct {
38+
First *HReference `json:"first,omitempty"`
39+
Next *HReference `json:"next,omitempty"`
40+
Subnets []Subnet `json:"subnets,omitempty"`
41+
Limit int `json:"limit,omitempty"`
42+
TotalCount int `json:"total_count,omitempty"`
43+
}
44+
45+
// ListSubnetFilters ...
46+
type ListSubnetFilters struct {
47+
ResourceGroupID string `json:"resource_group.id,omitempty"`
48+
VPCID string `json:"vpc.id,omitempty"`
49+
ZoneName string `json:"zone.name,omitempty"`
50+
}

common/vpcclient/riaas/riaas.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ func New(config Config) (*Session, error) {
6969
queryValues := url.Values{
7070
"version": []string{backendAPIVersion},
7171
"generation": []string{strconv.Itoa(apiGen)},
72-
"maturity": []string{models.MaturityBeta},
7372
}
7473

7574
riaasClient := client.New(ctx, config.baseURL(), queryValues, config.httpClient(), config.ContextID, config.ResourceGroup)

common/vpcclient/vpcfilevolume/constants.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,6 @@ const (
2626
shareTargetsPath = "/mount_targets"
2727
shareTargetIDParam = "target-id"
2828
shareTargetIDPath = shareTargetsPath + "/{" + shareTargetIDParam + "}"
29+
subnets = Version + "/subnets"
30+
securityGroups = Version + "/security_groups"
2931
)

0 commit comments

Comments
 (0)