OVH Api specific task sequence - api

Is it possible somehow to know the sequence to perform a specific task?
For instance, domain registration.
API commands documented here: https://api.ovh.com/console/ but in order to do a specific task you need to know the sequence (create cart, availability check, create plan, etc)

There are no documentations about sequence at the moment. You have to find out by yourself. For example you need to checkout, try to execute that command and see what do you need in order to complete. Then you execute that command which should give you results and then see whats missing for that command. And by doing this, you can find the starting point.

As you say, there is no documentation about this API calls sequences to perform a given action.
But as OVH API is used by OVH Manager (the GUI where you can order & configure products), one way of knowing the sequence can be to make an order once via the OVH Manager, and thanks to the developer console of your browser, see which calls are made and then see the sequence.
This is definitively a boring solution, but that's the only one I know.

Related

Is there a libfaketime alternative for Golang?

I want to automate some tests where I have to manipulate the system time to check for authentication behaviours of a program that is written in golang. According to this post, libfaketime does not work with golang. Is there another way that I can achieve what I want to do with libfaketime?
Here's a description of what libfaketime does from github.
libfaketime intercepts various system calls that programs use to retrieve the
current date and time. It then reports modified (faked) dates and times (as
specified by you, the user) to these programs. This means you can modify the
system time a program sees without having to change the time system-wide.
No, there is none.
You need to use something like clockwork (see this for more) and explicitly pass "time" implementation around your code.
Update from 2021-03-01 with a more up-to-date list of options:
https://github.com/LopatkinEvgeniy/clock
https://github.com/jonboulle/clockwork
https://github.com/benbjohnson/clock
https://github.com/facebookgo/clock
https://github.com/tkuchiki/faketime
https://github.com/rzajac/clock
There is this repository (tkuchiki/faketime) which claims to be able to fake the time.Now()-function. I don't know how extensively this works and haven't tested it. But it sounds like it might be a solution to your problem.

goshippo create order via api

I'm trying to figure out a way to create orders via API (the ones that show up under https://app.goshippo.com/orders/), but seems like api docs dont really explain how to do so, and the only thing thats available is to create shipping labels. The libraries dont have any functions that will point me to this direction either. Is it even possible to make a call to the api for orders ?
Also, if this is not possible, how can I make goShippo send me a request for lets say a CSV, to sync all orders ?
PS: this is a custom build
Thanks
Feel free to use our order endpoint /v1/orders, but it is currently in beta version. The behavior of this endpoint may change (fields, error messages). We will update the following gist according to any modification that we make.
You can find more details about the endpoint at https://goshippo.com/docs/orders
The following Gist shows you how to POST on the Order endpoint.
https://gist.github.com/mnowik/59d2d550107b77cb31bf79b6b75d6e27
Fields with * are not active yet.

Bulk extract with Authenticated Connector (import.io)

I am new to import.io and this forum.
I am trying to extract information from a target database where I have to run a query with an input. With help of the support, I successfully created the authenticated connector. With multiple inputs that have to be manually entered in the UI, it fetches the data properly.
The problem is I have more than 10,000 inputs to run, so it has to be in a form of bulk extraction. import.io support told me that they do not have this feature within their UI and suggested to use their API posted in here: http://api.docs.import.io/#!/Query_Methods/queryPost.
Could anyone walk me through to make a use of this? I just need a working script that takes multiple string lines as inputs and run the connector that I built and post the result. I am not very familiar with this kind of technology but I am very willing to learn.
Thanks all in advance!
I would be happy to walk you through a bit of an into. It will be a bit basic though since I don't know your specific use case.
Yes, support was correct. You will need to use the POST query in order to pass your authentication credentials as inputs.
I will break down this query by steps. Essentially, our API docs are just a simple UI to pass through your credentials, then you can generate a query API.
ID - This is the GUID of your connector. This information can be found at the end of the URL, like this: https://import.io/data/mine/?tag=CONNECTOR&id=33f4e828-25ce-40c4-948c-9b734c70d1ab
Query - This is where you will put the inputs from your connector in order to execute. Be sure to keep this in structured JSON or it will bring back errors when you are querying.
Once you have successfully entered that information you will query the API.
This will give you the request URL that you need to query the API.
If you have anymore questions, just let me know.
Thanks,
Meg

Adding recipient Groups to a CiviCRM Mailing via REST.. how?

I have been able so far to create a new civi Mailing object and populate it, but confusingly I can't see a parameter in that to specify the mail destination group.
For context, I am dealing with Civi using pure REST api from a remote server. I have a solution to getting a custom template onto the server; the new problem is setting a schedule and delivery group, and initiating the send. I am using the python-civicrm library from github as the intermediary on the client.
I presume send happens as a result of setting the schedule -- i.e. I don't need an API call to say 'send mailing'? Is setting 'sheduled date' == 'now' safe or should I set a date of 'now + 1min' or similar?
So that leaves setting the delivery group. We already have groups defined in the DB, and I want to specify the group by name (and preferably be able to verify in advance that a group name is a valid destination, perhaps by doing a group name -> id lookup).
I think there might be a parameter to Mailing create 'groups' which can have keys 'include' and 'exclude'; at least, that's what the web form seems to do. However it's not mentioned in the REST api implementation.
Can anyone offer pointers?
I think you will find all you need in the following link :
Example of api call that is using the group include/exclude : https://gist.github.com/xurizaemon/6775471
Discussion about implementing mailing as an api - http://forum.civicrm.org/index.php?topic=24075.0
Otherwise, if it doesn't work, i suggest that you :
help adding this api in the CiviCRM Core - you could have some help on this on irc #civicrm (and have a look at https://issues.civicrm.org/jira/browse/CRM-11023)
OR create an extension with the api you need. It will be automatically available for REST. If you haven't created an extension yet, i suggest you go to the page http://wiki.civicrm.org/confluence/display/CRMDOC/Create+a+Module+Extension. It's quite straightforward with civix installed.
The table you need to check in the database is civicrm_mailing_group
To confirm, the problem was that (a) I needed to use groups[include]=array(ids) as mentioned by samuelsov, but also (b) I needed to use the json={...} form of request through REST, because the HTTP params syntax doesn't support nested data.

How does one list the changes via the API from a TeamCity build?

I'm trying to find a way to get all the comments from a particular build in TeamCity via the Rest API. How can one do that?
http://teamcity:port/httpAuth/app/rest/changes?locator=build:(id:77651)&fields=count,change:(version,username,date,href,comment,files)
Via this URL, one can list out in custom fashion exactly the fields they wish to return. I don't think this is documented, i got this from their support folks. Enjoy!
PS - There are other examples out there which iterate over each change, this lists out all the changes for a particular build id in one place, for parsing.