// CreateMulticastGroup creates the given multicast-group.
193379
func (n *NetworkServerAPI) CreateMulticastGroup(ctx context.Context, req *ns.CreateMulticastGroupRequest) (*ns.CreateMulticastGroupResponse, error) {
	if req.MulticastGroup == nil {
		return nil, grpc.Errorf(codes.InvalidArgument, "multicast_group must not be nil")
	}

	mg := storage.MulticastGroup{
		FCnt:           req.MulticastGroup.FCnt,
		DR:             int(req.MulticastGroup.Dr),
		Frequency:      int(req.MulticastGroup.Frequency),
		PingSlotPeriod: int(req.MulticastGroup.PingSlotPeriod),
	}

	switch req.MulticastGroup.GroupType {
	case ns.MulticastGroupType_CLASS_B:
		mg.GroupType = storage.MulticastGroupB
	case ns.MulticastGroupType_CLASS_C:
		mg.GroupType = storage.MulticastGroupC
	default:
		return nil, grpc.Errorf(codes.InvalidArgument, "invalid group_type")
	}

	copy(mg.ID[:], req.MulticastGroup.Id)
	copy(mg.MCAddr[:], req.MulticastGroup.McAddr)
	copy(mg.MCNwkSKey[:], req.MulticastGroup.McNwkSKey)
	copy(mg.ServiceProfileID[:], req.MulticastGroup.ServiceProfileId)
	copy(mg.RoutingProfileID[:], req.MulticastGroup.RoutingProfileId)

	if err := storage.CreateMulticastGroup(storage.DB(), &mg); err != nil {
		return nil, errToRPCError(err)
	}

	return &ns.CreateMulticastGroupResponse{
		Id: mg.ID.Bytes(),
	}, nil
}
352736
func (n *NetworkServerAPI) AddDeviceToMulticastGroup(ctx context.Context, req *ns.AddDeviceToMulticastGroupRequest) (*empty.Empty, error) {
	var devEUI lorawan.EUI64
	var mgID uuid.UUID
	copy(devEUI[:], req.DevEui)
	copy(mgID[:], req.MulticastGroupId)

	if err := storage.AddDeviceToMulticastGroup(storage.DB(), devEUI, mgID); err != nil {
		return nil, errToRPCError(err)
	}

	return &empty.Empty{}, nil
}
1304626
func (s *VMGroupService) CreateInstanceGroup(p *CreateInstanceGroupParams) (*CreateInstanceGroupResponse, error) {
	resp, err := s.cs.newRequest("createInstanceGroup", p.toURLValues())
	if err != nil {
		return nil, err
	}

	var r CreateInstanceGroupResponse
	if err := json.Unmarshal(resp, &r); err != nil {
		return nil, err
	}

	return &r, nil
}
401632
func (s *netCls) Creategroup(cgroupname string) error {

	//Create the directory structure
	_, err := os.Stat(basePath + procs)
	if os.IsNotExist(err) {
		if err = syscall.Mount("cgroup", basePath, "cgroup", 0, "net_cls,net_prio"); err != nil {
			return err
		}
	}

	cgroupPath := filepath.Join(basePath, s.TriremePath, cgroupname)
	if _, err = os.Stat(cgroupPath); err == nil {
		return nil
	}

	if err = os.MkdirAll(cgroupPath, 0700); err != nil {
		return err
	}

	// Write to the notify on release file and release agent files

	if s.ReleaseAgentPath != "" {
		err = ioutil.WriteFile(filepath.Join(basePath, releaseAgentConfFile), []byte(s.ReleaseAgentPath), 0644)
		if err != nil {
			return fmt.Errorf("unable to register a release agent error: %s", err)
		}

		err = ioutil.WriteFile(filepath.Join(basePath, notifyOnReleaseFile), []byte("1"), 0644)
		if err != nil {
			return fmt.Errorf("unable to write to the notify file: %s", err)
		}

		err = ioutil.WriteFile(filepath.Join(basePath, s.TriremePath, notifyOnReleaseFile), []byte("1"), 0644)
		if err != nil {
			return fmt.Errorf("unable to write to the notify file: %s", err)
		}

		err = ioutil.WriteFile(filepath.Join(basePath, s.TriremePath, cgroupname, notifyOnReleaseFile), []byte("1"), 0644)
		if err != nil {
			return fmt.Errorf("unable to write to the notify file: %s", err)
		}
	}

	return nil

}
278023
func (prod *AwsCloudwatchLogs) createGroup() error {
	params := &cloudwatchlogs.CreateLogGroupInput{
		LogGroupName: &prod.group,
	}
	_, err := prod.service.CreateLogGroup(params)
	if awsErr, ok := err.(awserr.Error); ok {
		if awsErr.Code() == "ResourceAlreadyExistsException" {
			return nil
		}
	}
	return err
}
251609
func (s *Set) AddGroup(group string) {
	if !s.All {
		if s.Groups == nil {
			s.Groups = make(groupSet, 1)
		}
		s.Groups[group] = struct{}{}
	}
}
464282
func (g *Cloud) CreateInstanceGroup(ig *compute.InstanceGroup, zone string) error {
	ctx, cancel := cloud.ContextWithCallTimeout()
	defer cancel()

	mc := newInstanceGroupMetricContext("create", zone)
	return mc.Observe(g.c.InstanceGroups().Insert(ctx, meta.ZonalKey(ig.Name, zone), ig))
}
95459
func (u Util) CreateGroup(g types.PasswdGroup) error {
	args := []string{"--root", u.DestDir}

	if g.Gid != nil {
		args = append(args, "--gid",
			strconv.FormatUint(uint64(*g.Gid), 10))
	}

	if g.PasswordHash != nil && *g.PasswordHash != "" {
		args = append(args, "--password", *g.PasswordHash)
	} else {
		args = append(args, "--password", "*")
	}

	if g.System != nil && *g.System {
		args = append(args, "--system")
	}

	args = append(args, g.Name)

	_, err := u.LogCmd(exec.Command(distro.GroupaddCmd(), args...),
		"adding group %q", g.Name)
	return err
}
197735
func (c *Client) CreateMultisig(requiredSigs int, addresses []btcutil.Address) (*btcjson.CreateMultiSigResult, error) {
	return c.CreateMultisigAsync(requiredSigs, addresses).Receive()
}
713582
func (gce *Cloud) CreateInstanceGroup(name string, zone string) (*compute.InstanceGroup, error) {
	op, err := gce.service.InstanceGroups.Insert(
		gce.projectID, zone, &compute.InstanceGroup{Name: name}).Do()
	if err != nil {
		return nil, err
	}
	if err = gce.waitForZoneOp(op, zone); err != nil {
		return nil, err
	}
	return gce.GetInstanceGroup(name, zone)
}
355023
func FlushMulticastQueueForMulticastGroup(db sqlx.Execer, multicastGroupID uuid.UUID) error {
	_, err := db.Exec(`
		delete from
			multicast_queue
		where
			multicast_group_id = $1
	`, multicastGroupID)
	if err != nil {
		return handlePSQLError(err, "delete error")
	}

	log.WithFields(log.Fields{
		"multicast_group_id": multicastGroupID,
	}).Info("multicast-group queue flushed")

	return nil
}
903350
func NewGroup() Group {
	return Group{
		EnableAutoType:  w.BoolWrapper(true),
		EnableSearching: w.BoolWrapper(true),
		Times:           NewTimeData(),
		UUID:            NewUUID(),
	}
}
78372
func (o *Me) CreateMultiCastChannelMap(child *MultiCastChannelMap) *bambou.Error {

	return bambou.CurrentSession().CreateChild(o, child)
}
1018744
func NewGroupMembersAddArg(Group *GroupSelector, Members []*MemberAccess) *GroupMembersAddArg {
	s := new(GroupMembersAddArg)
	s.Group = Group
	s.Members = Members
	s.ReturnMembers = true
	return s
}
903504
func (client *Client) CreateSecurityGroup(args *CreateSecurityGroupArgs) (securityGroupId string, err error) {
	response := CreateSecurityGroupResponse{}
	err = client.Invoke("CreateSecurityGroup", args, &response)
	if err != nil {
		return "", err
	}
	return response.SecurityGroupId, err
}
110597
func (n *NetworkServerAPI) FlushMulticastQueueForMulticastGroup(ctx context.Context, req *ns.FlushMulticastQueueForMulticastGroupRequest) (*empty.Empty, error) {
	var mgID uuid.UUID
	copy(mgID[:], req.MulticastGroupId)

	if err := storage.FlushMulticastQueueForMulticastGroup(storage.DB(), mgID); err != nil {
		return nil, errToRPCError(err)
	}

	return &empty.Empty{}, nil
}
421524
func (c *RESTClientset) CreateCluster(cluster *kops.Cluster) (*kops.Cluster, error) {
	namespace := restNamespaceForClusterName(cluster.Name)
	return c.KopsClient.Clusters(namespace).Create(cluster)
}