Skip to content

Commit d66b9e3

Browse files
committed
Merge pull request #141 from Orange-OpenSource/fix/doc
Fix documentations:
2 parents 1fb9ba0 + 811d8fd commit d66b9e3

File tree

3 files changed

+45
-29
lines changed

3 files changed

+45
-29
lines changed

README.md

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,23 @@ We suppose that the autosleep service broker is already available in your market
2626

2727
### Basics
2828

29-
Create an autosleep service instance to get applications in the space automatically put to sleep after an inactivity period:
29+
Create an autosleep service instance to watch all applications in the space and automatically put them to sleep after default idle duration:
3030

3131
```
3232
cf cs autosleep default my-autosleep
3333
```
3434

35-
Autosleep **will periodically automatically bind every applications in the space** to this service instance (if you want to fine tune which apps gets auto-bound, please use the [excludeAppNameRegExp](#excludeappnameregexp) parameter to exclude some apps).
35+
Autosleep **will periodically automatically bind every applications in the space** to this service instance (if you want to fine tune which apps gets auto-bound, please use the [exclude-from-auto-enrollment](#exclude-from-auto-enrollment) parameter to exclude some apps).
3636

3737
Once bound, your application will be watched for inactivity, and automatically stopped by the autosleep service. If you wish to disable this watch, simply unbind your application from the autosleep service instance.
3838

3939
### Advanced configuration parameters
4040

4141
Optionally the autosleep service broker accepts the following parameters:
4242

43-
- [```inactivity```] (#inactivity)
44-
- [```excludeAppNameRegExp ```] (#excludeappnameregexp)
45-
- [```no_optout ```] (#lockno_optout)
43+
- [```idle-duration```] (#idle-duration)
44+
- [```exclude-from-auto-enrollment ```] (#exclude-from-auto-enrollment)
45+
- [```auto-enrollment ```] (#lockauto-enrollment)
4646
- [```secret ```] (#secret)
4747

4848
These parameters can be provided on service creations as well as on service updates, eg.
@@ -51,37 +51,38 @@ These parameters can be provided on service creations as well as on service upda
5151
cf cs autosleep default my-autosleep -c '{"inactivity": "PT1H15M"}'
5252
```
5353

54-
#### *inactivity*
54+
#### *idle-duration*
5555
Duration after which bound applications will be considered as inactive. The time format used is [the ISO8601] (https://en.wikipedia.org/wiki/ISO_8601#Durations) duration format.
5656

5757
- *Example:*```'{"inactivity": "PT1H15M"}'```
5858
would stop the application after *1 hour and 15 minutes* of inactivity.
5959
- *Default value :* 24H
6060

61-
#### *excludeAppNameRegExp*
61+
#### *exclude-from-auto-enrollment*
6262
If you don't want all the application to be automatically bound, you can set this parameter with a regular expression to filter on application names.
6363

6464
- *Example:*```'{"excludeAppNameRegExp": ".*"}'```
6565
wouldn't automatically bind any application in the space. Application would have to be bound manually.
6666
- *Default value :* none (every app in space will be bound).
6767

6868

69-
#### :lock:*no_optout*
69+
#### :lock:*auto-enrollment*
7070

71-
If platform teams (admins, org managers, or specific members of the space) don't want all space members to be able to manually unbound apps from the autosleep service themselves, then a no_optout mode is supported. When set:
72-
* manually unbound apps, will automatically be re-bound again after the activity period
71+
By default this parameter is set as ```standard```. If platform teams (admins, org managers, or specific members of the space) don't want all space members to be able to manually unbound apps from the autosleep service themselves, then a forced mode is supported. When set to this:
72+
73+
* manually unbound apps will automatically be re-bound again after the activity period
7374
* the autosleep service-instance won't be deletable by space members to disable auto-bindings
7475

75-
To enable to "no_optout" mode, set this parameter to ``true``. As this is a protected parameter, you will have also have to provide a ['secret' parameter] (#secret).
76+
To enable to "forced" mode, set the *auto-enrollment* parameter to ``forced``. As this is a protected parameter, you will have also have to provide a [```secret``` parameter] (#secret).
7677

77-
- *Example:*```'{"no_optout": "true"}'```
78-
- *Default value :* false
78+
- *Example:*```'{"auto-enrollment": "forced"}'```
79+
- *Default value :* ```standard```
7980

8081
#### *secret*
81-
Provide a secret if you wish to set/change a protected parameter. Please save it carefully, has you will be asked to provide the same secret the next time you set/change a protected parameter
82+
Provide a secret if you wish to set/change a protected parameter. Please save it carefully, has you will be asked to provide the same secret the next time you set/change a protected parameter. As a fallback, you may also use the credential password set at deployment time (see the ```security.user.password``` in [publish documentation] (doc/publish.md)).
8283

8384
- *Example:*```'{"secret": "Th1s1zg00dP@$$w0rd"}'```
84-
- *Default value :* none
85+
- *Default value :* ```null```
8586

8687

8788
# Usage by platform teams
@@ -90,7 +91,7 @@ Provide a secret if you wish to set/change a protected parameter. Please save it
9091
If you wish to build the app yourself, go to [build documentation] (doc/build.md).
9192

9293
## How to deploy and publish
93-
Once you built the application or if you got it from [latest release] (https://github.com/Orange-OpenSource/autosleep/releases/), go to [build documentation] (doc/publish.md).
94+
Once you built the application or if you got it from [latest release] (https://github.com/Orange-OpenSource/autosleep/releases/), go to [publish documentation] (doc/publish.md).
9495

9596
# How to test
9697
Acceptance tests are available in the source code, as robotframework tests. More information [here] (doc/test.md).

doc/publish.md

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@ Make a *manifest.yml* file according to the manifest.tmpl.yml template.
1010

1111
Autosleep service needs properties to work . The properties that are used are:
1212

13-
- __security.user.name__: the basic auth username for the service
14-
- __security.user.password__: the basic auth password for the service
15-
- __cf.client.target.endpoint__: the api endpoint of the cloudfoundry instance
13+
- __security.user.name__: the basic auth username for the service.
14+
- __security.user.password__: the basic auth password for the service.
15+
- __cf.client.target.endpoint__: the api endpoint of the cloudfoundry instance.
1616
- __cf.client.skip.ssl.validation__: set this property to _true_ if the current cloudfoundry instance use self-signed certificates.
17-
- __cf.client.username__: the username that will be used in by the autosleep service
18-
- __cf.client.password__: the password that will be used in by the autosleep service
19-
- __cf.client.clientId__: the client id of the application (optional)
20-
- __cf.client.clientSecret__: the client secret of the application (optional)
21-
- __cf.security.password.encodingSecret__: the secret used to hash password (optional). If none provided, it will use "".
22-
- __cf.service.broker.id__: the service broker id. If none provided, it will use "autosleep".
23-
- __cf.service.plan.id__: the service plan id. If none provided, it will use "default".
17+
- __cf.client.username__: the username that will be used in by the autosleep service.
18+
- __cf.client.password__: the password that will be used in by the autosleep service.
19+
- __cf.client.clientId__: the client id of the application (optional). If none provided, it will used ```"cf"```.
20+
- __cf.client.clientSecret__: the client secret of the application (optional). If none provided, it will used ```""```.
21+
- __cf.security.password.encodingSecret__: the secret used to hash password (optional). If none provided, it will use ```""```.
22+
- __cf.service.broker.id__: the service broker id. If none provided, it will use ```"autosleep"```.
23+
- __cf.service.plan.id__: the service plan id. If none provided, it will use ```"default"```.
2424

2525
There are two ways of providing these properties to autosleep.
2626

@@ -37,5 +37,20 @@ cf push -f manifest.yml -p org.cloudfoundry.autosleep.war
3737
Check that the autosleep application is running and retrieve its url (`cf app autosleep-app`).
3838

3939
Then run the following command:
40-
```cf create-service-broker autosleep LOGIN PASSWORD http://your-autsleep-route```
41-
where ___LOGIN___ and ___PASSWORD___ are the values you provided in the _manifest.yml_ file for environment properties ___security.user.name___ and ___security.user.password___
40+
41+
```cf create-service-broker <name> <login <password> <url>```
42+
43+
where:
44+
45+
- ```login``` and ```password``` are the values you provided in the _manifest.yml_ file for environment properties ___security.user.name___ and ___security.user.password___.
46+
- ```name``` the name of the service as it will appear in the marketplace.
47+
- ```url```: the URL of your servicde broker.
48+
49+
50+
## Publish as a private broker
51+
Currently cf does not support private service broker creation.But you may use ```cf curl``` command.
52+
With the same parameters as above:
53+
54+
```cf curl /v2/service_brokers -X POST -d '{"name":"<name>","broker_url":"<url>","auth_username":"<login>","auth_password":"<password>","space_guid":"<space_id>"}'```
55+
56+
where ```space_id``` is the space guid where the application is deployed.

doc/test.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ How to run the acceptance tests.
1111

1212
### What you need in your cloudfoundry environment
1313
- A test application (a [static website](https://github.com/cloudfoundry/staticfile-buildpack) for instance)
14-
- Autosleep registered as a service broker (see [how to publish on the market place](publish.md)).
14+
- Autosleep deployed as an application in a space where you are allowed to deploy private service brokers.
1515

1616
## Run the tests
1717
1. First copy `{ACCEPTANCE_TEST_DIRECTORY}/acceptance.tmpl.cfg` under `{ACCEPTANCE_TEST_DIRECTORY}/acceptance.cfg`

0 commit comments

Comments
 (0)