Traffic Router¶
-
class
pinecone.router.
RouterMeta
(name: str, active_service: str, services: List[str], status: dict)¶ Metadata of a traffic router.
Create new instance of RouterMeta(name, active_service, services, status)
-
property
active_service
¶ Alias for field number 1
-
property
name
¶ Alias for field number 0
-
property
services
¶ Alias for field number 2
-
property
status
¶ Alias for field number 3
-
property
-
pinecone.router.
deploy
(router_name: str, services: List[str], active_service: str = None)¶ Creates a traffic router.
By default the first service will be set as active unless otherwise specified.
- Parameters
router_name (str) – name of the traffic router
services (List[str]) – the list of services that the traffic router can route traffic to. By default, the first service will be set as the active service.
active_service (str, optional) – defaults to None. if specified, the given service will be the active service for the traffic router.
-
pinecone.router.
describe
(router_name: str)¶ Returns the metadata of a router.
- Parameters
router_name – the name of the router
-
pinecone.router.
ls
()¶ Returns the names of all traffic routers.
-
pinecone.router.
stop
(router_name: str)¶ Stops a router.
- Parameters
router_name – the name of the router
-
pinecone.router.
update_active_service
(router_name: str, active_service: str)¶ Updates the active service of a router.
- Parameters
router_name (str) – name of the traffic router
active_service (str) – name of the active service. It has to be a service already in a traffic router.
-
pinecone.router.
update_services
(router_name: str, services: List[str])¶ Updates the list of services available in the traffic router.
- Parameters
router_name (str) – name of the traffic router
services (List[str]) – the list of services that the traffic router can route traffic to.