Package io.skodjob.testframe.resources
Class ServiceResource
java.lang.Object
io.skodjob.testframe.resources.ServiceResource
- All Implemented Interfaces:
NamespacedResourceType<io.fabric8.kubernetes.api.model.Service>,ResourceType<io.fabric8.kubernetes.api.model.Service>
public class ServiceResource
extends Object
implements NamespacedResourceType<io.fabric8.kubernetes.api.model.Service>
Implementation of ResourceType for specific kubernetes resource
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcreate(io.fabric8.kubernetes.api.model.Service resource) Creates specificServiceresourcevoidcreateInNamespace(String namespaceName, io.fabric8.kubernetes.api.model.Service resource) Creates specificServiceresource in Namespace specified by uservoidDeletesServiceresource from Namespace in current contextvoiddeleteFromNamespace(String namespaceName, String resourceName) DeletesServiceresource from Namespace specified by userio.fabric8.kubernetes.client.dsl.MixedOperation<?,?, ?> Get specific client for resorucegetKind()Kind of api resourcevoidvoidreplaceInNamespace(String namespaceName, String resourceName, Consumer<io.fabric8.kubernetes.api.model.Service> editor) ReplacesServiceresource in Namespace specified by user, usingConsumerfrom which is the currentServiceresource updatedvoidupdate(io.fabric8.kubernetes.api.model.Service resource) Updates specificServiceresourcevoidupdateInNamespace(String namespaceName, io.fabric8.kubernetes.api.model.Service resource) Updates specificServiceresource in Namespace specified by userbooleanwaitForDeletion(io.fabric8.kubernetes.api.model.Service resource) Waits forServiceto be deletedbooleanwaitForReadiness(io.fabric8.kubernetes.api.model.Service resource) Waits forServiceto be ready (created/running)
-
Constructor Details
-
ServiceResource
public ServiceResource()Constructor
-
-
Method Details
-
getKind
Kind of api resource- Specified by:
getKindin interfaceResourceType<io.fabric8.kubernetes.api.model.Service>- Returns:
- kind name
-
create
public void create(io.fabric8.kubernetes.api.model.Service resource) Creates specificServiceresource- Specified by:
createin interfaceResourceType<io.fabric8.kubernetes.api.model.Service>- Parameters:
resource-Serviceresource
-
getClient
public io.fabric8.kubernetes.client.dsl.MixedOperation<?,?, getClient()?> Get specific client for resoruce- Specified by:
getClientin interfaceNamespacedResourceType<io.fabric8.kubernetes.api.model.Service>- Specified by:
getClientin interfaceResourceType<io.fabric8.kubernetes.api.model.Service>- Returns:
- specific client
-
update
public void update(io.fabric8.kubernetes.api.model.Service resource) Updates specificServiceresource- Specified by:
updatein interfaceResourceType<io.fabric8.kubernetes.api.model.Service>- Parameters:
resource-Serviceresource that will be updated
-
delete
DeletesServiceresource from Namespace in current context- Specified by:
deletein interfaceResourceType<io.fabric8.kubernetes.api.model.Service>- Parameters:
resourceName- name of theServicethat will be deleted
-
replace
- Specified by:
replacein interfaceResourceType<io.fabric8.kubernetes.api.model.Service>- Parameters:
resourceName- name of theServicethat will be replacededitor-Consumercontaining updates to the resource
-
waitForReadiness
public boolean waitForReadiness(io.fabric8.kubernetes.api.model.Service resource) Waits forServiceto be ready (created/running)- Specified by:
waitForReadinessin interfaceResourceType<io.fabric8.kubernetes.api.model.Service>- Parameters:
resource- resource- Returns:
- result of the readiness check
-
waitForDeletion
public boolean waitForDeletion(io.fabric8.kubernetes.api.model.Service resource) Waits forServiceto be deleted- Specified by:
waitForDeletionin interfaceResourceType<io.fabric8.kubernetes.api.model.Service>- Parameters:
resource- resource- Returns:
- result of the deletion
-
createInNamespace
public void createInNamespace(String namespaceName, io.fabric8.kubernetes.api.model.Service resource) Creates specificServiceresource in Namespace specified by user- Specified by:
createInNamespacein interfaceNamespacedResourceType<io.fabric8.kubernetes.api.model.Service>- Parameters:
namespaceName- Namespace, where the resource should be createdresource-Serviceresource
-
updateInNamespace
public void updateInNamespace(String namespaceName, io.fabric8.kubernetes.api.model.Service resource) Updates specificServiceresource in Namespace specified by user- Specified by:
updateInNamespacein interfaceNamespacedResourceType<io.fabric8.kubernetes.api.model.Service>- Parameters:
namespaceName- Namespace, where the resource should be updatedresource-Serviceupdated resource
-
deleteFromNamespace
DeletesServiceresource from Namespace specified by user- Specified by:
deleteFromNamespacein interfaceNamespacedResourceType<io.fabric8.kubernetes.api.model.Service>- Parameters:
namespaceName- Namespace, where the resource should be deletedresourceName- name of theServicethat will be deleted
-
replaceInNamespace
public void replaceInNamespace(String namespaceName, String resourceName, Consumer<io.fabric8.kubernetes.api.model.Service> editor) ReplacesServiceresource in Namespace specified by user, usingConsumerfrom which is the currentServiceresource updated- Specified by:
replaceInNamespacein interfaceNamespacedResourceType<io.fabric8.kubernetes.api.model.Service>- Parameters:
namespaceName- Namespace, where the resource should be replacedresourceName- name of theServicethat will be replacededitor-Consumercontaining updates to the resource
-