API Gateway with Nuctl#

In This Section#

You can create API Gateways using nuctl - the Nuclio CLI tool.

No authentication#

$ nuctl create apigateway <api-gateway-name> \
			--host <api-gateway-name>-<project-name>.<nuclio-host-name> \
			--path "/some/path" \
			--description "some-description" \
			--function some-function-name \
			--authentication-mode none \
			--namespace <namespace>

For invoking the function using the api gateway, see invoking API Gateways.

Basic authentication#

Basic authentication is a way to authenticate users by providing a username and password.

You can create an api gateway with basic authentication by running the following command:

$ nuctl create apigateway <api-gateway-name> \
			--host <api-gateway-name>-<project-name>.<nuclio-host-name> \
			--path "/some/path" \
			--description "some-description" \
			--function some-function-name \
			--authentication-mode basicAuth \
			--basic-auth-username <some-username> \
			--basic-auth-password <some-password> \
			--namespace <namespace>

Iguazio authentication#

Iguazio authentication allows authenticating users via the Iguazio Platform, when Nuclio is running as part of Iguazio. The authentication and login URLs are configured at the platform config and remain identical across all API gateways - they cannot be customized or overridden per instance. Both AuthURL and loginURL must be configured.

You can create an api gateway with Iguazio authentication by running the following command:

$ nuctl create apigateway <api-gateway-name> \
			--host <api-gateway-name>-<project-name>.<nuclio-host-name> \
			--path "/some/path" \
			--description "some-description" \
			--function some-function-name \
			--authentication-mode iguazio \
			--namespace <namespace> \

To invoke the function using the API gateway, see invoking API Gateways with basic authentication.

Delete API Gateway#

To delete an API Gateway with nuctl, run the following command:

$ nuctl --namespace <namespace> delete apigateway <api-gateway-name>