|
| 1 | +// Licensed to the Apache Software Foundation (ASF) under one |
| 2 | +// or more contributor license agreements. See the NOTICE file |
| 3 | +// distributed with this work for additional information |
| 4 | +// regarding copyright ownership. The ASF licenses this file |
| 5 | +// to you under the Apache License, Version 2.0 (the |
| 6 | +// "License"); you may not use this file except in compliance |
| 7 | +// with the License. You may obtain a copy of the License at |
| 8 | +// |
| 9 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +// |
| 11 | +// Unless required by applicable law or agreed to in writing, |
| 12 | +// software distributed under the License is distributed on an |
| 13 | +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | +// KIND, either express or implied. See the License for the |
| 15 | +// specific language governing permissions and limitations |
| 16 | +// under the License. |
| 17 | +package org.apache.cloudstack.api.command.admin.vm; |
| 18 | + |
| 19 | +import org.apache.cloudstack.acl.RoleType; |
| 20 | +import org.apache.cloudstack.api.APICommand; |
| 21 | +import org.apache.cloudstack.api.ApiConstants; |
| 22 | +import org.apache.cloudstack.api.Parameter; |
| 23 | +import org.apache.cloudstack.api.ResponseObject; |
| 24 | +import org.apache.cloudstack.api.command.admin.AdminCmd; |
| 25 | +import org.apache.cloudstack.api.command.user.vm.CreateVMFromBackupCmd; |
| 26 | +import org.apache.cloudstack.api.response.ClusterResponse; |
| 27 | +import org.apache.cloudstack.api.response.PodResponse; |
| 28 | +import org.apache.cloudstack.api.response.UserVmResponse; |
| 29 | + |
| 30 | +import com.cloud.vm.VirtualMachine; |
| 31 | + |
| 32 | +@APICommand(name = "createVMFromBackup", |
| 33 | + description = "Creates and automatically starts a VM from a backup.", |
| 34 | + responseObject = UserVmResponse.class, |
| 35 | + responseView = ResponseObject.ResponseView.Full, |
| 36 | + entityType = {VirtualMachine.class}, |
| 37 | + requestHasSensitiveInfo = false, responseHasSensitiveInfo = true, |
| 38 | + since = "4.20.0.6-scclouds", |
| 39 | + authorized = {RoleType.Admin, RoleType.ResourceAdmin, RoleType.DomainAdmin, RoleType.User}) |
| 40 | +public class CreateVMFromBackupCmdByAdmin extends CreateVMFromBackupCmd implements AdminCmd { |
| 41 | + |
| 42 | + @Parameter(name = ApiConstants.POD_ID, type = CommandType.UUID, entityType = PodResponse.class, description = "destination Pod ID to deploy the VM to - parameter available for root admin only", since = "4.20.0.6-scclouds") |
| 43 | + private Long podId; |
| 44 | + |
| 45 | + @Parameter(name = ApiConstants.CLUSTER_ID, type = CommandType.UUID, entityType = ClusterResponse.class, description = "destination Cluster ID to deploy the VM to - parameter available for root admin only", since = "4.20.0.6-scclouds") |
| 46 | + private Long clusterId; |
| 47 | + |
| 48 | + public Long getPodId() { |
| 49 | + return podId; |
| 50 | + } |
| 51 | + |
| 52 | + public Long getClusterId() { |
| 53 | + return clusterId; |
| 54 | + } |
| 55 | +} |
0 commit comments