Search in sources :

Example 31 with PlatformLayerClient

use of org.platformlayer.PlatformLayerClient in project platformlayer by platformlayer.

the class ScriptCommands method getActivation.

public static Object getActivation(String serviceType) throws PlatformLayerClientException, JSONException {
    PlatformLayerCliContext context = PlatformLayerCliContext.get();
    PlatformLayerClient client = context.getPlatformLayerClient();
    String retvalJsonString = client.getActivation(serviceType, Format.JSON);
    JSONObject retvalJsonObject = new JSONObject(retvalJsonString);
    return toPython(retvalJsonObject);
}
Also used : PlatformLayerClient(org.platformlayer.PlatformLayerClient) JSONObject(org.codehaus.jettison.json.JSONObject) PlatformLayerCliContext(org.platformlayer.client.cli.PlatformLayerCliContext)

Example 32 with PlatformLayerClient

use of org.platformlayer.PlatformLayerClient in project platformlayer by platformlayer.

the class ScriptCommands method getSshPublicKey.

public static Object getSshPublicKey(String serviceType) throws PlatformLayerClientException, JSONException {
    PlatformLayerCliContext context = PlatformLayerCliContext.get();
    PlatformLayerClient client = context.getPlatformLayerClient();
    String key = client.getSshPublicKey(serviceType);
    return toPython(key);
}
Also used : PlatformLayerClient(org.platformlayer.PlatformLayerClient) PlatformLayerCliContext(org.platformlayer.client.cli.PlatformLayerCliContext)

Example 33 with PlatformLayerClient

use of org.platformlayer.PlatformLayerClient in project platformlayer by platformlayer.

the class ListChildren method runCommand.

@Override
public Object runCommand() throws PlatformLayerClientException {
    PlatformLayerClient client = getPlatformLayerClient();
    PlatformLayerKey key = path.resolve(getContext());
    boolean includeDeleted = true;
    return client.listChildren(key, includeDeleted);
}
Also used : PlatformLayerClient(org.platformlayer.PlatformLayerClient) PlatformLayerKey(org.platformlayer.core.model.PlatformLayerKey)

Example 34 with PlatformLayerClient

use of org.platformlayer.PlatformLayerClient in project platformlayer by platformlayer.

the class ListJobExecutions method runCommand.

@Override
public Object runCommand() throws PlatformLayerClientException {
    PlatformLayerClient client = getPlatformLayerClient();
    JobExecutionList runs;
    if (jobId == null) {
        runs = client.listJobExecutions();
    } else {
        runs = client.listJobExecutions(jobId);
    }
    return runs;
}
Also used : PlatformLayerClient(org.platformlayer.PlatformLayerClient) JobExecutionList(org.platformlayer.jobs.model.JobExecutionList)

Example 35 with PlatformLayerClient

use of org.platformlayer.PlatformLayerClient in project platformlayer by platformlayer.

the class ListJobs method runCommand.

@Override
public Object runCommand() throws PlatformLayerClientException {
    PlatformLayerClient client = getPlatformLayerClient();
    JobDataList jobs;
    if (path == null) {
        jobs = client.listJobs();
    } else {
        PlatformLayerKey resolved = path.resolve(getContext());
        jobs = client.listJobs(resolved);
    }
    return jobs;
}
Also used : PlatformLayerClient(org.platformlayer.PlatformLayerClient) JobDataList(org.platformlayer.jobs.model.JobDataList) PlatformLayerKey(org.platformlayer.core.model.PlatformLayerKey)

Aggregations

PlatformLayerClient (org.platformlayer.PlatformLayerClient)36 PlatformLayerKey (org.platformlayer.core.model.PlatformLayerKey)21 UntypedItem (org.platformlayer.common.UntypedItem)7 TypedPlatformLayerClient (org.platformlayer.TypedPlatformLayerClient)4 PlatformLayerCliContext (org.platformlayer.client.cli.PlatformLayerCliContext)4 JobData (org.platformlayer.jobs.model.JobData)4 CliException (com.fathomdb.cli.CliException)3 InputStream (java.io.InputStream)3 HttpPlatformLayerClient (org.platformlayer.HttpPlatformLayerClient)3 UntypedItemXml (org.platformlayer.UntypedItemXml)3 Tag (org.platformlayer.core.model.Tag)3 ProjectId (org.platformlayer.ids.ProjectId)3 JobExecutionList (org.platformlayer.jobs.model.JobExecutionList)3 ClientAction (com.fathomdb.cli.output.ClientAction)2 NoCloseInputStream (com.fathomdb.io.NoCloseInputStream)2 IOException (java.io.IOException)2 JSONObject (org.codehaus.jettison.json.JSONObject)2 JSONObject (org.json.JSONObject)2 EndpointInfo (org.platformlayer.core.model.EndpointInfo)2 Link (org.platformlayer.core.model.Link)2