def __init__(self, namespace, name=None, spec=None, from_template=None):
self.core_api = get_core_api()<EOL>self.namespace = namespace<EOL>self.phase = None<EOL>if (from_template is not None) and (name is not None or spec is not None):<EOL><INDENT>raise ConuException('<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>elif from_template is not None:  <EOL><INDENT>try:<EOL><INDENT>pod_instance = self.core_api.create_namespaced_pod(namespace=namespace,<EOL>body=from_template)<EOL><DEDENT>except ApiException as e:<EOL><INDENT>raise ConuException(<EOL>"<STR_LIT>" % e)<EOL><DEDENT>logger.info(<EOL>"<STR_LIT>" % (pod_instance.metadata.name, namespace))<EOL>self.name = pod_instance.metadata.name<EOL>self.spec = pod_instance.spec<EOL><DEDENT>elif name is not None or spec is not None:<EOL><INDENT>self.name = name<EOL>self.spec = spec<EOL><DEDENT>else:<EOL><INDENT>raise ConuException('<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>
Utility functions for kubernetes pods.

:param namespace: str, namespace in which is pod created
:param name: name of pod
:param spec: pod spec
https://github.com/kubernetes-client/python/blob/master/kubernetes/docs/V1PodSpec.md
:param from_template: str, pod template, example:
       - https://kubernetes.io/docs/concepts/workloads/pods/pod-overview/#pod-templates