Services /
Get service ports
Required permission
Project > Services > General > Read
Path parameters
projectId
string requiredID of the project
serviceId
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 service
min 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 used
one ofbasic-authpolicies
[array]An array of IP address policies.
- {object}
addresses
[array] requiredAn array of IP addresses used for this rule
- string
An IP address used by this rule
action
string requiredThe action for this rule.
one ofALLOW, DENYdisableNfDomain
booleanDisable routing on the default code.run domain for public HTTP ports with custom domains.
GET /v1/projects/{projectId}/services/{serviceId}/ports
Example response
200 OK
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"
}
]
},
"disableNfDomain": false
}
]
}
}