public override object GetDynamicParameters()
        {
            base.GetDynamicParameters();

            if (this.InputObject == null)
            {
                RuntimeDefinedParameter param = IBXDynamicParameters.ObjectType(new string[] { _GRID_BY_ATTRIBUTE, _SESSION_BY_ATTRIBUTE, _ENTERED_SESSION_BY_ATTRIBUTE }, true);
                base.ParameterDictionary.Add(param.Name, param);

                string ObjectType = this.GetUnboundValue <string>("ObjectType");

                if (!String.IsNullOrEmpty(ObjectType))
                {
                    if (Enum.TryParse <InfoBloxObjectsEnum>(ObjectType.ToUpper(), out base.ObjectType))
                    {
                        foreach (RuntimeDefinedParameter Param in IBXDynamicParameters.ObjectTypeProperties(base.ObjectType, new string[] { _GRID_BY_ATTRIBUTE, _SESSION_BY_ATTRIBUTE, _ENTERED_SESSION_BY_ATTRIBUTE }))
                        {
                            base.ParameterDictionary.Add(Param.Name, Param);
                        }
                    }
                }
            }

            return(base.ParameterDictionary);
        }
Exemple #2
0
        public override object GetDynamicParameters()
        {
            base.GetDynamicParameters();

            if (!this.MyInvocation.BoundParameters.ContainsKey("InputObject"))
            //if (this.InputObject == null)
            {
                RuntimeDefinedParameter param = IBXDynamicParameters.DhcpType(true);
                base.ParameterDictionary.Add(param.Name, param);

                string RecordType = this.GetUnboundValue <string>("DhcpType");

                if (!String.IsNullOrEmpty(RecordType))
                {
                    if (Enum.TryParse <InfoBloxObjectsEnum>(RecordType, out base.ObjectType))
                    {
                        foreach (RuntimeDefinedParameter Param in IBXDynamicParameters.ObjectTypeProperties(base.ObjectType, new string[] { _GRID_BY_ATTRIBUTE, _SESSION_BY_ATTRIBUTE, _ENTERED_SESSION_BY_ATTRIBUTE }))
                        {
                            base.ParameterDictionary.Add(Param.Name, Param);
                        }
                    }
                }
            }

            return(base.ParameterDictionary);
        }
Exemple #3
0
        public override object GetDynamicParameters()
        {
            base.GetDynamicParameters();

            if (this._DHCP)
            {
                RuntimeDefinedParameter SetHostName = IBXDynamicParameters.SetHostNameInDhcp();
                RuntimeDefinedParameter MAC         = IBXDynamicParameters.MAC(true);

                base.ParameterDictionary.Add(SetHostName.Name, SetHostName);
                base.ParameterDictionary.Add(MAC.Name, MAC);
            }
            else
            {
                if (this.InputObject == null && String.IsNullOrEmpty(this.HostName))
                {
                    RuntimeDefinedParameter MAC = IBXDynamicParameters.MAC();
                    base.ParameterDictionary.Add(MAC.Name, MAC);
                }
            }

            if (this._NextAvailable)
            {
                RuntimeDefinedParameter Network = IBXDynamicParameters.Network(true);
                base.ParameterDictionary.Add(Network.Name, Network);
            }

            return(base.ParameterDictionary);
        }
        public override object GetDynamicParameters()
        {
            base.GetDynamicParameters();

            if (this.InputObject == null)
            {
                RuntimeDefinedParameter param = IBXDynamicParameters.RecordType(true);
                base.ParameterDictionary.Add(param.Name, param);

                string RecordType = this.GetUnboundValue <string>("RecordType");

                if (!String.IsNullOrEmpty(RecordType))
                {
                    if (Enum.TryParse <InfoBloxObjectsEnum>(RecordType, out base.ObjectType))
                    {
                        if (this.NextAvailableIp)
                        {
                            IEnumerable <RuntimeDefinedParameter> Temp = IBXDynamicParameters.ObjectTypeProperties(base.ObjectType);
                            string[] fieldsToRemove = new string[] { "ipv4addr", "ipv6addr" };

                            foreach (RuntimeDefinedParameter Param in Temp.Except(Temp.Where(x => fieldsToRemove.Contains(x.Name))))
                            {
                                base.ParameterDictionary.Add(Param.Name, Param);
                            }
                        }
                        else
                        {
                            foreach (RuntimeDefinedParameter Param in IBXDynamicParameters.ObjectTypeProperties(base.ObjectType, new string[] { _GRID_BY_ATTRIBUTE, _SESSION_BY_ATTRIBUTE, _ENTERED_SESSION_BY_ATTRIBUTE }))
                            {
                                base.ParameterDictionary.Add(Param.Name, Param);
                            }
                        }
                    }
                }
            }

            return(base.ParameterDictionary);
        }
        public override object GetDynamicParameters()
        {
            base.GetDynamicParameters();

            if (this._DHCP)
            {
                RuntimeDefinedParameter dhcp = IBXDynamicParameters.SetHostNameInDhcp();
                RuntimeDefinedParameter mac  = IBXDynamicParameters.MAC(true);

                base.ParameterDictionary.Add(dhcp.Name, dhcp);
                base.ParameterDictionary.Add(mac.Name, mac);
            }
            else
            {
                if (this.IPs != null && this.IPs.Any())
                {
                    RuntimeDefinedParameter mac = IBXDynamicParameters.MAC();
                    base.ParameterDictionary.Add(mac.Name, mac);
                }
            }

            return(base.ParameterDictionary);
        }
        public override object GetDynamicParameters()
        {
            base.GetDynamicParameters();

            if (String.IsNullOrEmpty(this.Reference))
            {
                RuntimeDefinedParameter Parameter = IBXDynamicParameters.ObjectType(true);

                base.ParameterDictionary.Add(Parameter.Name, Parameter);

                string ObjectType = this.GetUnboundValue <string>("ObjectType");

                if (!String.IsNullOrEmpty(ObjectType))
                {
                    if (Enum.TryParse <InfoBloxObjectsEnum>(ObjectType, out base.ObjectType))
                    {
                        RuntimeDefinedParameter SearchFields = IBXDynamicParameters.SearchField(base.ObjectType, true);
                        base.ParameterDictionary.Add(SearchFields.Name, SearchFields);

                        RuntimeDefinedParameter FieldsToReturn = IBXDynamicParameters.FieldsToReturn(base.ObjectType, null, false);
                        base.ParameterDictionary.Add(FieldsToReturn.Name, FieldsToReturn);
                    }
                }

                string SearchField = this.GetUnboundValue <string>("SearchField");

                if (!String.IsNullOrEmpty(SearchField))
                {
                    //*** After the user has picked a search field, return the valid types of searches than can be performed

                    RuntimeDefinedParameter SearchType = IBXDynamicParameters.SearchType(base.ObjectType.GetObjectType(), SearchField, true);
                    base.ParameterDictionary.Add(SearchType.Name, SearchType);
                }
            }

            return(base.ParameterDictionary);
        }