Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions spec-templates/apis/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Specification

1. Create a destination folder path [Or repository]
2. Create a folder called `apis`

3. For each `.yaml` file in `https://github.com/baas-devops-ecos/grandcentral-spec/tree/master/src/main/resources`

1. `${API_NAME}` is the name of the file without the extension
2. Create a folder `api/${API_NAME}`
3. Copy this file into `apis/${API_NAME}/specification.yml`
4. Create `apis/${API_NAME}/apiInformation.json` with the following values taken from the source spec file

```json
{
"properties": {
"apiRevision": "@info.semanticVersion",
"apiVersion": "@info.version",
"displayName": "@info.title",
"isCurrent": true,
"subscriptionRequired": true,
}
}
```
23 changes: 23 additions & 0 deletions spec-templates/backends/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Specification

1. Create a destination folder path [Or repository]
2. Create a folder called `backends`

3. For each service that constitutes a hostname (e.g. pod) that you will communicate with

1. `${BACKEND_NAME}` is the name of that service
2. `${BACKEND_URL}` is the hostname
3. Create a folder `backends/${BACKEND_NAME}`
4. Create `backends/${BACKEND_NAME}/backendInformation.json` with the following values taken from the service

```json
{
"properties": {
"protocol": "http",
"url": "${BACKEND_URL}"
}
}
```

## Notes
If we don't know the hostname until deployment time, then we can skip the url property (or have a placeholder) and use the configuration.dev.yaml to supply that value at deployment time.
32 changes: 32 additions & 0 deletions spec-templates/products/grandcentral/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Specification

1. Create a destination folder path [Or repository]
2. Create a folder called `products`
3. At the moment we are solving a single Product (but we could add multiple products later)
`${PRODUCT_NAME}`= "Grand Central"

4. Create a folder `products/${PRODUCT_NAME}`
5. Create `backends/${PRODUCT_NAME}/productInformation.json` with the following hardcoded values. Later we could pass in a variable and this could be the customer name

```json
{
"properties": {
"displayName": "Grand Central",
"state": "published",
"subscriptionRequired": true
}
}
```

6. Create a file called `backends/${PRODUCT_NAME}/apis.json`
7. We have to create an array of objects that match the name of each api that this product should have access to. I think this would be easier after we create all the APIs as then we can just iterate around all the folder names.

An example

```json
[
{
"name": "${API_NAME1}"
}
]
```
35 changes: 35 additions & 0 deletions spec-templates/products/grandcentral/policy.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!--
IMPORTANT:
- Policy elements can appear only within the <inbound>, <outbound>, <backend> section elements.
- To apply a policy to the incoming request (before it is forwarded to the backend service), place a corresponding policy element within the <inbound> section element.
- To apply a policy to the outgoing response (before it is sent back to the caller), place a corresponding policy element within the <outbound> section element.
- To add a policy, place the cursor at the desired insertion point and select a policy from the sidebar.
- To remove a policy, delete the corresponding policy statement from the policy document.
- Position the <base> element within a section element to inherit all policies from the corresponding section element in the enclosing scope.
- Remove the <base> element to prevent inheriting policies from the corresponding section element in the enclosing scope.
- Policies are applied in the order of their appearance, from the top down.
- Comments within policy elements are not supported and may disappear. Place your comments between policy elements or at a higher level scope.
-->
<policies>
<inbound>
<base />
<!-- <set-backend-service backend-id="k8s-cluster" /> -->
<choose>
<when condition="@(context.Api.Name == "API_NAME1")">
<set-backend-service backend-id="backendA" />
</when>
<when condition="@(context.Api.Name == "API_NAME1")">
<set-backend-service backend-id="backendB" />
</when>
</choose>
</inbound>
<backend>
<base />
</backend>
<outbound>
<base />
</outbound>
<on-error>
<base />
</on-error>
</policies>