Skip to content

Commit

Permalink
Add import samples (#417)
Browse files Browse the repository at this point in the history
* add more samples

* more samples

* more samples

* more samples

* more samples

* sample

* fix

* fix

* fix

* fix

* fix table

* fix table

* fix

* fix

* fix

* fix

* fix

* fix samples for apps

* fix samples for apps

* apidocs

* rename file

* rename file
  • Loading branch information
ssvaidyanathan authored Feb 29, 2024
1 parent 4a3ecb1 commit 02eeb81
Show file tree
Hide file tree
Showing 18 changed files with 223 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ remote-service.*
#json files
*.json

!samples/*/*.zip
!samples/*.json
!samples/*/*.json
!test/*.json
!test/*.yaml
!test/*.zip
Expand Down
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,27 @@ x-google-jwt-locations:
query parameters are ignored. By default, if no location is specified, the JWT location is the `Authorization` header and value_prefix is `Bearer <token>`
## How do I import entities using apigeecli?
The table below illustrates how you can import different entities into Apigee. It refers to the [samples](./samples/) directory.
| Operations | Import command |
|---|---|
| apicategories | `apigeecli apicategories import -o $org -t $token -f samples/apicategories.json -s $siteId` |
| apis | `apigeecli apis import -f samples/apis -o $org -t $token` |
| appgroups | `apigeecli appgroups import -f samples/appgroups.json -o $org -t $token` |
| datacollectors | `apigeecli datacollectors import -f samples/datacollectors.json -o $org -t $token` |
| developers | `apigeecli developers import -f samples/developers.json -o $org -t $token` |
| kvms | `apigeecli kvms import -f samples/kvms -o $org -t $token` (Rename the files under samples/kvms to match your Apigee setup) |
| products | `apigeecli products import -f samples/apiproduct-legacy.json -o $org -t $token` `apigeecli products import -f samples/apiproduct-gqlgroup.json -o $org -t $token` `apigeecli products import -f samples/apiproduct-op-group.json -o $org -t $token` |
| sharedflows | `apigeecli sharedflows import -f samples/sharedflows -o $org -t $token` |
| targetservers | `apigeecli targetservers import -f samples/targetservers.json -o $org -t $token -e $env` |
| keystores | `apigeecli keystores import -f samples/keystores.json -o $org -t $token -e $env` |
| references | `apigeecli references import -f samples/references.json -o $org -t $token -e $env` |
| apps | `apigeecli apps import -f samples/references.json -d samples/developers.json -o $org -t $token` (better used when the developers and apps are exported using the export) |
| apidocs | `apigeecli apidocs import -f samples/apidocs -o $org -t $token -s $siteId` (Rename the files under samples/apidocs to match your Apigee setup for siteId) |
## How do I verify the binary?
All artifacts are signed by [cosign](https://github.com/sigstore/cosign). We recommend verifying any artifact before using them.
Expand Down
10 changes: 10 additions & 0 deletions samples/apicategories.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"data": [
{
"name": "foo"
},
{
"name": "bar"
}
]
}
11 changes: 11 additions & 0 deletions samples/apidocs/apidocs_siteId_123.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"data": {
"oasDocumentation": {
"spec": {
"displayName": "mocktarget.yaml",
"contents": "c3dhZ2dlcjogJzIuMCcKaW5mbzoKICBkZXNjcmlwdGlvbjogJ09wZW5BUEkgU3BlY2lmaWNhdGlvbiBmb3IgdGhlIEFwaWdlZSBtb2NrIHRhcmdldCBzZXJ2aWNlIGVuZHBvaW50LicKICB2ZXJzaW9uOiAxLjAuMAogIHRpdGxlOiBNb2NrIFRhcmdldCBBUEkKaG9zdDogbW9ja3RhcmdldC5hcGlnZWUubmV0CnNjaGVtZXM6CiAgLSBodHRwCiAgLSBodHRwcwpzZWN1cml0eURlZmluaXRpb25zOgogIGJhc2ljQXV0aDoKICAgIHR5cGU6IGJhc2ljCiAgICBkZXNjcmlwdGlvbjogSFRUUCBCYXNpYyBBdXRoZW50aWNhdGlvbi4KcGF0aHM6CiAgLzoKICAgIGdldDoKICAgICAgc3VtbWFyeTogVmlldyBwZXJzb25hbGl6ZWQgZ3JlZXRpbmcKICAgICAgb3BlcmF0aW9uSWQ6IFZpZXcgYSBwZXJzb25hbGl6ZWQgZ3JlZXRpbmcKICAgICAgZGVzY3JpcHRpb246IFZpZXcgYSBwZXJzb25hbGl6ZWQgZ3Jl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FtZXRlcnM6CiAgICAgICAgLSBuYW1lOiBjb2RlCiAgICAgICAgICBpbjogcGF0aAogICAgICAgICAgZGVzY3JpcHRpb246IEhUVFAgc3RhdHVzIGNvZGUuCiAgICAgICAgICByZXF1aXJlZDogdHJ1ZQogICAgICAgICAgdHlwZTogc3RyaW5nCiAgICAgIHJlc3BvbnNlczoKICAgICAgICAnMjAwJzoKICAgICAgICAgIGRlc2NyaXB0aW9uOiBTdWNjZXNzCiAgL2F1dGg6CiAgICBnZXQ6CiAgICAgIHNlY3VyaXR5OgogICAgICAtIGJhc2ljQXV0aDogW10KICAgICAgc3VtbWFyeTogVmFsaWRhdGUgYWNjZXNzIHVzaW5nIGJhc2ljIGF1dGhlbnRpY2F0aW9uCiAgICAgIG9wZXJhdGlvbklkOiBWYWxpZGF0ZSBhY2Nlc3MgdXNpbmcgYmFzaWMgYXV0aGVudGljYXRpb24KICAgICAgZGVzY3JpcHRpb246IFZhbGlkYXRlIGFjY2VzcyB1c2luZyBiYXNpYyBhdXRoZW50aWNhdGlvbi4KICAgICAgcHJvZHVjZXM6CiAgICAgICAgLSBhcHBsaWNhdGlvbi9qc29uCiAgICAgIHJlc3BvbnNlczoKICAgICAgICAnMjAwJzoKICAgICAgICAgIGRlc2NyaXB0aW9uOiBTdWNjZXNzCmRlZmluaXRpb25zOgogIHJlcXVlc3QtYm9keToKICAgIHByb3BlcnRpZXM6CiAgICAgIHJlcGxhY2UtbWU6CiAgICAgICAgdHlwZTogb2JqZWN0CiAgICAgICAgZGVzY3JpcHRpb246ICdSZXBsYWNlIHdpdGggcmVxdWVzdCBwYXlsb2FkIGluIGFwcGxpY2F0aW9uL2pzb24sIGFwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCwgb3IgYXBwbGljYXRpb24veG1sIGZvcm1hdC4nCg=="
},
"format": "YAML"
}
}
}
12 changes: 12 additions & 0 deletions samples/apidocs/site_siteId.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[
{
"id": "123",
"title": "MockProduct",
"description": "MockProduct",
"published": true,
"anonAllowed": true,
"apiProductName": "MockProduct",
"visibility": true,
"edgeAPIProductName": "MockProduct"
}
]
40 changes: 40 additions & 0 deletions samples/apiproduct-legacy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[
{
"name": "MockProduct",
"displayName": "MockProduct",
"description": "MockProduct",
"apiResources": [
"/**",
"/"
],
"approvalType": "auto",
"attributes": [
{
"name": "description",
"value": "Mock Product"
},
{
"name": "developer.quota.limit",
"value": "10000"
},
{
"name": "developer.quota.interval",
"value": "1"
},
{
"name": "developer.quota.timeunit",
"value": "month"
}
],
"environments": [
"dev"
],
"proxies": [
"mock"
],
"quota": "10000",
"quotaInterval": "1",
"quotaTimeUnit": "month",
"scopes": []
}
]
Binary file added samples/apis/sample.zip
Binary file not shown.
22 changes: 22 additions & 0 deletions samples/appgroups.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[
{
"name": "sampleAppGroup1",
"channelUri": "channel1",
"channelId": "1",
"displayName": "Sample App Group 1",
"status": "active",
"attributes": [
{
"name": "foo",
"value": "bar"
}
]
},
{
"name": "sampleAppGroup2",
"channelUri": "channel2",
"channelId": "2",
"displayName": "Sample App Group 2",
"status": "active"
}
]
31 changes: 31 additions & 0 deletions samples/apps.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[
{
"attributes": [
{
"name": "DisplayName",
"value": "SampleApp"
},
{
"name": "Foo",
"value": "Bar"
}
],
"credentials": [
{
"apiProducts": [
{
"apiproduct": "MockProduct",
"status": "approved"
}
],
"consumerKey": "blah",
"consumerSecret": "blah",
"expiresAt": "-1",
"status": "approved"
}
],
"developerId": "13a4ebde-79c6-4b33-848e-31a64f9d2145",
"name": "SampleApp",
"status": "approved"
}
]
9 changes: 9 additions & 0 deletions samples/datacollectors.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"dataCollectors": [
{
"name": "dc_sampleCollector",
"description": "Sample",
"type": "STRING"
}
]
}
6 changes: 6 additions & 0 deletions samples/debugmask.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"variables": [
"request.header.x-api-key",
"request.header.x-apikey"
]
}
12 changes: 12 additions & 0 deletions samples/developers.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"developer": [
{
"email": "[email protected]",
"firstName": "Sample",
"lastName": "Developer",
"userName": "sample",
"developerId": "13a4ebde-79c6-4b33-848e-31a64f9d2145",
"status": "active"
}
]
}
4 changes: 4 additions & 0 deletions samples/keystores.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[
"samplekeystore",
"testkeystore"
]
12 changes: 12 additions & 0 deletions samples/kvms/env_envname_mapname_kvmfile_0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"keyValueEntries": [
{
"name": "foo",
"value": "bar"
},
{
"name": "hello",
"value": "world"
}
]
}
12 changes: 12 additions & 0 deletions samples/kvms/proxy_proxyname_mapname_kvmfile_0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"keyValueEntries": [
{
"name": "foo",
"value": "bar"
},
{
"name": "hello",
"value": "world"
}
]
}
7 changes: 7 additions & 0 deletions samples/references.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[
{
"name": "reference",
"resourceType": "KeyStore",
"refers": "samplekeystore"
}
]
Binary file added samples/sharedflows/sample-sf.zip
Binary file not shown.
12 changes: 12 additions & 0 deletions samples/targetservers.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[
{
"name": "TS-Mock",
"host": "mocktarget.apigee.net",
"isEnabled": true,
"port": 443,
"sSLInfo": {
"enabled": true
},
"protocol": "HTTP"
}
]

0 comments on commit 02eeb81

Please sign in to comment.