Package cloud.quasarch.akash.impl
Class AkashClient
java.lang.Object
cloud.quasarch.akash.impl.AkashClient
- All Implemented Interfaces:
Akash
Implementation of
Akash.-
Constructor Summary
ConstructorsConstructorDescriptionAkashClient(String accountAddress) Uses QUASARCH_AKASH_BASE_URI env variable to get baseUri addressAkashClient(String accountAddress, URI baseUri, Supplier<HttpClient> httpClientSupplier) Constructor forAkashClient -
Method Summary
Modifier and TypeMethodDescriptionio.vavr.control.Either<OperationFailure,Deployment> closedDeployment(String leaseId) OPEN QUESTION: LEASE ID OR DEPLOYMENT_ID?io.vavr.control.Either<OperationFailure,Deployment> createDeployment(Path sdlFile) Create a deployment based on an SDL file.io.vavr.control.Either<OperationFailure,DeploymentLease> R_06 Provides lease creation capabilitiesio.vavr.control.Either<OperationFailure,Bid> getBid(String owner, String deploymentSequence, String groupSequence, String orderSequence, String providerId) io.vavr.control.Either<OperationFailure,Deployment> getDeployment(String owner, String deploymentSequence) Fetches deployment info for the given deployment id.io.vavr.control.Either<OperationFailure,DeploymentLease> getLease(String owner, String deploymentSequence, String groupSequence, String orderSequence, String provider) Get lease Get information regarding a lease such as its status.io.vavr.control.Either<OperationFailure,Iterable<Bid>> listBids(String owner, String deploymentSequence, String groupSequence, String oSeq, String providerId, String state) Get the list of bids based on a set of filters.io.vavr.control.Either<OperationFailure,Iterable<Deployment>> listDeployments(String owner, String state, String deploymentSequence) List all the deployment for given ( optional ) filters.io.vavr.control.Either<OperationFailure,Iterable<DeploymentLease>> listLeases(String owner, String deploymentSequence, String groupSequence, String orderSequence, String provider, String state) List all the leases for a given filter setio.vavr.control.Either<OperationFailure,?> sendManifest(Path sdlFile) TODO SPEC R_08 Provides a way for a manifest/SDL file to be send.io.vavr.control.Either<OperationFailure,?> updateManifest(Path sdlFile) TODO SPEC R_09 updates the descriptor of an already deployment
-
Constructor Details
-
AkashClient
Uses QUASARCH_AKASH_BASE_URI env variable to get baseUri address- Parameters:
accountAddress- address to be used when required.
-
AkashClient
Constructor forAkashClient- Parameters:
accountAddress- the address for the akt accountbaseUri- base uri for the apihttpClientSupplier- supplier ofHttpClient
-
-
Method Details
-
createDeployment
Description copied from interface:AkashCreate a deployment based on an SDL file. Request through RPC.- Specified by:
createDeploymentin interfaceAkash- Parameters:
sdlFile- Path to the template file * @return EitherOperationFailureor - if successful -Deployment- Returns:
- Either with
Deploymentor with 'left' failure containingOperationFailure
-
closedDeployment
Description copied from interface:AkashOPEN QUESTION: LEASE ID OR DEPLOYMENT_ID?Close a deployment.
- Specified by:
closedDeploymentin interfaceAkash- Parameters:
leaseId- The id of the lease which will be terminated * @return EitherOperationFailureor - if successful -Deployment- Returns:
- Either with
Deploymentor with 'left' failure containingOperationFailure
-
createLease
Description copied from interface:AkashR_06 Provides lease creation capabilities- Specified by:
createLeasein interfaceAkash- Returns:
- TBD
-
sendManifest
Description copied from interface:AkashTODO SPEC R_08 Provides a way for a manifest/SDL file to be send. Part of the deployment process- Specified by:
sendManifestin interfaceAkash- Parameters:
sdlFile- the path for the deployment file descriptor- Returns:
- TBD
-
updateManifest
Description copied from interface:AkashTODO SPEC R_09 updates the descriptor of an already deployment- Specified by:
updateManifestin interfaceAkash- 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:AkashList all the deployment for given ( optional ) filters. Clients should know that the returned iterable might need to fetch more data from upstream.- Specified by:
listDeploymentsin interfaceAkash- Parameters:
owner- The owner to filter forstate- Filter for deployments in state.deploymentSequence- Deployment sequence number. This is a filter, not required- Returns:
- Either
OperationFailureor - if successful -Iterable<Deployment>
-
getDeployment
public io.vavr.control.Either<OperationFailure,Deployment> getDeployment(String owner, String deploymentSequence) Description copied from interface:AkashFetches deployment info for the given deployment id.- Specified by:
getDeploymentin interfaceAkash- Parameters:
owner- ??deploymentSequence- ??- Returns:
- Either
DeploymentorOperationFailureon 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:AkashGet the list of bids based on a set of filters.- Specified by:
listBidsin interfaceAkash- Parameters:
owner- owner of the biddeploymentSequence- The deployment sequencegroupSequence- 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 providerstate- ??- Returns:
- Either
OperationFailureor - if successful - anIterable<Bid>
-
getBid
public io.vavr.control.Either<OperationFailure,Bid> getBid(String owner, String deploymentSequence, @Nullable String groupSequence, @Nullable String orderSequence, String providerId) - Specified by:
getBidin interfaceAkash- Parameters:
owner- mandatory, the account of the bid requesterdeploymentSequence- mandatory, the deployment sequencegroupSequence- group sequence, defaults to 1 if not providedorderSequence- order sequence, defaults to 1 if not providedproviderId- id of the provider where the bid was made- Returns:
- Either the
Bidobject or theOperationFailureon failure
-
getLease
public io.vavr.control.Either<OperationFailure,DeploymentLease> getLease(String owner, String deploymentSequence, String groupSequence, String orderSequence, String provider) Description copied from interface:AkashGet lease Get information regarding a lease such as its status.- Specified by:
getLeasein interfaceAkash- Parameters:
owner- the account address of the lease ownerdeploymentSequence- The deployment sequencegroupSequence- sequence which identifies deployment grouporderSequence- sequence of the deployment orderprovider- identification of the provider where the lease was made- Returns:
- Either
OperationFailureor - 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:AkashList all the leases for a given filter set- Specified by:
listLeasesin interfaceAkash- Parameters:
owner- the account address of the lease ownerdeploymentSequence- the deployment sequencegroupSequence- the group sequenceorderSequence- the order sequenceprovider- identification of the provider where the lease was madestate- state can be one of ( completed, active, open )- Returns:
- Can be a
DeploymentLeaseiterable, or a failure
-