This guides describes how to use the Service Gateway service from the console.
To create a service gateway, use the following steps:
{region}.sep-{12-digit hexadecimal} (e.g., kr1.sep-0a1b2c3d4e5f).Note
The service name you enter is validated upon creation, and you can connect to it only if it is included in the publisher's allowed projects.
Notice
The IP address you enter must be within the CIDR range of the selected subnet.
Note
This is enabled only for services that support selection.
You can check the created service gateway on the Network > Service Gateway page. If you select a service gateway, the service gateway information appears at the bottom. If the connection type is Custom Endpoint, you can check the display name and identifier of the endpoint under Connection Target in the details.
A service gateway can be modified as follows. You can only change the Name and Description.
To delete a service gateway, select the service gateway you want to delete in the Network > Service Gateway page and click the Delete Service Gateway button.
A custom endpoint is a feature that allows you to publish your own resources (load balancers) as endpoints, sharing them so that other projects can connect to them through a service gateway. The publisher receives a shared *service name (service_name), delivers it to the parties that are allowed to connect, and directly manages the list of allowed projects.
To create a custom endpoint, follow these steps:
{region}.sep-{12-digit hexadecimal}) is automatically issued. Provide this service name to the consumers that you want to allow connections from.Note
By default, you can create up to 5 custom endpoints per project.
You can view the list of endpoints that you have created on the Custom Endpoint tab. If you select an endpoint, the detailed information appears at the bottom, where you can view Basic Information (service name, resource type, target resource, maximum number of endpoints, and more), Allowed Projects, and Usage.
You can only change the Name, Display Name, Maximum Creation Count, and Description. The resource type and target resource cannot be changed.
Note
Even if you reduce the maximum creation count, service gateways that have already been created are retained. However, while the current count exceeds the maximum creation count, you cannot create additional service gateways.
On the Custom Endpoint tab, select the endpoint to delete and click the Delete button.
Caution
You cannot delete an endpoint if it is in use by any service gateway. Deleting an endpoint also deletes all registered allowed projects associated with it.
You can reissue a service name if it needs to be changed — for example, if the shared service name has been leaked to outside parties.
Caution
When reissued, the existing service name is immediately discarded and can no longer be found. Service gateways that were created using the existing service name will continue to work normally, but you must use the reissued service name to create new service gateways.
Note
Only a member (owner) of the project that created the endpoint can reissue a service name.
The allowed projects list manages the targets that are permitted to connect to this endpoint (by creating a service gateway).
Note
If both All Projects (*) and a specific project are registered together, the narrower scope (specific project) takes effect. You can use this to switch the allowed scope without any connection interruption. For example, if you add a specific project while All Projects (*) is active and then delete All Projects (*), the configuration switches to allow only the specific project without interrupting any existing connections.
For existing allowed targets, only the Description can be modified; the allowed scope and tenant ID cannot be changed. To delete an allowed target, select the target from the list and click Delete.
On the Usage Status tab of the endpoint details, you can check the list of service gateways currently connected to this endpoint. (Read-only)
For example, if the IP address of the created service gateway is 192.168.1.42, the service can be accessed in the following ways.
If you connect to the service gateway IP from the VM Instance, you can connect to the service selected when creating the service gateway and use the service.
/etc/hosts of the VM Instance.~# wget http://192.168.1.42/v1/AUTH_8222a22c22244badbf876dcd521f3f98/test-obs/test_file.txt
URLs are not supported when accessing the service using a service gateway. If you need URL access, you need to add the URL to the /etc/hosts file as in the example below.
Example: Downloading a file from object storage using a URL
Add the IP address of the service gateway and the URL of the object storage to the /etc/hosts file as shown below.
192.168.1.42 kr1-api-object-storage.nhncloudservice.com
Connect to the URL added to /etc/hosts instead of the IP address
~# wget https://kr1-api-object-storage.nhncloudservice.com/v1/AUTH_8222a22c22244badbf876dcd521f3f98/test-obs/test_file.txt
Content related to object storage are described only at the level required for explaining the example. For details on how to use object storage, refer to User Guide > Storage > Object Storage.
To use the Object Storage API, you must obtain an authentication token. To use object storage in a VPC in an isolated environment where internet is not available, you must obtain an authentication token also using the service gateway, and create the service gateway according to the following steps.
For example, if the IP address of the service gateway created by selecting Object Storage is 192.168.1.42 and 192.168.1.57 is assigned as the IP address of the service gateway created by selecting IaaS API Identity, add the IP addresses and URLs to the /etc/hosts file of the VM Instance, as shown below.
Tip
You can check the API URL address of object storage by clicking the Set API Endpoint button in Storage > Object Storage on the console screen.
Caution
Since the URL address of the Object Storage API used by each region is different, make sure that you check the URL in Set API Endpoint.
192.168.1.42 api-identity-infrastructure.nhncloudservice.com
192.168.1.57 kr1-api-object-storage.nhncloudservice.com
Set the API password for object storage and get an authentication token.
Tip
For details on how to use it, refer to User Guide > Storage > Object Storage > API Guide.
Request for obtaining the Authentication token
Make a request to obtain the token to the URL of the service gateway created for the IaaS API Identify service using the NHN Cloud login ID and the password of Set API Password set previously.
auth.passwordCredentials.usernameauth.passwordCredentials.password~# curl -X POST -H 'Content-Type:application/json' https://api-identity-infrastructure.nhncloudservice.com/v2.0/tokens -d '{"auth": {"tenantId": "2fda9d4b88244a0a92ff23841198e2e6", "passwordCredentials": {"username": "example@nhn.com", "password": "example123"}}}'
Response for obtaining the Authentication token
In the response below, the value of the access.token.id entry is the authentication token. The authentication token is valid until the time in access.token.expires.
{"access":{"token":{"id":"gAAAAABiVnmCOJVJhh1W2eXGo3aL0eaZxXmd-SMDMIE3zmip2lXy6eH0BlZAlTZBG20dWEm7TF4zi4YIOTKnc6yKh_wqZsyxgMWKkpVNShzE-k6GaSThBP54QeUePSjC2t-R10X6G4xL_Wecl-V-lV-bnOfVo6Ccpz6rv9eLYJnbJw7KrIMSSiY","expires":"2022-04-13T19:19:30Z","tenant":{"id":"2fda9d4b8821111192ff23841198e2e6","name":"tTMgSSSF","groupId":"XXj2zkH7777modGU","description":"","enabled":true,"project_domain":"NORMAL","swift":true},"issued_at":"2022-04-13T07:32:14.000441"},"serviceCatalog":[{"endpoints":[{"region":"KR1","publicURL":"https://api-identity.infrastructure.cloud.toast.com/v2.0"}],"type":"identity","name":"keystone"},{"endpoints":[{"region":"KR2","publicURL":"https://kr2-api-storage.cloud.toast.com/v1/AUTH_2fda9d4b88244a0a92ff23841198e2e6"},{"region":"KR1","publicURL":"https://api-storage.cloud.toast.com/v1/AUTH_2fda9d4b88244a0a92ff23841198e2e6"}],"type":"object-store","name":"swift"}],"user":{"id":"80884888887b45dbaf9b815117130671","username":"5111111c-b111-4b11-b11b-01111f81111f","name":"5211122c-bfc4-4115-b11b-05b52f84
When you have finished obtaining the authentication token, you can use the Object Storage API. Assuming that a container named example is created in the object storage and test_file.txt is uploaded to the container, you can query the file in the container by using the API as shown below.
Request
Request by adding the authentication token to X-Auth-Token
~# curl -X GET -H 'X-Auth-Token:gAAAAABiVnmCOJVJhh1W2eXGo3aL0eaZxXmd-SMDMIE3zmip2lXy6eH0BlZAlTZBG20dWEm7TF4zi4YIOTKnc6yKh_wqZsyxgMWKkpVNShzE-k6GaSThBP54QeUePSjC2t-R10X6G4xL_Wecl-V-lV-bnOfVo6Ccpz6rv9eLYJnbJw7KrIMSSiY' https://kr1-api-object-storage.nhncloudservice.com/v1/AUTH_2fda9d4b88244a0a92ff23841198e2e6/example
Response
Check the list of files in the object storage container
test_file.txt