Services /
Get service ports
Lists the ports for the given service.
Required permission
Project > Services > General > Read
Path parameters
projectId
string requiredID of the projectserviceId
string requiredID of the service
Response body
- {object}Response object.
data
{object} requiredResult data.ports
[array] requiredAn array of ports of the service.- {object}
id
string requiredThe id used to identify the port across requests.pattern^[a-z]-?[a-z0-9]+(-[a-z0-9]+)*$name
string requiredThe name of the port used in the public url and UI.pattern^[a-zA-Z](-?[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*)?$internalPort
integer requiredThe port number.protocol
string requiredThe protocol used by the port.one ofHTTP, HTTP/2, TCP, UDPpublic
boolean requiredIf true, the port is exposed publicly.dns
stringDNS entry for this port.domains
[array] requiredAn array of domains that redirect to this port.- {object}
name
string requiredThe custom domain redirecting to this port.certificate
{object} requiredDetails about the TLS certificate generation for this domain.inProgress
booleanIs the certificate in the process of being generated?expiryDate
stringThe timestamp when the TLS certificate will expire.refreshDate
stringThe timestamp when a new TLS certificate will be generated.security
{object}Details about security settings for this port.credentials
[array]An array of credentials to access the service.- {object}
username
string requiredThe username to access the servicemin length3max length39pattern^[a-zA-Z](-?[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*)?$password
string requiredThe password to access the service with this username.type
string requiredThe type of authentication usedone ofbasic-authpolicies
[array]An array of IP address policies.- {object}
addresses
[array] requiredAn array of IP addresses used for this rule- stringAn IP address used by this rule
action
string requiredThe action for this rule.one ofALLOW, DENYsso
{object}Configure SSO access control for this port.organizationId
stringOrganization ID of the work OS organization that should be validated.directoryGroupIds
[array]List of directory groupIds, one of which the user has to be a member of.- string
validateInternalTraffic
booleanEnforce internal traffic through SSO authentication flowsetCookieOnRootDomain
booleanSet SSO authentication cookie on root domainallowInternalTrafficViaPublicDns
booleanAllow internal traffic from same or shared projects via public DNS to skip SSO authentication flowverificationMode
stringMode used to verify multiple security features like ip policies and SSO authenticationone ofor, andheaders
[array]List of header authentication settings, it checks the presence of all headers and compares it against the expected value. Wildcard (*) is supported.- {object}
regexMode
booleanname
(multiple options: oneOf)- string
- stringpattern^[a-zA-Z0-9_\-%$+]+$
value
string requireddisableNfDomain
booleanDisable routing on the default code.run domain for public HTTP ports with custom domains.
OR
API
CLI
JS Client
GET /v1/projects/{projectId}/services/{serviceId}/ports
Example response
200 OK
Details about the ports for the service.
JSON
{
"data": {
"ports": [
{
"id": "eonyui",
"name": "p01",
"internalPort": 8080,
"protocol": "HTTP",
"public": true,
"dns": "p01--example-service--default-service--user-abc1.salvo.code.run",
"domains": [
{
"name": "app.example.com",
"certificate": {
"inProgress": false,
"expiryDate": "2022-04-26T09:25:02.000Z",
"refreshDate": "2022-03-27T09:25:02.000Z"
}
}
],
"security": {
"credentials": [
{
"username": "admin",
"password": "password123",
"type": "basic-auth"
}
],
"policies": [
{
"addresses": [
"127.0.0.1"
],
"action": "DENY"
}
],
"sso": {
"organizationId": "org_uniquestringidentifier",
"directoryGroupIds": [
"directory_group_uniquestringidentifier"
]
}
},
"disableNfDomain": false
}
]
}
}