cloud-8.x-2.0-beta1/modules/cloud_service_providers/k8s/src/Service/K8sServiceInterface.php
modules/cloud_service_providers/k8s/src/Service/K8sServiceInterface.php
<?php
namespace Drupal\k8s\Service;
/**
* Interface K8sServiceInterface.
*/
interface K8sServiceInterface {
/**
* Set the cloud context.
*
* @param string $cloud_context
* Cloud context string.
*/
public function setCloudContext($cloud_context);
/**
* Get pods.
*
* @param array $params
* Parameters array to send to API.
*
* @return mixed
* An array of results or NULL if there is an error.
*/
public function getPods(array $params = []);
/**
* Update the Pods.
*
* Delete old Pod entities, query the api for updated entities and store
* them as Pod entities.
*
* @param array $params
* Optional parameters array.
* @param bool $clear
* TRUE to clear stale security groups.
*
* @return bool
* Indicates success so failure.
*/
public function updatePods(array $params = [], $clear = TRUE);
/**
* Update the Pods without batch.
*
* Delete old Pod entities, query the api for updated entities and store
* them as Pod entities.
*
* @param array $params
* Optional parameters array.
* @param bool $clear
* TRUE to clear stale security groups.
*
* @return bool
* Indicates success so failure.
*/
public function updatePodsWithoutBatch(array $params = [], $clear = TRUE);
/**
* Create k8s pod.
*
* @param string $namespace
* The namespace of the pod.
* @param array $params
* Parameters array to send to API.
*
* @return mixed
* An array of results or NULL if there is an error.
*/
public function createPod($namespace, array $params = []);
/**
* Update k8s pod.
*
* @param string $namespace
* The namespace of the pod.
* @param array $params
* Parameters array to send to API.
*
* @return mixed
* An array of results or NULL if there is an error.
*/
public function updatePod($namespace, array $params = []);
/**
* Delete k8s pod.
*
* @param string $namespace
* The namespace of the pod.
* @param array $params
* Parameters array to send to API.
*
* @return mixed
* An array of results or NULL if there is an error.
*/
public function deletePod($namespace, array $params = []);
/**
* Get k8s pod logs.
*
* @param string $namespace
* The namespace of the pod.
* @param array $params
* Parameters array to send to API.
*
* @return mixed
* An array of results or NULL if there is an error.
*/
public function getPodLogs($namespace, array $params = []);
/**
* Get k8s nodes.
*
* @param array $params
* Parameters array to send to API.
*
* @return mixed
* An array of results or NULL if there is an error.
*/
public function getNodes(array $params = []);
/**
* Get k8s namespaces.
*
* @param array $params
* Parameters array to send to API.
*
* @return mixed
* An array of results or NULL if there is an error.
*/
public function getNamespaces(array $params = []);
/**
* Create k8s namespace.
*
* @param array $params
* Parameters array to send to API.
*
* @return mixed
* An array of results or NULL if there is an error.
*/
public function createNamespace(array $params = []);
/**
* Update k8s namespace.
*
* @param array $params
* Parameters array to send to API.
*
* @return mixed
* An array of results or NULL if there is an error.
*/
public function updateNamespace(array $params = []);
/**
* Delete k8s namespace.
*
* @param array $params
* Parameters array to send to API.
*
* @return mixed
* An array of results or NULL if there is an error.
*/
public function deleteNamespace(array $params = []);
/**
* Get metrics pods.
*
* @param array $params
* Parameters array to send to API.
*
* @return mixed
* An array of results or NULL if there is an error.
*/
public function getMetricsPods(array $params = []);
/**
* Get metrics nodes.
*
* @param array $params
* Parameters array to send to API.
*
* @return mixed
* An array of results or NULL if there is an error.
*/
public function getMetricsNodes(array $params = []);
/**
* Update the Nodes.
*
* Delete old Node entities, query the api for updated entities and store
* them as Node entities.
*
* @param array $params
* Optional parameters array.
* @param bool $clear
* TRUE to clear stale security groups.
*
* @return bool
* Indicates success so failure.
*/
public function updateNodes(array $params = [], $clear = TRUE);
/**
* Update the Nodes without batch.
*
* Delete old Node entities, query the api for updated entities and store
* them as Node entities.
*
* @param array $params
* Optional parameters array.
* @param bool $clear
* TRUE to clear stale security groups.
*
* @return bool
* Indicates success so failure.
*/
public function updateNodesWithoutBatch(array $params = [], $clear = TRUE);
/**
* Update the Namespaces.
*
* Delete old Namespace entities, query the api for updated entities and store
* them as Namespace entities.
*
* @param array $params
* Optional parameters array.
* @param bool $clear
* TRUE to clear stale security groups.
*
* @return bool
* Indicates success so failure.
*/
public function updateNamespaces(array $params = [], $clear = TRUE);
/**
* Update the Namespaces without batch.
*
* Delete old Namespace entities, query the api for updated entities and store
* them as Namespace entities.
*
* @param array $params
* Optional parameters array.
* @param bool $clear
* TRUE to clear stale security groups.
*
* @return bool
* Indicates success so failure.
*/
public function updateNamespacesWithoutBatch(array $params = [], $clear = TRUE);
/**
* Get deployments.
*
* @param array $params
* Parameters array to send to API.
*
* @return mixed
* An array of results or NULL if there is an error.
*/
public function getDeployments(array $params = []);
/**
* Update the deployments.
*
* Delete old deployment entities, query the api for updated entities
* and store them as deployment entities.
*
* @param array $params
* Optional parameters array.
* @param bool $clear
* TRUE to clear stale security groups.
*
* @return bool
* Indicates success so failure.
*/
public function updateDeployments(array $params = [], $clear = TRUE);
/**
* Create k8s deployment.
*
* @param string $namespace
* The namespace of the deployment.
* @param array $params
* Parameters array to send to API.
*
* @return mixed
* An array of results or NULL if there is an error.
*/
public function createDeployment($namespace, array $params = []);
/**
* Update k8s deployment.
*
* @param string $namespace
* The namespace of the deployment.
* @param array $params
* Parameters array to send to API.
*
* @return mixed
* An array of results or NULL if there is an error.
*/
public function updateDeployment($namespace, array $params = []);
/**
* Delete k8s deployment.
*
* @param string $namespace
* The namespace of the deployment.
* @param array $params
* Parameters array to send to API.
*
* @return mixed
* An array of results or NULL if there is an error.
*/
public function deleteDeployment($namespace, array $params = []);
/**
* Get replica sets.
*
* @param array $params
* Parameters array to send to API.
*
* @return mixed
* An array of results or NULL if there is an error.
*/
public function getReplicaSets(array $params = []);
/**
* Create the replica sets.
*
* @param string $namespace
* The namespace of the replica set.
* @param array $params
* Parameters array to send to API.
*
* @return mixed
* An array of results or NULL if there is an error.
*/
public function createReplicaSet($namespace, array $params = []);
/**
* Update k8s replica set.
*
* @param string $namespace
* The namespace of the replica set.
* @param array $params
* Parameters array to send to API.
*
* @return mixed
* An array of results or NULL if there is an error.
*/
public function updateReplicaSet($namespace, array $params = []);
/**
* Delete k8s replica set.
*
* @param string $namespace
* The namespace of the replica set.
* @param array $params
* Parameters array to send to API.
*
* @return mixed
* An array of results or NULL if there is an error.
*/
public function deleteReplicaSet($namespace, array $params = []);
/**
* Update the network policies.
*
* Delete old network policy entities, query the api for updated entities
* and store them as network policy entities.
*
* @param array $params
* Optional parameters array.
* @param bool $clear
* TRUE to clear stale security groups.
*
* @return bool
* Indicates success so failure.
*/
public function updateNetworkPolicies(array $params = [], $clear = TRUE);
/**
* Get network policies.
*
* @param array $params
* Parameters array to send to API.
*
* @return mixed
* An array of results or NULL if there is an error.
*/
public function getNetworkPolicies(array $params = []);
/**
* Create k8s network policy.
*
* @param string $namespace
* The namespace of the network policy.
* @param array $params
* Parameters array to send to API.
*
* @return mixed
* An array of results or NULL if there is an error.
*/
public function createNetworkPolicy($namespace, array $params = []);
/**
* Update k8s network policy.
*
* @param string $namespace
* The namespace of the deployment.
* @param array $params
* Parameters array to send to API.
*
* @return mixed
* An array of results or NULL if there is an error.
*/
public function updateNetworkPolicy($namespace, array $params = []);
/**
* Delete k8s network policy.
*
* @param string $namespace
* The namespace of the deployment.
* @param array $params
* Parameters array to send to API.
*
* @return mixed
* An array of results or NULL if there is an error.
*/
public function deleteNetworkPolicy($namespace, array $params = []);
/**
* Helper method to load an entity using parameters.
*
* @param string $entity_type
* Entity Type.
* @param string $id_field
* Entity ID field.
* @param string $id_value
* Entity ID value.
* @param array $extra_conditions
* Extra conditions.
*
* @return int
* Entity ID.
*/
public function getEntityId($entity_type, $id_field, $id_value, array $extra_conditions = []);
}
