Skip to content

Commit

Permalink
Merge pull request #28 from vngcloud/iam-vserver
Browse files Browse the repository at this point in the history
Iam vserver
  • Loading branch information
manhtu1997 authored Aug 1, 2024
2 parents 56b67fe + 301d57b commit e241ca9
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions client/vserver/model_create_server_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,6 @@ type CreateServerRequest struct {
UserPassword string `json:"userPassword,omitempty"`
// Zone of flavor. You can choose if having multiple zone
HostGroupId string `json:"hostGroupId,omitempty"`
// is POC
IsPoc bool `json:"isPoc,omitempty"`
}
2 changes: 2 additions & 0 deletions client/vserver/model_create_volume_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ type CreateVolumeRequest struct {
Size int32 `json:"size"`
// Id of volume type
VolumeTypeId string `json:"volumeTypeId"`
// is POC
IsPoc bool `json:"isPoc,omitempty"`
}
1 change: 1 addition & 0 deletions docs/resources/vserver_server.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ The following arguments are supported:
- **server_group_id** (String, Optional) ID of Server Group.
- **user_data** (String, Optional) User data to provide when launching the server.
- **user_data_base64_encode** (Boolean, Optional) Can be used instead of user_data to pass base64-encoded binary data directly. Use this instead of user_data whenever the value is not a valid UTF-8 string.
- **is_poc** (Boolean, Optional) Is Poc Resource.

## Attributes Reference

Expand Down
1 change: 1 addition & 0 deletions docs/resources/vserver_volume.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ The following arguments are supported:
- **volume_type_id** (String, Required) ID of Volume's Type
- **encryption_type** (String, Optional) Type encryption of volume.
- **multi_attach** (Boolean, Optional) Specifies whether to enable Volume Multi-Attach.
- **is_poc** (Boolean, Optional) Is Poc Resource.

## Attributes Reference

Expand Down
6 changes: 6 additions & 0 deletions resource/vserver/resource_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,11 @@ func ResourceServer() *schema.Resource {
Optional: true,
ForceNew: true,
},
"is_poc": {
Type: schema.TypeBool,
Optional: true,
ForceNew: true,
},
},
}
}
Expand Down Expand Up @@ -227,6 +232,7 @@ func resourceServerCreate(d *schema.ResourceData, m interface{}) error {
UserData: d.Get("user_data").(string),
UserDataBase64Encoded: d.Get("user_data_base64_encode").(bool),
HostGroupId: d.Get("host_group_id").(string),
IsPoc: d.Get("is_poc").(bool),
}
cli := m.(*client.Client)
resp, httpResponse, err := cli.VserverClient.ServerRestControllerApi.CreateServerUsingPOST1(context.TODO(), server, projectID)
Expand Down
6 changes: 6 additions & 0 deletions resource/vserver/resource_volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ func ResourceVolume() *schema.Resource {
Optional: true,
ForceNew: true,
},
"is_poc": {
Type: schema.TypeBool,
Optional: true,
ForceNew: true,
},
},
}
}
Expand All @@ -92,6 +97,7 @@ func resourceVolumeCreate(d *schema.ResourceData, m interface{}) error {
Size: int32(d.Get("size").(int)),
VolumeTypeId: d.Get("volume_type_id").(string),
MultiAttach: d.Get("multi_attach").(bool),
IsPoc: d.Get("is_poc").(bool),
}
cli := m.(*client.Client)
resp, httpResponse, err := cli.VserverClient.VolumeRestControllerApi.CreateVolumeUsingPOST1(context.TODO(), a, projectID)
Expand Down

0 comments on commit e241ca9

Please sign in to comment.