Skip to content

Commit cce408b

Browse files
committed
Add Or Update Networks
1 parent a90ddf8 commit cce408b

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

meilisearch/client.py

+22
Original file line numberDiff line numberDiff line change
@@ -756,6 +756,28 @@ def generate_tenant_token(
756756

757757
return jwt_token
758758

759+
def add_or_update_networks(self, body: Union[MutableMapping[str, Any], None]):
760+
"""Set all the Remote Networks
761+
762+
Parameters
763+
----------
764+
body:
765+
Remote networks that are allowed
766+
767+
Returns
768+
-------
769+
remote networks:
770+
Remote Networks containing information about the networks allowed/present.
771+
https://www.meilisearch.com/docs/reference/api/network
772+
773+
Raises
774+
------
775+
MeilisearchApiError
776+
An error containing details about why Meilisearch can't process your request. Meilisearch error codes are described here: https://www.meilisearch.com/docs/reference/errors/error_codes#meilisearch-errors
777+
"""
778+
response = self.http.patch(path=f"{self.config.paths.network}", body=body)
779+
return response
780+
759781
@staticmethod
760782
def _base64url_encode(data: bytes) -> str:
761783
return base64.urlsafe_b64encode(data).decode("utf-8").replace("=", "")

meilisearch/config.py

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ class Paths:
4545
proximity_precision = "proximity-precision"
4646
localized_attributes = "localized-attributes"
4747
edit = "edit"
48+
network = "network"
4849

4950
def __init__(
5051
self,

0 commit comments

Comments
 (0)