-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOriginal Script.txt
112 lines (97 loc) · 5.99 KB
/
Original Script.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
pipeline {
agent any
parameters {
string(name: 'Integration File', defaultValue: 'SAMPLE_LOOKUP_01.00.0000.iar', description: 'Path to the IAR file for deployment')
string(name: 'API URL', defaultValue: 'https://testinstance-idevjxz332qf-ia.integration.ocp.oraclecloud.com/ic/api/integration/v1/integrations/archive', description: 'URL of the instance for deploying the IAR file')
string(name: 'Connection Name', defaultValue: 'SAMPLE_REST', description: 'Name of the connection for configuration')
string(name: 'Connection file', defaultValue: 'restconnproperties.json', description: 'Path to the JSON file for configuring the connection')
string(name: 'Lookup Name', defaultValue: 'StateLookup', description: 'Name of the lookup to update')
string(name: 'Lookup file', defaultValue: 'lookupNew.json', description: 'Path to the JSON file for lookup update')
}
stages {
stage('Generate Token') {
steps {
bat '''
curl -s "https://idcs-b0bf5647dbe34af4914cf420cba0294c.identity.oraclecloud.com/oauth2/v1/token" \
--header "Authorization: Basic NmQxMGZmMDQ5OTU0NGE2NjllZWM3ZmE0NGM3NGEwNmY6NDJlNjg2MDYtMGY0NC00YTdiLWIxM2EtOTllMTlmYzI3ZTA2" \
--header "Content-Type: application/x-www-form-urlencoded" \
--data-urlencode "grant_type=client_credentials" \
--data-urlencode "scope=https://59D040337868449CB0014B649FE827EC.integration.ocp.oraclecloud.com:443urn:opc:resource:consumer::all" \
--data-urlencode "client_id=6d10ff0499544a669eec7fa44c74a06f" \
--data-urlencode 'client_secret=42e68606-0f44-4a7b-b13a-99e19fc27e06' --insecure -o token_OIC3.json
'''
}
}
stage('Deactivation of integration') {
steps {
bat '''
curl -X POST --header "Authorization: Basic ZGV2b3BzX3VzZXI6T2ljX0plbmtpbnMjMjAyMw==" --header "Content-Type:application/json" --header "X-HTTP-Method-Override:PATCH" -d @C:/Docs/Git/Sample_Config/Deactivation.json -d 'enableAsyncActivationMode=true' "https://testinstance-idevjxz332qf-ia.integration.ocp.oraclecloud.com/ic/api/integration/v1/integrations/SAMPLE_CHANDINI|01.00.0000"
'''
}
}
stage('Deployement of an Integration'){
steps{
bat'''
curl --location "https://testinstance-idevjxz332qf-ia.integration.ocp.oraclecloud.com/ic/api/integration/v1/integrations/archive" --header "Authorization: Basic cG9jdXNlcjpIVk9JQ01heSMyMDIz" --form "file=@"SAMPLE_CHANDINI_01.00.0000.iar"
'''
}
}
stage('Updating of IAR Files to OIC') {
steps {
bat '''
curl -X PUT --header "Authorization: Basic cG9jdXNlcjpIVk9JQ01heSMyMDIz" --header "Accept:application/json" --form file=@SAMPLE_CHANDINI_01.00.0000.iar --form type=application/octet-stream https://testinstance-idevjxz332qf-ia.integration.ocp.oraclecloud.com/ic/api/integration/v1/integrations/archive
'''
}
}
stage('Configuring a connection') {
steps {
bat'''
curl --header "Authorization: Basic ZGV2b3BzX3VzZXI6T2ljX0plbmtpbnMjMjAyMw==" --header "X-HTTP-Method-Override:PATCH" --header "Content-Type:application/json" -d @restconnproperties.json https://testinstance-idevjxz332qf-ia.integration.ocp.oraclecloud.com/ic/api/integration/v1/connections/SAMPLE_REST
'''
}
}
stage('Configuring an old lookup')
{
steps {
bat'''
curl --location --request PUT --header "Authorization: Basic ZGV2b3BzX3VzZXI6T2ljX0plbmtpbnMjMjAyMw==" --header "Content-Type:application/json" -d @lookupNew.json https://testinstance-idevjxz332qf-ia.integration.ocp.oraclecloud.com/ic/api/integration/v1/lookups/StateLookup
'''
}
}
stage('Update an old lookup')
{
steps {
bat'''
curl -X PUT --header "Authorization: Basic ZGV2b3BzX3VzZXI6T2ljX0plbmtpbnMjMjAyMw==" -F file=@C:/Docs/Git/Sample_Config/CountryLookup.csv -F type=application/octet-stream "https://testinstance-idevjxz332qf-ia.integration.ocp.oraclecloud.com/ic/api/integration/v1/lookups/archive"
'''
}
}
stage('Configuring a new lookup')
{
steps {
bat'''
curl --location --request PUT --header "Authorization: Basic ZGV2b3BzX3VzZXI6T2ljX0plbmtpbnMjMjAyMw==" --header "Content-Type:application/json" -d @C:/Docs/Git/Sample_Config/CountryLookup.csv https://testinstance-idevjxz332qf-ia.integration.ocp.oraclecloud.com/ic/api/integration/v1/lookups/CountryLookup
'''
}
}
stage('Activation of the integration')
{
steps {
bat'''
curl --header "Authorization: Basic ZGV2b3BzX3VzZXI6T2ljX0plbmtpbnMjMjAyMw==" --header "Content-Type:application/json" --header "X-HTTP-Method-Override:PATCH" -d @C:/Docs/Git/Sample_Config/Activation.json --location "https://testinstance-idevjxz332qf-ia.integration.ocp.oraclecloud.com/ic/api/integration/v1/integrations/SAMPLE_CHANDINI|01.00.0000"
'''
}
}
}
}
->1st depoloy a new integration
->configure an old integration
->If need to make any changes, 1st deactivate and then activate the integration
->Create a connection
->configure a connection
->create a lookup
->update a lookup
->Deactivate:
curl -X POST --header "Authorization: Basic ZGV2b3BzX3VzZXI6T2ljX0plbmtpbnMjMjAyMw==" --header "Content-Type:application/json" --header "X-HTTP-Method-Override:PATCH" -d @C:/Docs/Git/Sample_Config/Deactivation.json -d 'enableAsyncActivationMode=true' "https://testinstance-idevjxz332qf-ia.integration.ocp.oraclecloud.com/ic/api/integration/v1/integrations/SAMPLE_CHANDINI|01.00.0000"
->Activate:
curl --header "Authorization: Basic ZGV2b3BzX3VzZXI6T2ljX0plbmtpbnMjMjAyMw==" --header "Content-Type:application/json" --header "X-HTTP-Method-Override:PATCH" -d @C:/Docs/Git/Sample_Config/Activation.json --location "https://testinstance-idevjxz332qf-ia.integration.ocp.oraclecloud.com/ic/api/integration/v1/integrations/SAMPLE_CHANDINI|01.00.0000"