Class AkashClient

java.lang.Object
cloud.quasarch.akash.impl.AkashClient
All Implemented Interfaces:
Akash

public final class AkashClient extends Object implements Akash
Implementation of Akash.
  • Constructor Details

    • AkashClient

      public AkashClient(String accountAddress)
      Uses QUASARCH_AKASH_BASE_URI env variable to get baseUri address
      Parameters:
      accountAddress - address to be used when required.
    • AkashClient

      public AkashClient(String accountAddress, URI baseUri, Supplier<HttpClient> httpClientSupplier)
      Constructor for AkashClient
      Parameters:
      accountAddress - the address for the akt account
      baseUri - base uri for the api
      httpClientSupplier - supplier of HttpClient
  • Method Details

    • createDeployment

      public io.vavr.control.Either<OperationFailure,Deployment> createDeployment(Path sdlFile)
      Description copied from interface: Akash
      Create a deployment based on an SDL file. Request through RPC.
      Specified by:
      createDeployment in interface Akash
      Parameters:
      sdlFile - Path to the template file * @return Either OperationFailure or - if successful - Deployment
      Returns:
      Either with Deployment or with 'left' failure containing OperationFailure
    • closedDeployment

      public io.vavr.control.Either<OperationFailure,Deployment> closedDeployment(String leaseId)
      Description copied from interface: Akash
      OPEN QUESTION: LEASE ID OR DEPLOYMENT_ID?

      Close a deployment.

      Specified by:
      closedDeployment in interface Akash
      Parameters:
      leaseId - The id of the lease which will be terminated * @return Either OperationFailure or - if successful - Deployment
      Returns:
      Either with Deployment or with 'left' failure containing OperationFailure
    • createLease

      public io.vavr.control.Either<OperationFailure,DeploymentLease> createLease()
      Description copied from interface: Akash
      R_06 Provides lease creation capabilities
      Specified by:
      createLease in interface Akash
      Returns:
      TBD
    • sendManifest

      public io.vavr.control.Either<OperationFailure,?> sendManifest(Path sdlFile)
      Description copied from interface: Akash
      TODO SPEC R_08 Provides a way for a manifest/SDL file to be send. Part of the deployment process
      Specified by:
      sendManifest in interface Akash
      Parameters:
      sdlFile - the path for the deployment file descriptor
      Returns:
      TBD
    • updateManifest

      public io.vavr.control.Either<OperationFailure,?> updateManifest(Path sdlFile)
      Description copied from interface: Akash
      TODO SPEC R_09 updates the descriptor of an already deployment
      Specified by:
      updateManifest in interface Akash
      Parameters:
      sdlFile - the path for the deployment file descriptor
      Returns:
      TBD
    • listDeployments

      public io.vavr.control.Either<OperationFailure,Iterable<Deployment>> listDeployments(String owner, String state, String deploymentSequence)
      Description copied from interface: Akash
      List all the deployment for given ( optional ) filters. Clients should know that the returned iterable might need to fetch more data from upstream.
      Specified by:
      listDeployments in interface Akash
      Parameters:
      owner - The owner to filter for
      state - Filter for deployments in state.
      deploymentSequence - Deployment sequence number. This is a filter, not required
      Returns:
      Either OperationFailure or - if successful - Iterable<Deployment>
    • getDeployment

      public io.vavr.control.Either<OperationFailure,Deployment> getDeployment(String owner, String deploymentSequence)
      Description copied from interface: Akash
      Fetches deployment info for the given deployment id.
      Specified by:
      getDeployment in interface Akash
      Parameters:
      owner - ??
      deploymentSequence - ??
      Returns:
      Either Deployment or OperationFailure on failure
      See Also:
    • listBids

      public io.vavr.control.Either<OperationFailure,Iterable<Bid>> listBids(@Nullable String owner, @Nullable String deploymentSequence, @Nullable String groupSequence, @Nullable String oSeq, @Nullable String providerId, @Nullable String state)
      Description copied from interface: Akash
      Get the list of bids based on a set of filters.
      Specified by:
      listBids in interface Akash
      Parameters:
      owner - owner of the bid
      deploymentSequence - The deployment sequence
      groupSequence - GSEQ is used to distinguish “groups” of containers in a deployment. Each group can be leased independently - orders, bids, and leases all act on a single group.
      oSeq - Akash OSEQ is used to distinguish multiple orders associated with a single deployment.
      providerId - identification of the provider
      state - ??
      Returns:
      Either OperationFailure or - if successful - an Iterable<Bid>
    • getBid

      public io.vavr.control.Either<OperationFailure,Bid> getBid(String owner, String deploymentSequence, @Nullable String groupSequence, @Nullable String orderSequence, String providerId)
      Specified by:
      getBid in interface Akash
      Parameters:
      owner - mandatory, the account of the bid requester
      deploymentSequence - mandatory, the deployment sequence
      groupSequence - group sequence, defaults to 1 if not provided
      orderSequence - order sequence, defaults to 1 if not provided
      providerId - id of the provider where the bid was made
      Returns:
      Either the Bid object or the OperationFailure on failure
    • getLease

      public io.vavr.control.Either<OperationFailure,DeploymentLease> getLease(String owner, String deploymentSequence, String groupSequence, String orderSequence, String provider)
      Description copied from interface: Akash
      Get lease Get information regarding a lease such as its status.
      Specified by:
      getLease in interface Akash
      Parameters:
      owner - the account address of the lease owner
      deploymentSequence - The deployment sequence
      groupSequence - sequence which identifies deployment group
      orderSequence - sequence of the deployment order
      provider - identification of the provider where the lease was made
      Returns:
      Either OperationFailure or - if successful - DeploymentLease
    • listLeases

      public io.vavr.control.Either<OperationFailure,Iterable<DeploymentLease>> listLeases(@Nullable String owner, @Nullable String deploymentSequence, @Nullable String groupSequence, @Nullable String orderSequence, @Nullable String provider, @Nullable String state)
      Description copied from interface: Akash
      List all the leases for a given filter set
      Specified by:
      listLeases in interface Akash
      Parameters:
      owner - the account address of the lease owner
      deploymentSequence - the deployment sequence
      groupSequence - the group sequence
      orderSequence - the order sequence
      provider - identification of the provider where the lease was made
      state - state can be one of ( completed, active, open )
      Returns:
      Can be a DeploymentLease iterable, or a failure