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

FileSystem FullPath Attribute #49

Merged
merged 2 commits into from
Sep 18, 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
1 change: 1 addition & 0 deletions docs/resources/filesystem.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ After the execution of above resource block, a powerscale_filesystem would have
'public_read', 'public_read_write', 'public' or permissions in POSIX format as '0550', '0770', '0775','0777' or 0700. The Default value is (0700).
(Update Supported but Modification of ACL is only supported from POSIX to POSIX mode)
- `directory_path` (String) FileSystem directory path.This specifies the path to the FileSystem(Namespace directory) which we are trying to manage. If no directory path is specified, [/ifs] would be taken by default.
- `full_path` (String) The full path of the FileSystem
- `id` (String) FileSystem identifier. Unique identifier for the FileSystem(Namespace directory)
- `overwrite` (Boolean) Deletes and replaces the existing user attributes and ACLs of the directory with user-specified attributes if set to true.
- `query_zone` (String) Specifies the zone that the object belongs to. Optional and will default to the default access zone if one is not set.
Expand Down
1 change: 1 addition & 0 deletions powerscale/helper/file_system_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ func UpdateFileSystemResourceState(ctx context.Context, plan *models.FileSystemR
// UpdateFileSystemResourcePlanData Updates File System Resource State from plan data.
func UpdateFileSystemResourcePlanData(plan *models.FileSystemResource, state *models.FileSystemResource) {
state.ID = types.StringValue(GetDirectoryPath(plan.DirectoryPath.ValueString(), plan.Name.ValueString()))
state.FullPath = types.StringValue("/" + state.ID.ValueString())
state.Name = plan.Name
state.DirectoryPath = plan.DirectoryPath
state.Overwrite = plan.Overwrite
Expand Down
1 change: 1 addition & 0 deletions powerscale/models/file_system.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ type FileSystemFilterType struct {
// FileSystemResource Defines the File System Resource Model.
type FileSystemResource struct {
ID types.String `tfsdk:"id"`
FullPath types.String `tfsdk:"full_path"`
Name types.String `tfsdk:"name"`
DirectoryPath types.String `tfsdk:"directory_path"`
Owner MemberObject `tfsdk:"owner"`
Expand Down
6 changes: 6 additions & 0 deletions powerscale/provider/file_system_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ func (r *FileSystemResource) Schema(ctx context.Context, req resource.SchemaRequ
MarkdownDescription: "FileSystem directory name",
Required: true,
},
"full_path": schema.StringAttribute{
Description: "The full path of the FileSystem",
MarkdownDescription: "The full path of the FileSystem",
Computed: true,
Optional: true,
},
"directory_path": schema.StringAttribute{
Description: "FileSystem directory path.This specifies the path to the FileSystem(Namespace directory) which we are trying to manage. If no directory path is specified, [/ifs] would be taken by default.",
MarkdownDescription: "FileSystem directory path.This specifies the path to the FileSystem(Namespace directory) which we are trying to manage. If no directory path is specified, [/ifs] would be taken by default.",
Expand Down