Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Groups cheatsheet #326

Merged
merged 1 commit into from
Nov 17, 2018
Merged
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
37 changes: 37 additions & 0 deletions docs/cheatsheet/web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,43 @@ <h4>Catching event</h4>
<pre data-type="socket"><code class="lang-yaml">event_handlers:
events.socket name.email_sent:
file: email-sent.js</code></pre>
<!--

==== Groups

-->
<h3>Groups</h3>
<p>Syncano groups</p>
<h4>Import</h4>
<pre><code class="lang-js">const {groups} = new Syncano(ctx)</code></pre>
<h4>Groups management</h4>
<pre><code class="lang-js">
// Create group
await groups.create(name, description)

//Delete group
await groups.delete(name)

//Groups list
await groups.list()

//Get group with users list
await groups.get(name)
</code></pre>
<h4>Users management in groups</h4>
<pre><code class="lang-js">
//Get group with users list
await groups.get(name)

//Get user groups
await groups.user(userId)

//Add user to group
await groups.addUser(name, userId)

//Remove user from group
await groups.removeUser(name, userId)
</code></pre>
</section>
<!--

Expand Down