Create an RDS option group

    CLI example to create an RDS option group::

        salt myminion boto_rds.create_option_group my-opt-group mysql 5.6 \
                "group description"
439993
def create_option_group(name, engine_name, major_engine_version,
                        option_group_description, tags=None, region=None,
                        key=None, keyid=None, profile=None):
    '''
    
    '''
    res = __salt__['boto_rds.option_group_exists'](name, tags, region, key, keyid,
                                                   profile)
    if res.get('exists'):
        return {'exists': bool(res)}

    try:
        conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
        if not conn:
            return {'results': bool(conn)}

        taglist = _tag_doc(tags)
        rds = conn.create_option_group(OptionGroupName=name,
                                       EngineName=engine_name,
                                       MajorEngineVersion=major_engine_version,
                                       OptionGroupDescription=option_group_description,
                                       Tags=taglist)

        return {'exists': bool(rds)}
    except ClientError as e:
        return {'error': __utils__['boto3.get_error'](e)}
381082
def secgroup_create(name, description, profile=None, **kwargs):
    '''
    
    '''
    conn = _auth(profile, **kwargs)
    return conn.secgroup_create(name, description)
880487
function buildRDSSubnetGroup(numZones = 0, { name = 'RDSSubnetGroup' } = {}) {
  if (numZones < 1) {
    return {};
  }

  const subnetIds = [];
  for (let i = 1; i <= numZones; i += 1) {
    subnetIds.push({ Ref: `${DB_SUBNET}Subnet${i}` });
  }

  return {
    [name]: {
      Type: 'AWS::RDS::DBSubnetGroup',
      Properties: {
        DBSubnetGroupName: {
          Ref: 'AWS::StackName',
        },
        DBSubnetGroupDescription: {
          Ref: 'AWS::StackName',
        },
        SubnetIds: subnetIds,
      },
    },
  };
}
725957
def group(self, id=None, **kwargs):
        
        if type(id) == str:
            if not id.startswith('$'):
                id = '$' + id
        query = {
            '_id': id
        }
        for key in kwargs:
            query[key] = kwargs[key]
        self._q.append({
            '$group': query
        })
        return self
380688
def maybe_create_placement_group(name='', max_retries=10):
  """"""

  if not name:
    return

  client = get_ec2_client()
  while True:
    try:
      client.describe_placement_groups(GroupNames=[name])
      print("Reusing placement_group group: " + name)
      break  # no Exception means group name was found
    except Exception:
      print("Creating placement_group group: " + name)
      try:
        _response = client.create_placement_group(GroupName=name,
                                                  Strategy='cluster')
      except Exception:
        # because of race can get InvalidPlacementGroup.Duplicate
        pass

  counter = 0
  while True:
    try:
      res = client.describe_placement_groups(GroupNames=[name])
      res_entry = res['PlacementGroups'][0]
      if res_entry['State'] == 'available':
        assert res_entry['Strategy'] == 'cluster'
        break
    except Exception as e:
      print("Got exception: %s" % (e,))
    counter += 1
    if counter >= max_retries:
      assert False, f'Failed to create placement_group group {name} in {max_retries} attempts'
    time.sleep(RETRY_INTERVAL_SEC)
271501
def create_group(self, group):
        
        data = group.to_json()
        response = self._do_request('POST', '/v2/groups', data=data)
        return response.json()
842587
public function ormSchemaCreate($opt = ['dump-sql' => false])
    {
        $validOpts = ['dump-sql'];
        $command = new Command\SchemaTool\CreateCommand;

        $this->runDoctrineCommand($command, $opt, $validOpts);
    }
1081862
def create_group(self, **kwargs):
        
        response = self.__requester.request(
            'POST',
            'groups',
            _kwargs=combine_kwargs(**kwargs)
        )
        return Group(self.__requester, response.json())
1149698
def create_secgroup(self, name, description):
        
        return self.ec2.create_security_group(name, description)
        log.debug("... created group %s" % name)
289389
def create_group(groupname, gid, system=True):
    
    sudo(addgroup(groupname, gid, system))
446595
def _create_broker(self, broker_id, metadata=None):
        
        broker = Broker(broker_id, metadata)
        if not metadata:
            broker.mark_inactive()
        rg_id = self.extract_group(broker)
        group = self.rgs.setdefault(rg_id, ReplicationGroup(rg_id))
        group.add_broker(broker)
        broker.replication_group = group
        return broker
1079980
def createGroup(self, group, vendorSpecific=None):
        
        response = self.createGroupResponse(group, vendorSpecific)
        return self._read_boolean_response(response)
369805
def create(config, group, type):
        """"""
        if type not in ('user', 'service'):
            raise click.BadOptionUsage(  # pragma: no cover
                "--grouptype must be 'user' or 'service'")

        client = Client()
        client.prepare_connection()
        group_api = API(client)
        group_api.create(group, type)
387923
def create(**kwargs):
        
        secType = kwargs.get('secType', '')
        cls = {
            '': Contract,
            'STK': Stock,
            'OPT': Option,
            'FUT': Future,
            'CONTFUT': ContFuture,
            'CASH': Forex,
            'IND': Index,
            'CFD': CFD,
            'BOND': Bond,
            'CMDTY': Commodity,
            'FOP': FuturesOption,
            'FUND': MutualFund,
            'WAR': Warrant,
            'IOPT': Warrant,
            'BAG': Bag,
            'NEWS': Contract
        }.get(secType, Contract)
        if cls is not Contract:
            kwargs.pop('secType', '')
        return cls(**kwargs)
492176
def create_node_group(self):
        
        self.create_stack(
            self.node_group_name,
            'amazon-eks-nodegroup.yaml',
            capabilities=['CAPABILITY_IAM'],
            parameters=define_parameters(
                ClusterName=self.cluster_name,
                ClusterControlPlaneSecurityGroup=self.security_groups,
                Subnets=self.subnet_ids,
                VpcId=self.vpc_ids,
                KeyName=self.ssh_key_name,
                NodeAutoScalingGroupMaxSize="1",
                NodeVolumeSize="100",
                NodeImageId="ami-0a54c984b9f908c81",
                NodeGroupName=f"{self.name} OnDemand Nodes"
            )
        )
279232
def create_or_update_groups(self):
        

        for name in self.group_names:
            try:
                Group.objects.get(name=name)
            except ObjectDoesNotExist:
                Group.objects.create(name=name)
        Group.objects.exclude(name__in=self.group_names).delete()

        if self.verbose:
            names = [obj.name for obj in Group.objects.all().order_by("name")]
            sys.stdout.write(f"  Groups are: {', '.join(names)}\n")
882817
def _CreateAdGroup(client, campaign_id):
  
  ad_group_service = client.GetService('AdGroupService')

  operations = [{
      'operator': 'ADD',
      'operand': {
          'campaignId': campaign_id,
          'adGroupType': 'SEARCH_DYNAMIC_ADS',
          'name': 'Earth to Mars Cruises #%d' % uuid.uuid4(),
          'status': 'PAUSED',
          'biddingStrategyConfiguration': {
              'bids': [{
                  'xsi_type': 'CpcBid',
                  'bid': {
                      'microAmount': '3000000'
                  },
              }]
          }
      }
  }]

  ad_group = ad_group_service.mutate(operations)['value'][0]
  ad_group_id = ad_group['id']

  print 'Ad group with ID "%d" and name "%s" was created.' % (
      ad_group_id, ad_group['name'])

  return ad_group_id