ResourceAllocation (Java Application API for IBM Streams)
Date: 2020-08-07

com.ibm.streamsx.rest

## Class ResourceAllocation

- java.lang.Object
- - com.ibm.streamsx.rest.Element
  - - com.ibm.streamsx.rest.ResourceAllocation

-     public class ResourceAllocation
      extends Element

  Access to information about a resource that is allocated to a Streams instance.
  Since:
    1.9

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ResourceAllocation()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Instance` | `getInstance()` Obtain the `Instance` this resource is allocated to.
    `java.util.List<Job>` | `getJobs()` Gets a list of jobs running on this resource in this instance.
    `java.util.List<ProcessingElement>` | `getPes()` Gets a list of processing elements running on this resource in this instance.
    `Resource` | `getResource()` Obtain the `Resource` object for detailed information on the resource.
    `java.lang.String` | `getResourceType()` Identifies the REST resource type
    `java.lang.String` | `getSchedulerStatus()` Status of the resource.
    `java.lang.String` | `getStatus()` Scheduler status of the resource.
    `boolean` | `isApplicationResource()` Indicates whether the resource is an application resource.

    - ### Methods inherited from class com.ibm.streamsx.rest.Element

      `getStreamsConnection, refresh, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### ResourceAllocation

          public ResourceAllocation()

  - ### Method Detail

    - #### getResourceType

          public java.lang.String getResourceType()

      Identifies the REST resource type
      Returns:
        "resourceAllocation"

    - #### isApplicationResource

          public boolean isApplicationResource()

      Indicates whether the resource is an application resource. Application resources are used to run streams processing applications.
      Returns:
        `true` if this is an application resource otherwise `false`.

    - #### getSchedulerStatus

          public java.lang.String getSchedulerStatus()

      Status of the resource. Some possible values for this property include `failed`, `partiallyFailed`, `partiallyRunning`, `quiesced`, `quiescing`, `running`, `restarting`, `resuming`, `starting`, `stopped`, and `unknown`.
      Returns:
        Status of the resource.

    - #### getStatus

          public java.lang.String getStatus()

      Scheduler status of the resource. When a resource is schedulable it is available for running streams processing applications.
      Returns:
        Status of the resource.
      See Also:
        Resource status values - Table 2. Schedulable states

    - #### getResource

          public Resource getResource()
                               throws java.io.IOException

      Obtain the `Resource` object for detailed information on the resource.
      Returns:
        Resource.
      Throws:
        `java.io.IOException` - Exception communicating with Streams instance.

    - #### getInstance

          public Instance getInstance()
                               throws java.io.IOException

      Obtain the `Instance` this resource is allocated to.
      Returns:
        Instance this resource is allocated to.
      Throws:
        `java.io.IOException` - Exception communicating with Streams instance.

    - #### getJobs

          public java.util.List<Job> getJobs()
                                      throws java.io.IOException

      Gets a list of jobs running on this resource in this instance.
      Returns:
        List of `IBM Streams Jobs`
      Throws:
        `java.io.IOException` - Exception communicating with Streams instance.

    - #### getPes

          public java.util.List<ProcessingElement> getPes()
                                                   throws java.io.IOException

      Gets a list of processing elements running on this resource in this instance.
      Returns:
        List of `Processing Elements`
      Throws:
        `java.io.IOException` - Exception communicating with Streams instance.