Configure Traefik from command line completely - traefik

I have a need to add configuration to backends and endpoints in a simple command line args. I see how you add entry points but I do not see how to add backends.
If any one has an example it would be much appreciated.
Thanks

Related

Q: Tibco BW Instance Specific variable in tra file

I am a Tibco Administrator and one of our developers is requesting for me to make a change to the tra file for a property called bw.platform.services.retreiveresources.Hostname. I see the property defined in at the par level but since it is a hostname they need it to be defined for each Process archive we have two server instances.
The reason I don't want to make the change in the tra file is because when we deploy; the changes get lost. We have many apps and it will be a nightmare to keep track of all these changes in the tra files every time we have a deployment.
Since I am not a develper and could you please tell me in simple terms how this can be done in Tibco without modifying the tra file. So I can pass along the info to the develpers.
Thank You
This property is used to set the hostname for WSDL client retrieval and defaults to "localhost" as far as i know.
It doesn't need to be set on TRA level but could also be set in TIBCO Administrator on the Process Archive Level.
As you mentioned there are 2 instances hosted for each services (i assume on 2 different hosts).
So by that i would assume there's a load balancer configured in front that (as i would consider a good practice) would rewrite the hostnames in the wsdl by a rule.
Depending on your configuration of the bw engine boxes i would leave it to 0.0.0.0 or localhost and let the load balancer rewrite the WSDL IP to clients to not directly expose it there.
Hope that helps
Seb
This is used to retrieve WSDL instead of retrieve process

Mappings between Docker Remote API and its command line client

Docker documentation is pretty good at describing what you can do from the command line.
It also gives a pretty comprehensive description of the commands associated with the remote API.
It does not, however, appear to give sufficient context for using the remote API to do things that one would do using the command line.
An example of what I am talking about: suppose you want to do a command like:
docker run --rm=true -i -t -v /home/user/resources:/files -p 8080:8080 --name SomeService myImage_v3
using the Remote API. There is a container "run" command in the Remote API:
POST /containers/(id or name)/start
And this command refers back to the create container command for the rather long list of JSON strings that you would need to add in order to do the actual start.
The problem here is: first, just calling this command doesn't work. Apparently there is more that you have to do (I am guessing you have to do a create, then a start). Second, it is unclear which JSON strings you need to use in order to do what I showed in the command line (like setting ports, mapping to the external directory, etc). Not only do the JSON strings provided in the remote API documentation not line up with the command line parameters (at least, not in any way that is obvious!), but it is unclear which JSON strings are required for the create (assuming that we have to do a create, which isn't established yet!) and which are required for the start.
This is just related to starting a container. Suppose you want to stop and destroy a container, as in:
docker stop SomeService
docker rm SomeService
Granted, there appear to be one- to- one commands for doing this in the remote API:
POST /containers/(id or name)/stop
POST /containers/(id or name)/kill
But it seems that the IDs you can pass them do not correspond to the IDs shown when you list containers or images.
Is there somewhere I can go to gather information on how to set up and use remote API commands that relates these commands and their JSON parameters to the commands and parameters in the command line?
Failing that, can someone please tell me how to do the start that I showed in my illustration using the remote API???
In any event: is there someone working on docker development I can bring these documentation issues to? It is, I believe, a big "hole" in their documentation.
Someone please advise...
docker run is a combination of docker create, followed by docker start, so https://docs.docker.com/engine/reference/api/docker_remote_api_v1.22/#create-a-container, followed by https://docs.docker.com/engine/reference/api/docker_remote_api_v1.22/#start-a-container
If you're running "interactively", you may need to attach to the container after that; https://docs.docker.com/engine/reference/api/docker_remote_api_v1.22/#attach-to-a-container

use other command instead of ssh for ansible

I have an ansible configuration which I know works on my local machines. However, I'm trying to now set it up on my company's machines which use a wrapper command similar to ssh (let's call it 'myssh')
for example, to access these machines, instead of writing
ssh myuser#123.123.123.123
you write
myssh myuser#123.123.123.123
which ends up calling ssh, among other things.
My question is, is there a way to swap which command ansible uses for accessing machines?
You can create a Connection Type Plugin to archive this. Looking at the ssh plugin, it appears like it might be as easy as replacing the ssh_cmd in line 333. Also specify myssh in line 69.
See here where to place the modified file. Additionally to that information, you can specify a custom location and let Ansible know about it in connection_plugins setting in ansible.cfg.
Finally again in your ansible.cfg set the transport setting to your new plugin:
transport = myssh
PS: I have never done anything like that before. This is only info from the docs.

How to figure out port information in mininet

I use python to create a custom mininet topology. To know the topology in detail is not important for the question.
I use ryu as controller. Especially I use the app "ofctl_rest.py". This controller does not install rules in the switch on its own. You have to issue rest - commands to establish rules. In every rest request (rule) you have to specify an outgoing port. To specify this port I need information about the topology of the network.
I need to know which link is connected to a port. I need to know which interface the port runs on. Also helpful would be to know the foreign interface, foreign switch/host, and foraign port of the actual port. How can I retrieve this information???
Please help me. I am really frustrated right now, because I do not know how to figure it out.
Inside the mininet CLI you can use the net command to find out about the topology. The nodes command will show you a list of nodes.
You can also use the dump command to display the interface details.
For information on the 'hosts', such as they are, you can run normal linux commands on each host, e.g.
mn> h1 ifconfig
will run ifconfig on host h1, showing you some of the network configuration for that host.
Given that you seem to be running mininet from a custom script, you could start the CLI at the end of your script (if that's possible) e.g.
net = Mininet(your_topo)
net.start()
CLI(net)
net.stop()
Otherwise, you can use the mininet python APIs to find much of the information.
the dump* functions in mininet.util will print out lots of information.
topo.links() will give you a list of the links in the topology.
topo.linkinfo() might give you some extra info.
For flow information you can either run ovs-dpctl, ovs-ofctl etc. outside of mininet (in a normal shell), or run the equivalents without the ovs- prefix inside the mininet CLI.

how to change OpenLDAP configuration ( slapd.conf ) programmatically

I need to make some configuration changes to slapd.conf. Changes are related to enabling SSL, enabling synch-replication etc.
For example, i need to add following block of configuration in slapd.conf to enable synch-replication over SSL :
TLSCACertificateFile /etc/openldap/cacerts/cacert.pem
TLSCertificateFile /etc/openldap/certs/servercrt.pem
TLSCertificateKeyFile /etc/openldap/certs/serverkey.pem
TLSVerifyClient never
Right now, I am trying to do this with shell script. Script will edit text in slapd.conf using sed, awk commands and some logic to place the text correctly in slapd.conf.
I don't think this is the best way to make configuration changes in slapd.conf.
Is there an API/commands for shell to do the same.
Please also suggest any java api for the same ?
I am using OpenLDAP.
Thanks in Advance.
If you used online configuration with the -F slapd.d option you could do it via an LDAP API.