.. default-domain:: chpl .. module:: ExternalIntegration ExternalIntegration =================== **Usage** .. code-block:: chapel use ExternalIntegration; or .. code-block:: chapel import ExternalIntegration; .. data:: const eiLogger = new Logger(logLevel, logChannel) .. data:: const CURLOPT_VERBOSE: CURLoption * libcurl C constants required to configure the Curl core * of HttpChannel objects. .. data:: const CURLOPT_USERNAME: CURLoption .. data:: const CURLOPT_PASSWORD: CURLoption .. data:: const CURLOPT_USE_SSL: CURLoption .. data:: const CURLOPT_SSLCERT: CURLoption .. data:: const CURLOPT_SSLKEY: CURLoption .. data:: const CURLOPT_KEYPASSWD: CURLoption .. data:: const CURLOPT_SSLCERTTYPE: CURLoption .. data:: const CURLOPT_CAPATH: CURLoption .. data:: const CURLOPT_CAINFO: CURLoption .. data:: const CURLOPT_URL: CURLoption .. data:: const CURLOPT_HTTPHEADER: CURLoption .. data:: const CURLOPT_POSTFIELDS: CURLoption .. data:: const CURLOPT_CUSTOMREQUEST: CURLoption .. data:: const CURLOPT_FAILONERROR: CURLoption .. data:: const CURLINFO_RESPONSE_CODE: CURLoption .. data:: const CURLOPT_SSL_VERIFYPEER: CURLoption .. enum:: enum SystemType { KUBERNETES, REDIS, CONSUL, NONE } * Enum specifies the type of external system Arkouda will integrate with. .. enumconstant:: enum constant KUBERNETES .. enumconstant:: enum constant REDIS .. enumconstant:: enum constant CONSUL .. enumconstant:: enum constant NONE .. enum:: enum ChannelType { STDOUT, FILE, HTTP } * Enum describing the type of channel used to write to an * external system. .. enumconstant:: enum constant STDOUT .. enumconstant:: enum constant FILE .. enumconstant:: enum constant HTTP .. enum:: enum ServiceEndpoint { ARKOUDA_CLIENT, METRICS } * Enum specifies if the service endpoint is the Arkouda client or metrics * socket .. enumconstant:: enum constant ARKOUDA_CLIENT .. enumconstant:: enum constant METRICS .. enum:: enum HttpRequestType { POST, PUT, PATCH, DELETE } * Enum specifies the request type used to write to an external system * via HTTP. .. enumconstant:: enum constant POST .. enumconstant:: enum constant PUT .. enumconstant:: enum constant PATCH .. enumconstant:: enum constant DELETE .. enum:: enum HttpRequestFormat { TEXT, JSON, MULTIPART } * Enum specifies the request format used to write to an external system * via HTTP. .. enumconstant:: enum constant TEXT .. enumconstant:: enum constant JSON .. enumconstant:: enum constant MULTIPART .. function:: proc getConnectHostIp() throws * Retrieves the host ip address of the locale 0 arkouda_server process, which is * useful for registering Arkouda with cloud environments such as Kubernetes. .. class:: Channel * Base class defining the Arkouda Channel interface consisting of a * write method that writes a payload to an external system. .. method:: proc write(payload: string) throws .. class:: FileChannel : Channel * The FileChannel class writes a payload out to a file, either by appending * or overwriting an existing file or creating and writing to a new file. .. attribute:: var path: string .. attribute:: var append: bool .. method:: proc init(path: string, append: bool) .. method:: override proc write(payload: string) throws .. class:: HttpChannel : Channel * The HttpChannel class writes a payload out to an HTTP endpoint * in a configurable format via a configurable request type. .. attribute:: var url: string .. attribute:: var requestType: HttpRequestType .. attribute:: var requestFormat: HttpRequestFormat .. method:: proc init(url: string, requestType: HttpRequestType, requestFormat: HttpRequestFormat) .. method:: proc configureChannel(channel) throws .. method:: proc generateHeader(channel) throws .. method:: override proc write(payload: string) throws * Writes the payload out to an HTTP/S endpoint in a format specified * by the requestFormat instance attribute via the request type * specified in the requestType instance attribute. .. class:: HttpsChannel : HttpChannel * The HttpChannel class writes a payload out to an HTTPS endpoint * in a configurable format via a configurable request type. .. attribute:: var caCert: string .. attribute:: var token: string .. method:: proc init(url: string, requestType: HttpRequestType, requestFormat: HttpRequestFormat, caCert: string, token: string) .. method:: override proc configureChannel(channel) throws * * Overridden proc adds token TLS configuration .. method:: override proc generateHeader(channel) throws * * Overridden proc adds TLS token to the HTTPS header .. function:: proc registerWithKubernetes(appName: string, serviceName: string, servicePort: int, targetServicePort: int) throws * Registers Arkouda with Kubernetes by creating a Kubernetes Service--and an Endpoints * if Arkouda is deployed outside of Kubernetes--to enable service discovery of Arkouda * from applications deployed within Kubernetes. .. function:: proc deregisterFromKubernetes(serviceName: string) throws * Removes the Kubernetes Service and, if applicable, Endpoints that compose the * service endpoint that enables access to Arkouda deployed within or outside of * Kubernetes from applications deployed within Kubernetes .. function:: proc getKubernetesRegistrationParameters(serviceEndpoint: ServiceEndpoint) throws .. function:: proc getKubernetesDeregisterParameters(serviceEndpoint: ServiceEndpoint) throws .. function:: proc registerWithExternalSystem(appName: string, endpoint: ServiceEndpoint) throws * Registers Arkouda with an external system on startup, defaulting to none. .. function:: proc deregisterFromExternalSystem(endpoint: ServiceEndpoint) throws * Deregisters Arkouda from an external system upon receipt of shutdown command