Forum Discussion
integration with github is achieved via github rest api GitHub REST API - GitHub Docs
From design perspective this is how it works
Create a snaplogic pipeline that uses Meta Snaps - https://doc.snaplogic.com/wiki/display/SD/SnapLogic+Metadata+Snap+Pack get a list of SnapLogic assets (pipelines, tasks, files and accounts)
Invoke GitHub REST api (uses HTTP basic auth - https://doc.snaplogic.com/wiki/display/SD/Basic+Auth )
Read or Write to GitHub
Pipeline uses pipeline param to decouple runtime param from the actual implementation logic, so when you invoke these pipelines you can specify which Snaplogic projects to read, what assets to cin into GitHub, which repo to use on GitHub side and so on.
We have implemented bi-directional flow i.e. you can cin and cout source code from github
Attached SnapLogic project export has all the required files, please note that this is a custom solution, to use it you’ll need to keep your GitHub creds ready (repo name, uname and pwd), create a basic auth account in snaplogic and pass it on to the pipelines.
You may struggle a bit, but don’t give up, keep pounding and eventually you’ll crack it 🙂
Attached SnapLogic project export, please import it using these steps - https://doc.snaplogic.com/wiki/display/SD/How+to+Import+and+Export+Projects
Now for this
And that this can be further use to move code from one environment to another (code migration).
try this API
API Detail:
Syntax = https://elastic.snaplogic.com:443/api/1/rest/public/project/migrate/ORG/SPACE/PROJECT
Authorization Header = Basic Auth, pass on your Snaplogic uname/pwd
Body = application/json
Example:
https://elastic.snaplogic.com:443/api/1/rest/public/project/migrate/ConnectFasterInc/BK/DEV
{
"dest_path":"/tacobell/projects/bk",
"asset_types":["File","Job","Account","Pipeline"],
"async":"true",
"duplicate_check":"false"
}
Response:
{
“response_map”: {
“status_token”: “6e6600cd-2992-4423-95c3-ffb94293a3bd”,
“status_url”: “http://elastic.snaplogic.com/api/1/rest/public/project/migrate/6e6600cd-2992-4423-95c3-ffb94293a3bd”
},
“http_status_code”: 200
}
This runs as an async call and will migrate (copy) everything from ConnecFasterInc/BK/DEV to/tacobell/projects/bk, you can check status of the migration by visiting status_url
If a project already exists and duplicate_check set to false will create another project with the same name appended by (NUMBER) ex: if bk already exists inside /tacobell/projects then subsequent runs will add bk(1), bk(2) and so on, I wish we had an “overwrite” or “merge” parameter option but neverthless this is much easier than META snaps (IMO).
BK-Github Integration.zip (12.1 KB)
- lazo_ilijoski5 years agoNew Contributor III
Hi @Siva_Venna,
The snaps Oracle-Insert and Oracle-Select1 are not connected (connector is white, instead of blue), and that’s why the order of the execution of the snaps is not as expectd.
Regards,
Lazo- Siva_Venna5 years agoContributor
Hi @lazo.ilijoski
in my pipeline the snap left unconnected intentionally, prior to this pipeline I have designed another pipeline as you see below, in this also I have an unconnected snap but it is working as expected for me!
- lazo_ilijoski5 years agoNew Contributor III
Hi @Siva_Venna,
Probably order of execution of the unconnected snaps/streams depends on the order of creation of the starting snaps in the pipeline. Since, the order of the executions cannot be guaranteed and if you want to guarantee the order of executions, then I suggest all snaps to be connected by using copy/router or any other appropriate snap.
Regards,
Lazo- Siva_Venna5 years agoContributor
@lazo.ilijoski
Probably order of execution of the unconnected snaps/streams depends on the order of creation of the starting snaps in the pipeline - I think execution is not based on order of creation if so my pipeline would have executed as expected. Anyways it’s good to have snaps connected to avoid this kind of issues. will consider your suggestion.Thank you
All snaps in a pipeline are initialized in parallel. After initialization, each snap waits for input from its upstream snap. As data becomes available, the data is processed by the snap and written to the downstream snap. The control flow is driven by the availability of data to process. Snaps connected to each other will process a document in the same order as the order they are connected to each other in.
If there are multiple unconnected branches in the pipeline, each of them processes data in parallel. There is no synchronization between pipeline branches. Disconnecting two snaps which are next to each other functionally makes them unconnected branches.