agent icon indicating copy to clipboard operation
agent copied to clipboard

add many endpoints

Open jacksnailgo opened this issue 3 years ago • 2 comments

we manage mutiple docker node by ETCD ,like docker swarms . how can i build many endPoints by portainer batch command?

jacksnailgo avatar Nov 01 '21 07:11 jacksnailgo

Please have a look at the documentation: https://docs.portainer.io/v/ce-2.9/admin/environments/add/api

And for more details on the API see: https://app.swaggerhub.com/apis/portainer/portainer-ce/2.9.2#/endpoints/EndpointCreate

Or use this example as a starting point:

curl --request POST --insecure --write-out "%{http_code}" \
  --url https://192.168.189.128:9443/api/endpoints \
  --header 'Authorization: Bearer eyJhbGc...pjIuAm8Yaj4qXfyY' \
  --header 'Content-Type: multipart/form-data; boundary=---011000010111000001101001' \
  --form Name=api-swarm \
  --form EndpointCreationType=2 \
  --form URL=tcp://192.168.189.128:9001 \
  --form GroupID=1 \
  --form PublicURL=192.168.189.128 \
  --form TLS=true \
  --form TLSSkipVerify=true \
  --form 'TagIds=[]' \
  --form TLSCACertFile=null \
  --form TLSCertFile=null \
  --form TLSKeyFile=null \
  --form TLSSkipClientVerify=true

huib-portainer avatar Nov 01 '21 22:11 huib-portainer

thx, i will try this example

jacksnailgo avatar Nov 03 '21 02:11 jacksnailgo