-
Notifications
You must be signed in to change notification settings - Fork 107
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
Add file share design #27
Conversation
Please work with Shruthi to add profiles design into this doc. |
Edited Goals Non Goals added Edited Rest API impact Added Data model impact, Rest API impact, Security impact, Other end user impact Added Implementation of file share APIs for Profiles consolidated with block storage
4. Internally, OpenSDS File Share API talk to controllers. | ||
5. Controllers will also maintain the File Share metadata in database. | ||
6. Controller communicates to Dock, specific driver to create a share. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Scheduler should be mentioned in the steps.
Other than NBP, user can also use CLI or dashboard.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added Scheduler tasks
specs/capri/FileShare_Design.md
Outdated
|
||
### Data model impact | ||
|
||
No |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New file share resources, etc. will be stored in the database so there will be data model impact.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. I have updated.
This design would depend on #29, please take a look thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi PravinRanjan10, I added some comments. Please take a look.
##### Response parameters | ||
```json | ||
“snapshotId”: “string” | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
“shareId” is needed for the response.
“shareId” : “string” |
"isSpaceEfficient" : "bool" | ||
}, | ||
"ioconnectivity" : { | ||
"accessProtocol" : "string", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you tell me what "accessProtocol" is?
If it means NFS or CIFS, I think it is not needed for file share because it's same as "protocols" parameter in '3. POST /v1beta/{tenantId}/file/shares'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it means NFS/CIFS. Based on the create file share request parameter, there will be profiles selection. In controller profile selects dock that contacts the particular driver based on supported accessprocols. So profile should have accessprotocol information.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your reply.
I understand that profile should have accessprotocol information.
I have an another question.
The create file share request parameter also has protocols parameter.
Could you tell me relationship between protocols parameter and accessprotocol parameter of profile?
What happens if both protocols parameter and accessprotocol parameter of profile are specified at the same time, which one has priority?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hirokikmr Thanks for your review! That's a very good observation. I don't think we need to have a separate "protocols" parameter in Create file share request since it is already in Profiles.
@Shruthi-1MN and @PravinRanjan10, I think the Protocols in Create File share can be removed. We can just use the accessProtocol in Profiles instead. Let's make this "accessProtocol" an array ([]string).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xing-yang Thank you for your reply. I agree with your suggestion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xing-yang @hirokikmr, i have removed the "protocols" parameter from POST API of fileshare. And also corrected "accessProtocol" an array ([]string).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AccessProtocol is a string, they should choose only one accessprotocol not multiple.
|
||
“profileId”: “string” | ||
|
||
“snapshotId” : “string” |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the file share is creating, the snapshot has not been created and ''snapshotId'' doesn't exist yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah right. In this case it will be simply blank. Do you think, we should not return the snapshotId in response, while creation of file share?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the snapshotId can be returned in response, While creation of file share, but it should not be a parameter in the request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"snapshotId" is optional. It is only specified when creating a file share from a snapshot.
@PravinRanjan10 can you specify what field is required and what is optional? That will be more clear.
##### 3. POST /v1beta/{tenantId}/file/shares | ||
* Creates a share. | ||
##### Request | ||
```json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whether Add Access is supported when creating file share.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, Add access will only be supported once the file is created.
specs/capri/FileShare_Design.md
Outdated
|
||
##### Request | ||
```json | ||
body* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please correct the format for highlighting the newly added parameters text.
```json | ||
“id” : “string” | ||
|
||
“createdAt” : “2019-03-20T12:49:00.497Z” |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make API specification dataType format consistent.
Please add sample API request/response as example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's ok for design doc to have json format timing detail. It's more clear way to represent.
```json | ||
“id” : “sting” | ||
``` | ||
##### 11. POST /v1beta/{tenantId}/file/accesses/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API endpoint is confusing, acls are defined for file or fileshare. It can be POST /v1beta/{tenantId}/file/shares/{shareId}/acls/
Is it necessary that we should define API for defining acls, Can't we use the PUT fileshare API to provide acls?
PUT /v1beta/{tenantId}/file/shares/{shareId}
"accesscontrol": {
“accessCapability” : read/write/execute
other parameters etc.
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think endpoint is clear. we have to give shareId as mandatory parameter to provide acls on fileshare.
It is recommended that acl's should not set while creating the file share(It should be synchronous). And that is the reason we have separate API for that.
"datastore"" : { | ||
|
||
""characterCodeSet" : "string", | ||
"maxFileNameLengthBytes" : "int64", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could it be possible to group the file share related parameters to File object?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will impact the block profile APIs, so right now we are not doing it.
tenantId* : "string" //The project UUID in a multi-tenancy environment | ||
``` | ||
|
||
##### Response |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add sample request/response as an example.
"message": "string" | ||
} | ||
``` | ||
##### 2. GET /v1beta/{tenantId}/profiles |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please sample Profile information related to Fileshare.
"message": "string" | ||
} | ||
``` | ||
##### 6. POST /v1beta/{tenantId}/profiles/{profileId}/customeProperties |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please give example custom properties for FileShare
|
||
“size” : “int64” | ||
|
||
“userId” : “string“ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How to use "userId"? The actual test found that "userId" in the response is an empty string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BaiHuoYu How did you test?. Have you provided dummy userId?
Can you also share your slack id, i can add you in fileshare group for more detail discussion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the difference between tenantID and userID? Which should be used when there are multi-tenant scenarios?
|
||
“snapshotId” : “string” | ||
``` | ||
##### Response parameters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Protocols is in FileShareSpec, why not use it here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean, in the request body?
Since accessProtocols is already there in profile, we don't need here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How to use Protocols in the profile? Why is there no Protoco in CreateFileShareOpts(model.pb.go)?
* Facilitating File Share Service by providing Standard API to manage multiple vendors, simplify File Share API definition | ||
* File share across the users based on access capability | ||
* File share facilitates with profiling | ||
* Scope for now is to support only NFS, SMB file share protocols |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the plan for CIFS which you mentioned above?
### REST API impact | ||
|
||
YES | ||
Fileshare API's needs to write and Existing Profile API's needs to be changed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please notice it has some grammar errors.
|
||
### Data model impact | ||
|
||
YES |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please elaborate the data model change here.
|
||
### Other end user impact | ||
|
||
No |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I came up with an impact that with file share feature enabled, users (precisely by admin) need to create fileshare-type profile now.
specs/capri/FileShare_Design.md
Outdated
} | ||
} | ||
] | ||
400 Unauthorized |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
400 means Bad Request, Unauthorized is 401.
specs/capri/FileShare_Design.md
Outdated
} | ||
} | ||
] | ||
400 Unauthorized |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
400 means Bad Request, Unauthorized is 401.
specs/capri/FileShare_Design.md
Outdated
} | ||
} | ||
] | ||
400 Unauthorized |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
400 means Bad Request, Unauthorized is 401.
specs/capri/FileShare_Design.md
Outdated
} | ||
} | ||
|
||
400 Unauthorized |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
400 means Bad Request, Unauthorized is 401.
specs/capri/FileShare_Design.md
Outdated
##### Response | ||
```json | ||
200 OK | ||
400 Unauthorized |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
400 means Bad Request, Unauthorized is 401.
specs/capri/FileShare_Design.md
Outdated
"key3": "value3" | ||
} | ||
|
||
400 Unauthorized |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
400 means Bad Request, Unauthorized is 401.
specs/capri/FileShare_Design.md
Outdated
"key3": "value3" | ||
} | ||
|
||
400 Unauthorized |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
400 means Bad Request, Unauthorized is 401.
specs/capri/FileShare_Design.md
Outdated
##### Response | ||
```json | ||
200 OK | ||
400 Unauthorized |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
400 means Bad Request, Unauthorized is 401.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
This pr is design about file share that will let user: