Nesting groups with apiblueprint - apiblueprint

Hi I am trying to nest groups using api blueprint documentation does anyone know if there is a way that this is possible?
I tried
# group test
## group inner test
and had no success.

Unfortunately # Group foo only seems to work on the first level and there are no sub groups:
https://github.com/apiaryio/api-blueprint/blob/master/API%20Blueprint%20Specification.md#resource-group-section

Related

How do I use capture groups in Regular Expressions in Bot Composer

I am attempting to build a Microsoft Teams bot using the Bot Framework Composer. What I would like to do is create an integration with ServiceNow. The goal would be that if anyone posts a record number (ex. REQ0123456, INC0123456, KB0123456) into the group or direct chat (with the bot), the bot would look up that record and provide a card or a short summary of the record to the chat.
To avoid creating a completely separate intent for each record type, I was hoping to use RegEx to gather the match into 2 capture groups; one for the tbl_code and one for the number.
Here is the entry for the user input:
> add some example phrases to trigger this intent:
- look up {conversation.sn_record.tbl_code=REQ}{conversation.sn_record.number=0123456}
- lookup {conversation.sn_record.tbl_code=REQ}{conversation.sn_record.number=0123456}
- {conversation.sn_record.tbl_code=REQ}{conversation.sn_record.number=0123456}
- lu {conversation.sn_record.tbl_code=REQ}{conversation.sn_record.number=0123456}
> entity definitions:
# regex sn_record tbl_code, number = /([a-z]{2,4})([0-9]{7})/mi
The Issue I'm Having
I don't know how to get the values back from the individual capture groups. I would like to have them separate so that I can determine which table needs to be queried. I could probably just use the entire match and the search API in ServiceNow for the whole record string, but I would still like to know how to use capture group values.
I'm currently using turn.recognized.text, but I don't think this is the best method for what I'm looking to do. This returns the entire regex match.
I'm very new to this framework, so please be gentle. :) Let me know if there is more information I can provide.
Thanks all.
Best Regards,
Josh
I was able to figure this one out using the examples in the ToDosSample bot.
The answer was to use named capture groups and then add them to a dialog property to use in the corresponding dialog.
For reference here are the changes I had to make:
New Regex
(?<sn_record>(?<tbl_code>[a-z]{2,4})(?<numbers>[0-9]{7}))
New Dialog Properties
dialog.sn_record = #sn_record
dialog.sn_tbl_code = #tbl_code
dialog.sn_numbers = #numbers
New response
- Okay, looking up ${dialog.sn_tbl_code}${dialog.sn_numbers}

Ansible variables from script

Id like to populate ansible variables from a script that generated whenever a play is done. in particular, ive written something that uses an api somewhere to get users in a group on an application. Id like this to be run locally, and form the group vars for a play.
Script output:
users:
user1: jsmith
ssh_key: .......
user2: fsmith
ssh_key: .......
Is there a way to use dynamic variables? Something akin to dynamic inventory?
p.s. the first line of the output was '---' but I dont know how to get that to show here.
You can dynamically define variables within a play using set_fact: https://docs.ansible.com/ansible/2.5/modules/set_fact_module.html
Now for your use-case, imho, it would be better if your script returns a json result as it would be easier to parse using jinja filters

What is the CASE logic when building a MicroStrategy Dashboard?

I am in the process of building a live dashboard, however, I need to perform a few 'IF, THEN, ELSE' (CASE) functions... The current logic I've found is below.
ApplySimple(“Case when [Field Header Name]='CONDITION1’ then 'condition1 example' end”,String1)
What I've found online is a little misleading and wondering if anyone can assist.
Field Name is called 'Group'
There are certain 'Group' names that I want to put in a certain category using the CASE logic.
CASE
WHEN Group='CONDITION1'
THEN 'condition1 example'
END
Thank you so much
p
Try this
ApplySimple(“Case when #0='CONDITION1’ then 'condition1 example' end”,[Field Header Name])
See link below
http://community.microstrategy.com/t5/Architect/TN3905-How-to-use-pass-through-expression-ApplySimple-in/ta-p/165536

Select multiple rows objects using Selenium in ruby

I’m trying to write an automated scripts where I need to select multiple objects. Here is what I tried:
#browser.action.key_down(:left_shift).perform
post_elements[0].click
post_elements[2].click
#browser.action.key_up(:left_shift).perform
it doesn’t work for me. Please advise, thanks!
I think you want to structure your code like this:
#browser.action.key_down(:left_shift)
.click(post_elements[0])
.click(post_elements[2])
.key_up(:left_shift).perform

codeigniter ion_auth admin groups

Hi
is it possible to have more than one group as admin_group? being able to change users?
or, in alternative, how can i add one user to more than one group?
Thanks
The "admin" group is just another named group. There is nothing special about it other than it has a shortcut to check that role with...
$this->ion_auth->is_admin();
instead of just using...
$this->ion_auth->is_group('admin_group');
so really it all depends on how YOU treat the users.
so, to allow 2 groups admin access I'd just do this... Note is_group() can accept an array of strings also.
$admin_groups = array('admin_group1','admin_group2');
if ($this->ion_auth->is_group($admin_groups)) {
//do stuff
}

Resources