abh1sar commented on code in PR #9208:
URL: https://github.com/apache/cloudstack/pull/9208#discussion_r1708120950


##########
api/src/main/java/org/apache/cloudstack/api/command/user/storage/fileshare/CreateFileShareCmd.java:
##########
@@ -0,0 +1,168 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.api.command.user.storage.fileshare;
+
+import java.util.List;
+
+import javax.inject.Inject;
+
+import com.cloud.event.EventTypes;
+import com.cloud.exception.ResourceAllocationException;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.ApiErrorCode;
+import org.apache.cloudstack.api.BaseAsyncCreateCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ResponseObject;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.command.user.UserCmd;
+import org.apache.cloudstack.api.response.DiskOfferingResponse;
+import org.apache.cloudstack.api.response.FileShareResponse;
+import org.apache.cloudstack.api.response.NetworkResponse;
+import org.apache.cloudstack.api.response.ZoneResponse;
+import org.apache.cloudstack.context.CallContext;
+import org.apache.cloudstack.storage.fileshare.FileShare;
+import org.apache.cloudstack.storage.fileshare.FileShareService;
+
+@APICommand(name = "createFileShare", responseObject= FileShareResponse.class, 
description = "Creates a new file share of specified size and disk offering and 
attached to the given guest network",
+        responseView = ResponseObject.ResponseView.Restricted, entityType = 
FileShare.class, requestHasSensitiveInfo = false, since = "4.20.0")
+public class CreateFileShareCmd extends BaseAsyncCreateCmd implements UserCmd {
+
+    @Inject
+    FileShareService fileShareService;
+
+    /////////////////////////////////////////////////////
+    //////////////// API parameters /////////////////////
+    /////////////////////////////////////////////////////
+
+    @Parameter(name = ApiConstants.NAME,
+            type = CommandType.STRING,
+            required = true,
+            description = "the name of the file share.")
+    private String name;
+
+    @Parameter(name = ApiConstants.DESCRIPTION,
+            type = CommandType.STRING,
+            description = "the description for the file share.")
+    private String description;
+
+    @Parameter(name = ApiConstants.SIZE,
+            type = CommandType.LONG,
+            required = true,
+            description = "the size of the file share in bytes")
+    private Long size;
+
+    @Parameter(name = ApiConstants.ZONE_ID,
+            type = CommandType.UUID,
+            entityType = ZoneResponse.class,
+            description = "the zone id.")
+    private Long zoneId;
+
+    @Parameter(name = ApiConstants.DISK_OFFERING_ID,
+            type = CommandType.UUID,
+            entityType = DiskOfferingResponse.class,
+            description = "the disk offering to use for the underlying 
storage.")
+    private Long diskOfferingId;
+
+    @Parameter(name = ApiConstants.MOUNT_OPTIONS,
+            type = CommandType.STRING,
+            description = "the comma separated list of mount options to use 
for mounting this file share.")
+    private String mountOptions;
+
+    @Parameter(name = ApiConstants.FORMAT,
+            type = CommandType.STRING,
+            description = "the filesystem format which will be installed on 
the file share.")

Review Comment:
   Added supported formats (ext4, xfs)



##########
api/src/main/java/org/apache/cloudstack/api/command/user/storage/fileshare/CreateFileShareCmd.java:
##########
@@ -0,0 +1,168 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.api.command.user.storage.fileshare;
+
+import java.util.List;
+
+import javax.inject.Inject;
+
+import com.cloud.event.EventTypes;
+import com.cloud.exception.ResourceAllocationException;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.ApiErrorCode;
+import org.apache.cloudstack.api.BaseAsyncCreateCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ResponseObject;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.command.user.UserCmd;
+import org.apache.cloudstack.api.response.DiskOfferingResponse;
+import org.apache.cloudstack.api.response.FileShareResponse;
+import org.apache.cloudstack.api.response.NetworkResponse;
+import org.apache.cloudstack.api.response.ZoneResponse;
+import org.apache.cloudstack.context.CallContext;
+import org.apache.cloudstack.storage.fileshare.FileShare;
+import org.apache.cloudstack.storage.fileshare.FileShareService;
+
+@APICommand(name = "createFileShare", responseObject= FileShareResponse.class, 
description = "Creates a new file share of specified size and disk offering and 
attached to the given guest network",
+        responseView = ResponseObject.ResponseView.Restricted, entityType = 
FileShare.class, requestHasSensitiveInfo = false, since = "4.20.0")
+public class CreateFileShareCmd extends BaseAsyncCreateCmd implements UserCmd {
+
+    @Inject
+    FileShareService fileShareService;
+
+    /////////////////////////////////////////////////////
+    //////////////// API parameters /////////////////////
+    /////////////////////////////////////////////////////
+
+    @Parameter(name = ApiConstants.NAME,
+            type = CommandType.STRING,
+            required = true,
+            description = "the name of the file share.")
+    private String name;
+
+    @Parameter(name = ApiConstants.DESCRIPTION,
+            type = CommandType.STRING,
+            description = "the description for the file share.")
+    private String description;
+
+    @Parameter(name = ApiConstants.SIZE,
+            type = CommandType.LONG,
+            required = true,
+            description = "the size of the file share in bytes")
+    private Long size;
+
+    @Parameter(name = ApiConstants.ZONE_ID,
+            type = CommandType.UUID,
+            entityType = ZoneResponse.class,
+            description = "the zone id.")
+    private Long zoneId;
+
+    @Parameter(name = ApiConstants.DISK_OFFERING_ID,
+            type = CommandType.UUID,
+            entityType = DiskOfferingResponse.class,
+            description = "the disk offering to use for the underlying 
storage.")
+    private Long diskOfferingId;
+
+    @Parameter(name = ApiConstants.MOUNT_OPTIONS,
+            type = CommandType.STRING,
+            description = "the comma separated list of mount options to use 
for mounting this file share.")
+    private String mountOptions;
+
+    @Parameter(name = ApiConstants.FORMAT,
+            type = CommandType.STRING,
+            description = "the filesystem format which will be installed on 
the file share.")
+    private String fsFormat;
+
+    @Parameter(name = ApiConstants.PROVIDER,
+            type = CommandType.STRING,
+            description = "the provider to be used for the file share.")

Review Comment:
   done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to