Obtaining a Specified Ingress

Function

This API is used to read the specified Ingress.

URI

GET /apis/networking.k8s.io/v1beta1/namespaces/{namespace}/ingresses/{name} (Supports 1.15 and 1.15+)

GET /apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name} (Supports 1.15-)

Table 1 describes the parameters of this API.

Table 1 Parameter description

Parameter

Mandatory

Description

name

Yes

Name of the Ingress.

namespace

Yes

Object name and auth scope, such as for teams and projects.

exact

No

Should the export be exact. Exact export maintains cluster-specific fields like Namespace.

export

No

Should this value be exported. Export strips fields that a user cannot specify.

pretty

No

If 'true', then the output is pretty printed.

Request

N/A

Response

Response parameters:

For the description about response parameters, see Table 2.

Example response:

{
    "kind": "Ingress",
    "apiVersion": "extensions/v1beta1",
    "metadata": {
        "name": "ingress-test",
        "namespace": "default",
        "selfLink": "/apis/extensions/v1beta1/namespaces/default/ingresses/ingress-test",
        "uid": "29817662-7adb-11e8-a5f8-fa163e458c2a",
        "resourceVersion": "1494672",
        "generation": 1,
        "creationTimestamp": "2018-06-28T13:57:14Z",
        "labels": {
            "isExternal": "true",
            "zone": "data"
        },
        "annotations": {
            "ingress.beta.kubernetes.io/role": "data",
            "ingress.kubernetes.io/secure-backends": "false",
            "kubernetes.io/elb.id": "203e27c4-ceaa-4bca-b652-6947f77d1ce0",
            "kubernetes.io/elb.ip": "10.154.199.81",
            "kubernetes.io/elb.port": "80",
            "kubernetes.io/ingress.class": "public-elb",
            "protocol": "HTTP"
        }
    },
    "spec": {
        "rules": [
            {
                "host": "test",
                "http": {
                    "paths": [
                        {
                            "path": "/sssss",
                            "backend": {
                                "serviceName": "ingress-test",
                                "servicePort": 8086
                            },
                            "property": {
                                "ingress.beta.kubernetes.io/url-match-mode": "STARTS_WITH"
                            }
                        }
                    ]
                }
            }
        ]
    },
    "status": {
        "loadBalancer": {
            "ingress": [
                {
                    "ip": "10.154.199.81",
                    "hostname": "test"
                }
            ]
        }
    }
}

Status Code

Table 2 describes the status code of this API.

Table 2 Status code

Status Code

Description

200

success

For details about error status codes, see Status Code.