mirror of https://github.com/apache/cloudstack.git
API docs improvements
- Proper category alignments during API docs generation - Since attribute for API, Request & Response parameters - Code improvements/cleanup
This commit is contained in:
parent
04b58acdd6
commit
958e1b47f3
|
|
@ -24,7 +24,7 @@ import org.apache.cloudstack.api.BaseListCmd;
|
|||
import org.apache.cloudstack.api.response.ListResponse;
|
||||
import org.apache.cloudstack.api.response.StorageTagResponse;
|
||||
|
||||
@APICommand(name = "listStorageTags", description = "Lists storage tags", responseObject = StorageTagResponse.class, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
|
||||
@APICommand(name = "listStorageTags", description = "Lists storage pool tags", responseObject = StorageTagResponse.class, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
|
||||
public class ListStorageTagsCmd extends BaseListCmd {
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ import com.cloud.exception.NetworkRuleConflictException;
|
|||
import com.cloud.exception.ResourceAllocationException;
|
||||
import com.cloud.exception.ResourceUnavailableException;
|
||||
|
||||
@APICommand(name = "addOpenDaylightController", responseObject = OpenDaylightControllerResponse.class, description = "Adds an OpenDyalight controler",
|
||||
@APICommand(name = "addOpenDaylightController", responseObject = OpenDaylightControllerResponse.class, description = "Adds an OpenDaylight controller",
|
||||
requestHasSensitiveInfo = true, responseHasSensitiveInfo = false)
|
||||
public class AddOpenDaylightControllerCmd extends BaseAsyncCmd {
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ import com.cloud.exception.NetworkRuleConflictException;
|
|||
import com.cloud.exception.ResourceAllocationException;
|
||||
import com.cloud.exception.ResourceUnavailableException;
|
||||
|
||||
@APICommand(name = "deleteOpenDaylightController", responseObject = OpenDaylightControllerResponse.class, description = "Removes an OpenDyalight controler",
|
||||
@APICommand(name = "deleteOpenDaylightController", responseObject = OpenDaylightControllerResponse.class, description = "Removes an OpenDaylight controller",
|
||||
requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
|
||||
public class DeleteOpenDaylightControllerCmd extends BaseAsyncCmd {
|
||||
@Inject
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ import com.cloud.exception.NetworkRuleConflictException;
|
|||
import com.cloud.exception.ResourceAllocationException;
|
||||
import com.cloud.exception.ResourceUnavailableException;
|
||||
|
||||
@APICommand(name = "listOpenDaylightControllers", responseObject = OpenDaylightControllerResponse.class, description = "Lists OpenDyalight controllers",
|
||||
@APICommand(name = "listOpenDaylightControllers", responseObject = OpenDaylightControllerResponse.class, description = "Lists OpenDaylight controllers",
|
||||
requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
|
||||
public class ListOpenDaylightControllersCmd extends BaseCmd {
|
||||
@Inject
|
||||
|
|
|
|||
|
|
@ -41,8 +41,6 @@ import org.apache.logging.log4j.Logger;
|
|||
import org.apache.logging.log4j.LogManager;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectOutputStream;
|
||||
|
|
@ -50,19 +48,14 @@ import java.lang.reflect.Field;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
import java.util.Set;
|
||||
import java.util.TreeMap;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipOutputStream;
|
||||
|
||||
public class ApiXmlDocWriter {
|
||||
protected static Logger LOGGER = LogManager.getLogger(ApiXmlDocWriter.class);
|
||||
|
|
@ -93,8 +86,8 @@ public class ApiXmlDocWriter {
|
|||
"org.apache.cloudstack.api.command.admin.zone", "org.apache.cloudstack.network.contrail.api.command"});
|
||||
|
||||
for (Class<?> cmdClass : cmdClasses) {
|
||||
if(cmdClass.getAnnotation(APICommand.class)==null){
|
||||
System.out.println("Warning, API Cmd class " + cmdClass.getName() + " has no APICommand annotation ");
|
||||
if (cmdClass.getAnnotation(APICommand.class) == null) {
|
||||
System.out.println("Warning: API Cmd class " + cmdClass.getName() + " has no APICommand annotation ");
|
||||
continue;
|
||||
}
|
||||
String apiName = cmdClass.getAnnotation(APICommand.class).name();
|
||||
|
|
@ -105,11 +98,9 @@ public class ApiXmlDocWriter {
|
|||
// api_cmd map always keep the admin cmd class to get full response and parameters
|
||||
s_apiNameCmdClassMap.put(apiName, cmdClass);
|
||||
} else if (cmdClass.isAssignableFrom(curCmd)) {
|
||||
// just skip this one without warning
|
||||
continue;
|
||||
System.out.println("Info: API Cmd class " + cmdClass.getName() + " is assignable from " + curCmd.getName() + ", skip this one");
|
||||
} else {
|
||||
System.out.println("Warning, API Cmd class " + cmdClass.getName() + " has non-unique apiname " + apiName);
|
||||
continue;
|
||||
System.out.println("Warning: API Cmd class " + cmdClass.getName() + " has non-unique apiname " + apiName);
|
||||
}
|
||||
} else {
|
||||
s_apiNameCmdClassMap.put(apiName, cmdClass);
|
||||
|
|
@ -178,8 +169,6 @@ public class ApiXmlDocWriter {
|
|||
|
||||
private static void writeCommand(ObjectOutputStream out, String command) throws ClassNotFoundException, IOException {
|
||||
Class<?> clas = Class.forName(s_allApiCommands.get(command));
|
||||
ArrayList<Argument> request = new ArrayList<Argument>();
|
||||
ArrayList<Argument> response = new ArrayList<Argument>();
|
||||
|
||||
// Create a new command, set name/description/usage
|
||||
Command apiCommand = new Command();
|
||||
|
|
@ -220,19 +209,19 @@ public class ApiXmlDocWriter {
|
|||
|
||||
Set<Field> fields = ReflectUtil.getAllFieldsForClass(clas, new Class<?>[] {BaseCmd.class, BaseAsyncCmd.class, BaseAsyncCreateCmd.class});
|
||||
|
||||
request = setRequestFields(fields);
|
||||
ArrayList<Argument> request = setRequestFields(fields);
|
||||
|
||||
// Get response parameters
|
||||
Class<?> responseClas = impl.responseObject();
|
||||
Field[] responseFields = responseClas.getDeclaredFields();
|
||||
response = setResponseFields(responseFields, responseClas);
|
||||
ArrayList<Argument> response = setResponseFields(responseFields, responseClas);
|
||||
|
||||
apiCommand.setRequest(request);
|
||||
apiCommand.setResponse(response);
|
||||
|
||||
out.writeObject(apiCommand);
|
||||
} else {
|
||||
LOGGER.debug("Command " + command + " is not exposed in api doc");
|
||||
LOGGER.debug("Command {} is not exposed in api doc", command);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -361,49 +350,6 @@ public class ApiXmlDocWriter {
|
|||
return arguments;
|
||||
}
|
||||
|
||||
private static void zipDir(String zipFileName, String dir) throws Exception {
|
||||
File dirObj = new File(dir);
|
||||
ZipOutputStream out = new ZipOutputStream(new FileOutputStream(zipFileName));
|
||||
addDir(dirObj, out);
|
||||
out.close();
|
||||
}
|
||||
|
||||
static void addDir(File dirObj, ZipOutputStream out) throws IOException {
|
||||
File[] files = dirObj.listFiles();
|
||||
byte[] tmpBuf = new byte[1024];
|
||||
String pathToDir = s_dirName;
|
||||
|
||||
for (int i = 0; i < files.length; i++) {
|
||||
if (files[i].isDirectory()) {
|
||||
addDir(files[i], out);
|
||||
continue;
|
||||
}
|
||||
try(FileInputStream in = new FileInputStream(files[i].getPath());) {
|
||||
out.putNextEntry(new ZipEntry(files[i].getPath().substring(pathToDir.length())));
|
||||
int len;
|
||||
while ((len = in.read(tmpBuf)) > 0) {
|
||||
out.write(tmpBuf, 0, len);
|
||||
}
|
||||
out.closeEntry();
|
||||
}catch(IOException ex)
|
||||
{
|
||||
LOGGER.error("addDir:Exception:"+ ex.getMessage(),ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void deleteDir(File dir) {
|
||||
if (dir.isDirectory()) {
|
||||
String[] children = dir.list();
|
||||
if (children != null) {
|
||||
for (int i = 0; i < children.length; i++) {
|
||||
deleteDir(new File(dir, children[i]));
|
||||
}
|
||||
}
|
||||
}
|
||||
dir.delete();
|
||||
}
|
||||
|
||||
private static void writeAlertTypes(String dirName) {
|
||||
XStream xs = new XStream();
|
||||
xs.alias("alert", Alert.class);
|
||||
|
|
@ -421,20 +367,4 @@ public class ApiXmlDocWriter {
|
|||
LOGGER.error("Failed to read alert fields ", e);
|
||||
}
|
||||
}
|
||||
|
||||
private static class LinkedProperties extends Properties {
|
||||
private final LinkedList<Object> keys = new LinkedList<Object>();
|
||||
|
||||
@Override
|
||||
public Enumeration<Object> keys() {
|
||||
return Collections.<Object> enumeration(keys);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object put(Object key, Object value) {
|
||||
// System.out.println("Adding key" + key);
|
||||
keys.add(key);
|
||||
return super.put(key, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,6 +46,9 @@ dirname_to_dirname = {
|
|||
|
||||
|
||||
known_categories = {
|
||||
# Use the category definition formats below:
|
||||
# keyword or api: category - to choose category based on keyword or api in the api call
|
||||
# api: (category, True|False) - True - use the category defined (i.e. direct api to category mapping), False - choose category same as above
|
||||
'Cisco' : 'External Device',
|
||||
'SystemVm': 'System VM',
|
||||
'VirtualMachine': 'Virtual Machine',
|
||||
|
|
@ -53,7 +56,7 @@ known_categories = {
|
|||
'Vnf': 'Virtual Network Functions',
|
||||
'VnfTemplate': 'Virtual Network Functions',
|
||||
'GuestSubnet': 'Routing',
|
||||
'HypervisorGuestOsNames': 'Guest OS',
|
||||
'GuestOs': 'Guest OS',
|
||||
'Domain': 'Domain',
|
||||
'Template': 'Template',
|
||||
'Iso': 'ISO',
|
||||
|
|
@ -66,10 +69,14 @@ known_categories = {
|
|||
'IpForwarding': 'NAT',
|
||||
'Host': 'Host',
|
||||
'HostTags': 'Host',
|
||||
'cancelHostMaintenance': 'Host',
|
||||
'prepareHostForMaintenance': 'Host',
|
||||
'startRollingMaintenance': 'Host',
|
||||
'OutOfBandManagement': 'Out-of-band Management',
|
||||
'Cluster': 'Cluster',
|
||||
'Account': 'Account',
|
||||
'Role': 'Role',
|
||||
'VMSnapshot': 'VM Snapshot',
|
||||
'Snapshot': 'Snapshot',
|
||||
'User': 'User',
|
||||
'UserData': 'User Data',
|
||||
|
|
@ -85,38 +92,34 @@ known_categories = {
|
|||
'ManagementNetworkIpRange': 'Pod',
|
||||
'PublicIpRange': 'Network',
|
||||
'Zone': 'Zone',
|
||||
'Vmware' : 'Zone',
|
||||
'VmwareDc' : 'Zone',
|
||||
'NetworkOffering': 'Network Offering',
|
||||
'NetworkACL': 'Network ACL',
|
||||
'NetworkAclItem': 'Network ACL',
|
||||
'Network': 'Network',
|
||||
'CiscoNexus': 'Network',
|
||||
'OpenDaylight': 'Network',
|
||||
'CiscoNexusVSM': 'Cisco Nexus VSM',
|
||||
'OpenDaylightController': 'OpenDaylight Controller',
|
||||
'createServiceInstance': 'Network',
|
||||
'addGloboDnsHost': 'Network',
|
||||
'TungstenFabric': 'Tungsten',
|
||||
'listNsxControllers': 'NSX',
|
||||
'addNsxController': 'NSX',
|
||||
'deleteNsxController': 'NSX',
|
||||
'NsxController': 'NSX',
|
||||
'NetrisProvider': 'Netris',
|
||||
'Vpn': 'VPN',
|
||||
'Limit': 'Resource Limit',
|
||||
'Netscaler': 'Netscaler',
|
||||
'NetscalerControlCenter': 'Netscaler',
|
||||
'NetscalerLoadBalancer': 'Netscaler',
|
||||
'SolidFire': 'SolidFire',
|
||||
'PaloAlto': 'Palo Alto',
|
||||
'ResourceCount': 'Limit',
|
||||
'ResourceCount': 'Resource Limit',
|
||||
'CloudIdentifier': 'Cloud Identifier',
|
||||
'InstanceGroup': 'VM Group',
|
||||
'StorageMaintenance': 'Storage Pool',
|
||||
'StoragePool': 'Storage Pool',
|
||||
'StorageTags': 'Storage Pool',
|
||||
'StorageProvider': 'Storage Pool',
|
||||
'StorageScope' : 'Storage Pool',
|
||||
'updateStorageCapabilities' : 'Storage Pool',
|
||||
'SecurityGroup': 'Security Group',
|
||||
'SSH': 'SSH',
|
||||
'AsyncJob': 'Async job',
|
||||
'SSHKeyPair': 'SSH KeyPair',
|
||||
'AsyncJob': 'Async Job',
|
||||
'Certificate': 'Certificate',
|
||||
'Hypervisor': 'Configuration',
|
||||
'Alert': 'Alert',
|
||||
|
|
@ -126,13 +129,10 @@ known_categories = {
|
|||
'saml': 'Authentication',
|
||||
'getSPMetadata': 'Authentication',
|
||||
'listIdps': 'Authentication',
|
||||
'authorizeSamlSso': 'Authentication',
|
||||
'listSamlAuthorization': 'Authentication',
|
||||
# 'authorizeSamlSso': 'Authentication',
|
||||
# 'listSamlAuthorization': 'Authentication',
|
||||
'oauthlogin': 'Authentication',
|
||||
'deleteOauthProvider': 'Oauth',
|
||||
'listOauthProvider': 'Oauth',
|
||||
'registerOauthProvider': 'Oauth',
|
||||
'updateOauthProvider': 'Oauth',
|
||||
'OauthProvider': 'OAuth',
|
||||
'quota': 'Quota',
|
||||
'emailTemplate': 'Quota',
|
||||
'Capacity': 'System Capacity',
|
||||
|
|
@ -144,7 +144,6 @@ known_categories = {
|
|||
'TrafficType': 'Network',
|
||||
'Product': 'Product',
|
||||
'LB': 'Load Balancer',
|
||||
'ldap': 'LDAP',
|
||||
'Ldap': 'LDAP',
|
||||
'Swift': 'Image Store',
|
||||
'S3' : 'S3',
|
||||
|
|
@ -156,9 +155,9 @@ known_categories = {
|
|||
'VPCOffering': 'VPC Offering',
|
||||
'PrivateGateway': 'VPC',
|
||||
'migrateVpc': 'VPC',
|
||||
'Simulator': 'simulator',
|
||||
'Simulator': 'Simulator',
|
||||
'StaticRoute': 'VPC',
|
||||
'Tags': 'Resource tags',
|
||||
'Tags': 'Resource Tags',
|
||||
'Icon': 'Resource Icon',
|
||||
'NiciraNvpDevice': 'Nicira NVP',
|
||||
'BrocadeVcsDevice': 'Brocade VCS',
|
||||
|
|
@ -169,21 +168,14 @@ known_categories = {
|
|||
'Api': 'API Discovery',
|
||||
'ApiLimit': 'Configuration',
|
||||
'Region': 'Region',
|
||||
'Detail': 'Resource metadata',
|
||||
'addIpToNic': 'Nic',
|
||||
'removeIpFromNic': 'Nic',
|
||||
'updateVmNicIp': 'Nic',
|
||||
'listNics':'Nic',
|
||||
'Detail': 'Resource Metadata',
|
||||
'addIpToNic': 'NIC',
|
||||
'removeIpFromNic': 'NIC',
|
||||
'updateVmNicIp': 'NIC',
|
||||
'listNics':'NIC',
|
||||
'AffinityGroup': 'Affinity Group',
|
||||
'ImageStore': 'Image Store',
|
||||
'addImageStore': 'Image Store',
|
||||
'listImageStore': 'Image Store',
|
||||
'deleteImageStore': 'Image Store',
|
||||
'createSecondaryStagingStore': 'Image Store',
|
||||
'deleteSecondaryStagingStore': 'Image Store',
|
||||
'listSecondaryStagingStores': 'Image Store',
|
||||
'updateImageStore': 'Image Store',
|
||||
'downloadImageStoreObject': 'Image Store',
|
||||
'SecondaryStagingStore': 'Image Store',
|
||||
'InternalLoadBalancer': 'Internal LB',
|
||||
'DeploymentPlanners': 'Configuration',
|
||||
'ObjectStore': 'Image Store',
|
||||
|
|
@ -192,98 +184,77 @@ known_categories = {
|
|||
'releaseDedicatedHost': 'Dedicate Resources',
|
||||
'Baremetal' : 'Baremetal',
|
||||
'UCS' : 'UCS',
|
||||
'Ucs' : 'UCS',
|
||||
'CacheStores' : 'Cache Stores',
|
||||
'CacheStore' : 'Cache Store',
|
||||
'OvsElement' : 'Ovs Element',
|
||||
'StratosphereSsp' : 'Misc Network Service Providers',
|
||||
'StratosphereSsp' : 'Stratosphere SSP',
|
||||
'Metrics' : 'Metrics',
|
||||
'listClustersMetrics': 'Cluster',
|
||||
'VpnUser': 'VPN',
|
||||
'listZonesMetrics': 'Metrics',
|
||||
'Infrastructure' : 'Metrics',
|
||||
'listRegisteredServicePackages': 'Load Balancer',
|
||||
'listNsVpx' : 'Load Balancer',
|
||||
'destroyNsVPx': 'Load Balancer',
|
||||
'deployNetscalerVpx' : 'Load Balancer',
|
||||
'stopNetScalerVpx' : 'Load Balancer',
|
||||
'NsVpx' : 'Load Balancer',
|
||||
'NetscalerVpx' : 'Load Balancer',
|
||||
'deleteServicePackageOffering' : 'Load Balancer',
|
||||
'destroyNsVpx' : 'Load Balancer',
|
||||
'startNsVpx' : 'Load Balancer',
|
||||
'listAnnotations' : 'Annotations',
|
||||
'addAnnotation' : 'Annotations',
|
||||
'removeAnnotation' : 'Annotations',
|
||||
'updateAnnotationVisibility' : 'Annotations',
|
||||
'Annotation' : 'Annotations',
|
||||
'CA': 'Certificate',
|
||||
'listElastistorInterface': 'Misc',
|
||||
'Elastistor': 'Elastistor',
|
||||
'cloudian': 'Cloudian',
|
||||
'Sioc' : 'Sioc',
|
||||
'Diagnostics': 'Diagnostics',
|
||||
'Management': 'Management',
|
||||
'ManagementServer': 'Management Server',
|
||||
'Backup' : 'Backup and Recovery',
|
||||
'Restore' : 'Backup and Recovery',
|
||||
'UnmanagedInstance': 'Virtual Machine',
|
||||
'KubernetesSupportedVersion': 'Kubernetes Service',
|
||||
'KubernetesCluster': 'Kubernetes Service',
|
||||
'Kubernetes': 'Kubernetes Service',
|
||||
'Rolling': 'Rolling Maintenance',
|
||||
'importVsphereStoragePolicies' : 'vSphere storage policies',
|
||||
'listVsphereStoragePolicies' : 'vSphere storage policies',
|
||||
'vsphereStoragePolicy' : 'vSphere storage policies',
|
||||
'vsphereStoragePolicies' : 'vSphere storage policies',
|
||||
'createConsoleEndpoint': 'Console Session',
|
||||
'listConsoleSessions': 'Console Session',
|
||||
'importVm': 'Virtual Machine',
|
||||
'revertToVMSnapshot': 'Virtual Machine',
|
||||
'listQuarantinedIp': 'IP Quarantine',
|
||||
'updateQuarantinedIp': 'IP Quarantine',
|
||||
'removeQuarantinedIp': 'IP Quarantine',
|
||||
'Shutdown': 'Maintenance',
|
||||
'Maintenance': 'Maintenance',
|
||||
'addObjectStoragePool': 'Object Store',
|
||||
'listObjectStoragePools': 'Object Store',
|
||||
'deleteObjectStoragePool': 'Object Store',
|
||||
'updateObjectStoragePool': 'Object Store',
|
||||
'createBucket': 'Object Store',
|
||||
'updateBucket': 'Object Store',
|
||||
'deleteBucket': 'Object Store',
|
||||
'listBuckets': 'Object Store',
|
||||
'ImportVmTask': 'Virtual Machine',
|
||||
'listVmsForImport': 'Virtual Machine',
|
||||
'revertToVMSnapshot': 'Virtual Machine',
|
||||
'QuarantinedIp': 'IP Quarantine',
|
||||
'Shutdown': 'Management Server',
|
||||
'Maintenance': 'Management Server',
|
||||
'ObjectStoragePool': 'Object Store',
|
||||
'Bucket': 'Object Store',
|
||||
'SharedFS': 'Shared FileSystem',
|
||||
'SharedFileSystem': 'Shared FileSystem',
|
||||
'Webhook': 'Webhook',
|
||||
'Webhooks': 'Webhook',
|
||||
'purgeExpungedResources': 'Resource',
|
||||
'forgotPassword': 'Authentication',
|
||||
'resetPassword': 'Authentication',
|
||||
'BgpPeer': 'BGP Peer',
|
||||
'createASNRange': 'AS Number Range',
|
||||
'listASNRange': 'AS Number Range',
|
||||
'deleteASNRange': 'AS Number Range',
|
||||
'listASNumbers': 'AS Number',
|
||||
'releaseASNumber': 'AS Number',
|
||||
'addNodesToKubernetesCluster': 'Kubernetes Service',
|
||||
'removeNodesFromKubernetesCluster': 'Kubernetes Service',
|
||||
'configureStorageAccess': 'Storage Access Groups',
|
||||
'listStorageAccessGroups': 'Storage Access Groups',
|
||||
'listGuiThemes': 'GUI Theme',
|
||||
'createGuiTheme': 'GUI Theme',
|
||||
'updateGuiTheme': 'GUI Theme',
|
||||
'removeGuiTheme': 'GUI Theme',
|
||||
'Gpu': 'GPU',
|
||||
'Vgpu': 'GPU',
|
||||
'changeBgpPeersForNetwork': 'BGP Peer',
|
||||
'ASNRange': 'AS Number Range',
|
||||
'ASNumber': 'AS Number',
|
||||
'StorageAccess': 'Storage Access Groups',
|
||||
'GuiTheme': 'GUI Theme',
|
||||
'GPU': 'GPU',
|
||||
'vGPU': 'GPU',
|
||||
'GPUCard': 'GPU',
|
||||
'Extension' : 'Extension',
|
||||
'Extensions' : 'Extension',
|
||||
'CustomAction' : 'Extension',
|
||||
'CustomActions' : 'Extension',
|
||||
'ImportVmTask': 'Import VM Task'
|
||||
'CustomAction' : 'Extension'
|
||||
}
|
||||
|
||||
|
||||
categories = {}
|
||||
|
||||
choosing_category = 1
|
||||
|
||||
|
||||
def choose_category(fn):
|
||||
global choosing_category
|
||||
print("choosing_category - " + str(choosing_category) + " , for fn: " + fn)
|
||||
choosing_category = choosing_category + 1
|
||||
possible_known_categories = []
|
||||
i = 1
|
||||
for k, v in known_categories.items():
|
||||
if k in fn:
|
||||
print(str(i) + " - k:" + k + ", v:" + v + " fn: " + fn + "\n")
|
||||
i = i + 1
|
||||
if k.lower() in fn.lower():
|
||||
print("add to possible_known_categories - " + k + "\n")
|
||||
possible_known_categories.append(k)
|
||||
|
||||
if len(possible_known_categories) > 0:
|
||||
|
|
|
|||
|
|
@ -1,194 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
version="1.0">
|
||||
<xsl:output method="html" doctype-public="-//W3C//DTD HTML 1.0 Transitional//EN"/>
|
||||
<xsl:template match="/">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
||||
<link rel= "stylesheet" href="../includes/main.css" type="text/css" />
|
||||
<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" />
|
||||
|
||||
<title>CloudStack API Reference</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="insidetopbg">
|
||||
<div id="inside_wrapper">
|
||||
<div class="uppermenu_panel">
|
||||
<div class="uppermenu_box"><!-- #BeginLibraryItem "/libraries/uppermenu.lbi" -->
|
||||
|
||||
<div class="uppermenu">
|
||||
<a href="libraries/learn_download.html">Downloads</a> | <a href="libraries/company_news.html">News</a> | <a href="#">Contact Us</a>
|
||||
</div><!-- #EndLibraryItem --></div>
|
||||
</div>
|
||||
|
||||
<div id="main_controller">
|
||||
<div id="inside_header">
|
||||
|
||||
<div class="header_top">
|
||||
<a class="cloud_logo" href="index.html"></a>
|
||||
<div class="mainemenu_panel">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="insideheader_bot">
|
||||
<div class="insideheader_botleft">
|
||||
<h1></h1>
|
||||
</div>
|
||||
|
||||
<div class="insideheader_botright">
|
||||
<div class="insideheader_button">
|
||||
<a class="insjoincomm_button" href="#"></a>
|
||||
<a class="insdownload_button" href="#"></a>
|
||||
</div>
|
||||
<div class="insheader_buttonshadow"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="main_content">
|
||||
|
||||
<div class="inside_apileftpanel">
|
||||
<div class="inside_contentpanel" style="width:930px;">
|
||||
<div class="api_titlebox">
|
||||
<div class="api_titlebox_left">
|
||||
<xsl:for-each select="command/command">
|
||||
<h1><xsl:value-of select="name"/></h1>
|
||||
<span><xsl:value-of select="description"/></span>
|
||||
</xsl:for-each>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="api_titlebox_right">
|
||||
<a class="api_backbutton" href="#"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="api_tablepanel">
|
||||
<h2>Request parameters</h2>
|
||||
<table class="apitable">
|
||||
<tr class="hed">
|
||||
<td style="width:200px;"><strong>Parameter Name</strong></td>
|
||||
|
||||
<td style="width:500px;">Description</td>
|
||||
<td style="width:180px;">Required</td>
|
||||
</tr>
|
||||
<xsl:for-each select="command/command/request/arg">
|
||||
<tr>
|
||||
<td style="width:200px;"><strong><xsl:value-of select="name"/></strong></td>
|
||||
<td style="width:500px;"><xsl:value-of select="description"/></td>
|
||||
<td style="width:180px;"><xsl:value-of select="required"/></td>
|
||||
|
||||
</tr>
|
||||
</xsl:for-each>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="api_tablepanel">
|
||||
<h2>Response Tags</h2>
|
||||
<table class="apitable">
|
||||
<tr class="hed">
|
||||
<td style="width:200px;"><strong>Response Name</strong></td>
|
||||
<td style="width:500px;">Description</td>
|
||||
</tr>
|
||||
|
||||
<xsl:for-each select="command/command/response/arg">
|
||||
<tr>
|
||||
<td style="width:200px;"><strong><xsl:value-of select="name"/></strong></td>
|
||||
<td style="width:500px;"><xsl:value-of select="description"/></td>
|
||||
<xsl:for-each select="./arguments/arg">
|
||||
<tr>
|
||||
<td style="width:200px;"><strong><xsl:value-of select="name"/></strong></td>
|
||||
<td style="width:500px;"><xsl:value-of select="description"/></td>
|
||||
</tr>
|
||||
<xsl:for-each select="./arguments/arg">
|
||||
<tr>
|
||||
<td style="width:200px;"><strong><xsl:value-of select="name"/></strong></td>
|
||||
<td style="width:500px;"><xsl:value-of select="description"/></td>
|
||||
</tr>
|
||||
</xsl:for-each>
|
||||
</xsl:for-each>
|
||||
</tr>
|
||||
</xsl:for-each>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div><!-- #BeginLibraryItem "/libraries/footer.lbi" -->
|
||||
<div id="footer">
|
||||
|
||||
<div id="footer_maincontroller">
|
||||
<ul class="footer_linksbox">
|
||||
<li><strong> Main </strong></li>
|
||||
<li> <a href="index.html"> Home</a> </li>
|
||||
<li> <a href="learn_whatcloud.html"> Learn</a> </li>
|
||||
|
||||
<li> <a href="products_cloudplatform.html"> Products</a> </li>
|
||||
<li> <a href="#"> Community</a> </li>
|
||||
<li> <a href="service_overview.html"> Services</a> </li>
|
||||
|
||||
<li> <a href="Partners_Main.html"> Partners</a> </li>
|
||||
<li> <a href="company_about.html"> Company</a> </li>
|
||||
</ul>
|
||||
<ul class="footer_linksbox">
|
||||
<li><strong> Sub </strong> </li>
|
||||
|
||||
<li> <a href="learn_videos.html"> Tour</a> </li>
|
||||
<li> <a href="learn_download.html"> Downloads</a> </li>
|
||||
<li> <a href="learn_FAQ.html"> FAQs</a> </li>
|
||||
|
||||
<li> <a href="#"> Blog</a> </li>
|
||||
<li> <a href="#"> Contacts</a> </li>
|
||||
|
||||
</ul>
|
||||
<ul class="footer_linksbox">
|
||||
<li><strong> Site Info </strong> </li>
|
||||
|
||||
<li> <a href="#"> Privacy Policy</a> </li>
|
||||
<li> <a href="#"> Term of Use</a> </li>
|
||||
<li> <a href="#"> Contacts</a> </li>
|
||||
|
||||
</ul>
|
||||
<p>Copyright © 2015 The Apache Software Foundation, Licensed under the
|
||||
<a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0.</a> <br />
|
||||
Apache, CloudStack, Apache CloudStack, the Apache CloudStack logo, the CloudMonkey logo and the Apache feather logo are trademarks of The Apache Software Foundation.</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
||||
|
|
@ -60,7 +60,18 @@ version="1.0">
|
|||
</span>
|
||||
<p></p>
|
||||
<h1><xsl:value-of select="name"/></h1>
|
||||
<p><xsl:value-of select="description"/></p>
|
||||
<xsl:if test="sinceVersion">
|
||||
<h1>(since: <xsl:value-of select="sinceVersion"/>)</h1>
|
||||
<h2>(since: <xsl:value-of select="sinceVersion"/>)</h2>
|
||||
<h2>since: <xsl:value-of select="sinceVersion"/></h2>
|
||||
<h3>(since: <xsl:value-of select="sinceVersion"/>)</h3>
|
||||
</xsl:if>
|
||||
<span>
|
||||
<xsl:value-of select="description"/>
|
||||
<xsl:if test="sinceVersion">
|
||||
<xsl:text> </xsl:text>(since: <xsl:value-of select="sinceVersion"/>)
|
||||
</xsl:if>
|
||||
</span>
|
||||
</xsl:for-each>
|
||||
</div>
|
||||
|
||||
|
|
@ -70,7 +81,7 @@ version="1.0">
|
|||
</div>
|
||||
</div>
|
||||
<div class="api_tablepanel">
|
||||
<h2>Request parameters</h2>
|
||||
<h2>Request Parameters</h2>
|
||||
<table class="apitable">
|
||||
<tr class="hed">
|
||||
<td style="width:200px;"><strong>Parameter Name</strong></td>
|
||||
|
|
@ -81,13 +92,37 @@ version="1.0">
|
|||
<xsl:for-each select="command/command/request/arg">
|
||||
<tr>
|
||||
<xsl:if test="required='true'">
|
||||
<td style="width:200px;"><strong><xsl:value-of select="name"/></strong></td>
|
||||
<td style="width:500px;"><strong><xsl:value-of select="description"/></strong></td>
|
||||
<td style="width:200px;">
|
||||
<strong><xsl:value-of select="name"/></strong>
|
||||
<xsl:if test="sinceVersion">
|
||||
<xsl:text> </xsl:text>(since: <xsl:value-of select="sinceVersion"/>)
|
||||
</xsl:if>
|
||||
</td>
|
||||
<td style="width:500px;">
|
||||
<strong>
|
||||
<xsl:value-of select="description"/>
|
||||
<xsl:if test="sinceVersion">
|
||||
<xsl:text> </xsl:text>(since: <xsl:value-of select="sinceVersion"/>)
|
||||
</xsl:if>
|
||||
</strong>
|
||||
</td>
|
||||
<td style="width:180px;"><strong><xsl:value-of select="required"/></strong></td>
|
||||
</xsl:if>
|
||||
<xsl:if test="required='false'">
|
||||
<td style="width:200px;"><i><xsl:value-of select="name"/></i></td>
|
||||
<td style="width:500px;"><i><xsl:value-of select="description"/></i></td>
|
||||
<td style="width:200px;">
|
||||
<i><xsl:value-of select="name"/></i>
|
||||
<xsl:if test="sinceVersion">
|
||||
<xsl:text> </xsl:text>(since: <xsl:value-of select="sinceVersion"/>)
|
||||
</xsl:if>
|
||||
</td>
|
||||
<td style="width:500px;">
|
||||
<i>
|
||||
<xsl:value-of select="description"/>
|
||||
<xsl:if test="sinceVersion">
|
||||
<xsl:text> </xsl:text>(since: <xsl:value-of select="sinceVersion"/>)
|
||||
</xsl:if>
|
||||
</i>
|
||||
</td>
|
||||
<td style="width:180px;"><i><xsl:value-of select="required"/></i></td>
|
||||
</xsl:if>
|
||||
</tr>
|
||||
|
|
@ -97,7 +132,7 @@ version="1.0">
|
|||
|
||||
|
||||
<div class="api_tablepanel">
|
||||
<h2>Response Tags</h2>
|
||||
<h2>Response Parameters</h2>
|
||||
<table class="apitable">
|
||||
<tr class="hed">
|
||||
<td style="width:200px;"><strong>Response Name</strong></td>
|
||||
|
|
@ -106,17 +141,37 @@ version="1.0">
|
|||
|
||||
<xsl:for-each select="command/command/response/arg">
|
||||
<tr>
|
||||
<td style="width:200px;"><strong><xsl:value-of select="name"/></strong></td>
|
||||
<td style="width:500px;"><xsl:value-of select="description"/></td>
|
||||
<td style="width:200px;">
|
||||
<strong><xsl:value-of select="name"/></strong>
|
||||
<xsl:if test="sinceVersion">
|
||||
<xsl:text> </xsl:text>(since: <xsl:value-of select="sinceVersion"/>)
|
||||
</xsl:if>
|
||||
</td>
|
||||
<td style="width:500px;">
|
||||
<xsl:value-of select="description"/>
|
||||
<xsl:if test="sinceVersion">
|
||||
<xsl:text> </xsl:text>(since: <xsl:value-of select="sinceVersion"/>)
|
||||
</xsl:if>
|
||||
</td>
|
||||
<xsl:for-each select="./arguments/arg">
|
||||
<tr>
|
||||
<td style="width:180px; padding-left:25px;"><strong><xsl:value-of select="name"/></strong></td>
|
||||
<td style="width:180px; padding-left:25px;">
|
||||
<strong><xsl:value-of select="name"/></strong>
|
||||
<xsl:if test="sinceVersion">
|
||||
<xsl:text> </xsl:text>(since: <xsl:value-of select="sinceVersion"/>)
|
||||
</xsl:if>
|
||||
</td>
|
||||
<td style="width:500px;"><xsl:value-of select="description"/></td>
|
||||
</tr>
|
||||
<xsl:for-each select="./arguments/arg">
|
||||
<tr>
|
||||
<td style="width:165px; padding-left:40px;"><xsl:value-of select="name"/></td>
|
||||
<td style="width:500px;"><xsl:value-of select="description"/></td>
|
||||
<td style="width:500px;">
|
||||
<xsl:value-of select="description"/>
|
||||
<xsl:if test="sinceVersion">
|
||||
<xsl:text> </xsl:text>(since: <xsl:value-of select="sinceVersion"/>)
|
||||
</xsl:if>
|
||||
</td>
|
||||
</tr>
|
||||
</xsl:for-each>
|
||||
</xsl:for-each>
|
||||
|
|
|
|||
|
|
@ -1,64 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
version="1.0">
|
||||
<xsl:template match="/">
|
||||
<html>
|
||||
<head><title>Cloudstack API</title></head>
|
||||
<body>
|
||||
<table border="1">
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Description</th>
|
||||
<th>Request Parameters</th>
|
||||
<th>Response Parameters</th>
|
||||
</tr>
|
||||
<xsl:for-each select="command/command">
|
||||
<tr>
|
||||
<td><xsl:value-of select="name"/></td>
|
||||
<td><xsl:value-of select="description"/></td>
|
||||
<td>
|
||||
<xsl:for-each select="./request/arg">
|
||||
<br><b>Name:</b><xsl:value-of select="name"/></br>
|
||||
<b>Description:</b><xsl:value-of select="description"/>
|
||||
<br><b>Required:</b><xsl:value-of select="required"/></br>
|
||||
</xsl:for-each>
|
||||
</td>
|
||||
<td>
|
||||
<xsl:for-each select="./response/arg">
|
||||
<br><b>Name:</b><xsl:value-of select="name"/></br>
|
||||
<b>Description:</b><xsl:value-of select="description"/>
|
||||
<xsl:for-each select="./arguments/arg">
|
||||
<br><b>Name:</b><xsl:value-of select="name"/></br>
|
||||
<b>Description:</b><xsl:value-of select="description"/>
|
||||
<xsl:for-each select="./arguments/arg">
|
||||
<br><b>Name:</b><xsl:value-of select="name"/></br>
|
||||
<b>Description:</b><xsl:value-of select="description"/>
|
||||
</xsl:for-each>
|
||||
</xsl:for-each>
|
||||
<br></br>
|
||||
</xsl:for-each>
|
||||
</td>
|
||||
</tr>
|
||||
</xsl:for-each>
|
||||
</table>
|
||||
</body></html>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
||||
|
|
@ -1,56 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
version="1.0">
|
||||
<xsl:template match="/">
|
||||
<html>
|
||||
<head><title>Cloudstack API</title></head>
|
||||
<body>
|
||||
<table border="1">
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Description</th>
|
||||
<th>Request Parameters</th>
|
||||
<th>Response Parameters</th>
|
||||
</tr>
|
||||
<xsl:for-each select="command/command">
|
||||
<tr>
|
||||
<td><xsl:value-of select="name"/></td>
|
||||
<td><xsl:value-of select="description"/></td>
|
||||
<td>
|
||||
<xsl:for-each select="./request/arg">
|
||||
<br><b>Name:</b><xsl:value-of select="name"/></br>
|
||||
<b>Description:</b><xsl:value-of select="description"/>
|
||||
<br><b>Required:</b><xsl:value-of select="required"/></br>
|
||||
</xsl:for-each>
|
||||
</td>
|
||||
<td>
|
||||
<xsl:for-each select="./response/arg">
|
||||
<br><b>Name:</b><xsl:value-of select="name"/></br>
|
||||
<b>Description:</b><xsl:value-of select="description"/>
|
||||
<br></br>
|
||||
</xsl:for-each>
|
||||
</td>
|
||||
</tr>
|
||||
</xsl:for-each>
|
||||
</table>
|
||||
</body></html>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
||||
Loading…
Reference in New Issue