/// <summary> /// Retrieves a list of physical drive update objects /// </summary> /// <param name="page"> /// The requested page from the server. This is an optional argument /// and if omitted the server will default to returning the first page /// with a maximum of <c>100</c> items. /// </param> /// <param name="filter"> /// A filter object to filter the physical drive updates on the server. /// If omitted, the server will return all objects as a paginated /// response. /// </param> /// <param name="sort"> /// A sort definition object to sort the physical drive update objects /// on supported properties. If omitted objects are returned in the order /// as they were created in. /// </param> /// <returns></returns> public PhysicalDriveUpdatesList GetPhysicalDriveUpdates( PageInput page, PhysicalDriveUpdatesFilter filter, PhysicalDriveUpdatesSort sort) { // prepare parameters GraphQLParameters parameters = new GraphQLParameters(); parameters.Add("page", page, true); parameters.Add("filter", filter, true); parameters.Add("sort", sort, true); return(RunQuery <PhysicalDriveUpdatesList>( @"getPhysicalDriveUpdates", parameters )); }
/// <summary> /// Retrieves a list of snapshot schedule template objects /// </summary> /// <param name="page"> /// The requested page from the server. This is an optional argument /// and if omitted the server will default to returning the first page /// with a maximum of <c>100</c> items. /// </param> /// <param name="filter"> /// A filter object to filter the snapshot schedule template objects /// on the server. If omitted, the server will return all objects as a /// paginated response. /// </param> /// <param name="sort"> /// A sort definition object to sort the snapshot schedule template /// objects on supported properties. If omitted objects are returned in /// the order as they were created in. /// </param> /// <returns></returns> public SnapshotScheduleTemplateList GetSnapshotScheduleTemplates( PageInput page = null, SnapshotScheduleTemplateFilter filter = null, SnapshotScheduleTemplateSort sort = null) { // prepare parameters GraphQLParameters parameters = new GraphQLParameters(); parameters.Add("page", page, true); parameters.Add("filter", filter, true); parameters.Add("sort", sort, true); return(RunQuery <SnapshotScheduleTemplateList>( @"getSnapshotScheduleTemplates", parameters )); }
/// <summary> /// Retrieves a list of recipes /// /// <para> /// Recipes are the result of mutations of mutations or modifications of /// on-premises infrastructure. As commands may require some time to /// complete, the recipe filter allows the query for their status. /// </para> /// </summary> /// <param name="filter"> /// A filter object to filter the nPod recipes on the server. If /// omitted, the server will return all objects as a paginated response. /// </param> /// <returns> /// A paginated list of nPod recipes /// </returns> public RecipeRecordList GetNPodRecipes(NPodRecipeFilter filter) { // setup parameters GraphQLParameters parameters = new GraphQLParameters(); parameters.Add("filter", filter, false); return(RunQuery <RecipeRecordList>(@"getNPodRecipes", parameters)); }
/// <summary> /// Allows deletion of a user group /// </summary> /// <param name="guid"> /// The unique identifier of the user group that should be deleted /// </param> /// <returns>If the query was successful</returns> public bool DeleteNebUserGroup(Guid guid) { // setup parameters GraphQLParameters parameters = new GraphQLParameters(); parameters.Add(@"uuid", guid, false); return(RunMutation <bool>(@"deleteOrgUserGroup", parameters)); }
/// <summary> /// Create a new nPod template /// </summary> /// <param name="input"> /// An input object that describes the new nPod template /// </param> /// <returns>The created nPod template</returns> public NPodTemplate CreateNPodTemplate(CreateNPodTemplateInput input) { // setup parameters GraphQLParameters parameters = new GraphQLParameters(); parameters.Add("input", input, true); return(RunMutation <NPodTemplate>(@"createNPodTemplate", parameters)); }
/// <summary> /// Allows deletion of an existing rack object /// /// <para> /// The deletion of a rack is only possible if the rack has no hosts /// (servers) associated. /// </para> /// </summary> /// <param name="rackGuid"> /// The unique identifier of the datacenter room to delete /// </param> /// <returns></returns> public bool DeleteRack(Guid rackGuid) { // setup parameters GraphQLParameters parameters = new GraphQLParameters(); parameters.Add("uuid", rackGuid, false); return(RunMutation <bool>(@"deleteRack", parameters)); }
/// <summary> /// Allows deletion of an RBAC policy object /// </summary> /// <param name="guid"> /// The unique identifier of the RBAC policy to delete /// </param> /// <returns>If the query was successful</returns> public bool DeleteRbacPolicy(Guid guid) { // setup parameters GraphQLParameters parameters = new GraphQLParameters(); parameters.Add("uuid", guid, false); return(RunMutation <bool>(@"deleteRBACPolicy", parameters)); }
/// <summary> /// Get the number of users that match the specified filter /// </summary> /// <param name="filter"> /// A filter object to filter the user objects on the server. If /// omitted, the server will count all objects. /// </param> /// <returns></returns> public long GetUserCount(UserFilter filter = null) { // setup parameters GraphQLParameters parameters = new GraphQLParameters(); parameters.Add("filter", filter, true); return(RunQuery <long>(@"getUsersCount", parameters)); }
/// <summary> /// Allows creation of a new support case /// </summary> /// <param name="supportCase"> /// A support case input object /// </param> /// <returns>The created support case</returns> public SupportCase CreateSupportCase(CreateSupportCaseInput supportCase) { // setup parameters GraphQLParameters parameters = new GraphQLParameters(); parameters.Add("input", supportCase, true); return(RunMutation <SupportCase>(@"createSupportCase", parameters)); }
/// <summary> /// Allows deletion of an existing datacenter room object /// /// <para> /// The deletion of a datacenter room is only possible if the room /// has no hosts (servers) associated with any child items. By default, /// deletion of a datacenter room is only allowed when it is not /// referenced by any rows or if the <c>cascade</c> parameter is set /// to <c>true</c>. /// </para> /// </summary> /// <param name="roomGuid"> /// The unique identifier of the datacenter room to delete /// </param> /// <param name="cascade"> /// If set to True any child items of the datacenter room /// (row, rack) will automatically deleted with this request. If set /// to False or omitted and the datacenter room has child objects, the /// deletion will fail with an error. /// </param> public void DeleteRoom( Guid roomGuid, bool cascade = false) { // setup delete input DeleteRoomInput input = new DeleteRoomInput { Cascade = cascade }; // setup parameters GraphQLParameters parameters = new GraphQLParameters(); parameters.Add("uuid", roomGuid, false); parameters.Add("input", input, false); RunMutation <Room>(@"deleteLab", parameters); }
/// <summary> /// Retrieves a list of key value objects /// </summary> /// <param name="filter"> /// A filter object to filter key value objects on the /// server.If omitted, the server will return all objects as a /// paginated response. /// </param> /// <returns>A list of key value objects</returns> public KeyValueList GetKeyValues(KeyValueFilter filter) { // setup parameters GraphQLParameters parameters = new GraphQLParameters(); parameters.Add("filter", filter); return(RunQuery <KeyValueList>(@"getKeyValues", parameters)); }
/// <summary> /// Retrieves the number of nPod groups matching the filter /// </summary> /// <param name="filter"> /// A filter object to filter the items on the server. If omitted, all /// items are counted on the server /// </param> /// <returns>The number of nPod groups matching the filter</returns> public long GetNPodGroupCount(NPodGroupFilter filter = null) { // setup query parameters GraphQLParameters parameters = new GraphQLParameters(); parameters.Add("filter", filter); return(RunQuery <long>("getNPodGroupCount", parameters)); }
/// <summary> /// Delete an existing nPod template tree /// /// <para> /// This deletes an nPod template and all associated versions will /// become unavailable for nPod provisioning if the <c>ParentGuid</c> /// is supplied, otherwise the specific version is deleted. /// </para> /// </summary> /// <param name="nPodTemplateGuid"> /// The unique identifier of the nPod template tree. The <c>ParentGuid</c> /// property of the nPod template should be used for deletion. /// </param> /// <returns></returns> public bool DeleteNPodTemplate(Guid nPodTemplateGuid) { // setup parameters GraphQLParameters parameters = new GraphQLParameters(); parameters.Add("parentUUID", nPodTemplateGuid, true); // run mutation return(RunMutation <bool>(@"deleteNPodTemplate", parameters)); }
/// <summary> /// Allows updating new nPod group object properties /// /// <para> /// Allows updating of an existing nPod group object in nebulon ON. A /// nPod group allows logical grouping of nPods into security domains. /// Each nPod group can receive custom security policies. /// </para> /// </summary> /// <param name="nPodGroupGuid"> /// The unique identifier of the nPod group to update /// </param> /// <param name="name"> /// The new name of the nPod group /// </param> /// <param name="note"> /// The new note for the nPod group. For removing the note, provide an /// empty string. /// </param> /// <returns>The updated nPod group</returns> public NPodGroup UpdateNPodGroup( Guid nPodGroupGuid, string name = null, string note = null) { // setup input object UpdateNPodGroupInput input = new UpdateNPodGroupInput(); input.Name = name; input.Note = note; // setup query parameters GraphQLParameters parameters = new GraphQLParameters(); parameters.Add("uuid", nPodGroupGuid); parameters.Add("input", input); return(RunMutation <NPodGroup>("updateNPodGroup", parameters)); }
/// <summary> /// Allow updating properties of an existing user group /// </summary> /// <param name="guid"> /// The unique identifier of the user group to update /// </param> /// <param name="name"> /// New name for the user group /// </param> /// <param name="policyGuids"> /// List of RBAC policies that shall be assigned to the user group /// </param> /// <param name="note"> /// An optional note for the user /// </param> /// <returns></returns> public UserGroup UpdateUserGroup( Guid guid, string name = null, Guid[] policyGuids = null, string note = null) { UpdateUserGroupInput input = new UpdateUserGroupInput(); input.Name = name; input.PolicyGuids = policyGuids; input.Note = note; // setup parameters GraphQLParameters parameters = new GraphQLParameters(); parameters.Add("uuid", guid, false); parameters.Add("input", input, false); return(RunMutation <UserGroup>(@"updateOrgUserGroup", parameters)); }
/// <summary> /// Allows setting the timezone for all SPUs in an nPod /// </summary> /// <param name="nPodGuid"> /// The unique identifier of the nPod that is being modified /// </param> /// <param name="timezone"> /// The target timezone for the nPod. Refer to the <c>Timezone</c> /// enumeration for available options. By default <c>UTC</c> is used /// for the timezone. /// </param> /// <returns></returns> public bool SetNPodTimezone(Guid nPodGuid, string timezone) { SetNPodTimeZoneInput input = new SetNPodTimeZoneInput(); input.Timezone = timezone; // setup parameters GraphQLParameters parameters = new GraphQLParameters(); parameters.Add("uuid", nPodGuid, false); parameters.Add("input", input, false); // make the request and deliver token TokenResponse tokenResponse = RunMutation <TokenResponse>( @"setNPodTimeZone", parameters ); return(DeliverToken(tokenResponse)); }
/// <summary> /// Allows updating of RBAC role properties /// </summary> /// <param name="guid"> /// The RBAC role unique identifier to update /// </param> /// <param name="name"> /// Human readable name for the RBAC role /// </param> /// <param name="description"> /// A description that well describes the role and associated rights. /// The role description should provide enough clarity so that users /// should not have to read individual rights /// </param> /// <param name="rights"> /// List of rights definitions. Please review the class description of /// options for <c>Resource</c> and <c>Permission</c> in the rights string /// that is in the format <c>{resource}/{permission}</c>. Use the /// <c>GetMetadata</c> query to retrieve the latest list of options. /// </param> /// <returns>The new RBAC role</returns> public RbacRole UpdateRbacRole( Guid guid, string name = null, string description = null, string[] rights = null) { UpdateRbacRoleInput input = new UpdateRbacRoleInput(); input.Name = name; input.Description = description; input.Rights = rights; // setup parameters GraphQLParameters parameters = new GraphQLParameters(); parameters.Add("uuid", guid, true); parameters.Add("input", input, false); return(RunMutation <RbacRole>(@"updateRBACRole", parameters)); }
/// <summary> /// Allows deletion of a LUN /// </summary> /// <param name="lunGuid"> /// The unique identifier of the LUN to delete /// </param> /// <returns>If the deletion was a success</returns> public bool DeleteLun(Guid lunGuid) { // setup parameters GraphQLParameters parameters = new GraphQLParameters(); parameters.Add("uuid", lunGuid); TokenResponse token = RunMutation <TokenResponse>("deleteLUN", parameters); return(DeliverToken(token)); }
/// <summary> /// Allows deletion of an existing snapshot schedule template /// </summary> /// <param name="guid"> /// The unique identifier of the snapshot schedule template to delete /// </param> /// <returns>If the query was successful</returns> public bool DeleteSnapshotScheduleTemplate(Guid guid) { // perpare parameters GraphQLParameters parameters = new GraphQLParameters(); parameters.Add("uuid", guid, false); return(RunMutation <bool>( @"deleteSnapshotScheduleTemplate", parameters )); }
/// <summary> /// Retrieves a list of provisioned snapshot schedules on an nPod /// </summary> /// <param name="nPodGuid"> /// The unique identifier of the nPod from which the snapshot schedules /// shall be retrieved. /// </param> /// <returns>A list of snapshot schedules</returns> public NPodSnapshotSchedule[] GetSnapshotSchedules(Guid nPodGuid) { // prepare parameters GraphQLParameters parameters = new GraphQLParameters(); parameters.Add("pod", nPodGuid, true); return(RunQueryMany <NPodSnapshotSchedule>( @"PodSnapshotSchedules", parameters )); }
/// <summary> /// Allows running custom diagnostic commands /// /// <para> /// SPU custom diagnostics requests allows customers to run arbitrary /// diagnostic commands on the services processing units as part of /// troubleshooting issues during a support case. /// </para> /// </summary> /// <param name="spuSerial"> /// The serial number of the SPU on which to run diagnostic /// </param> /// <param name="npodGuid"> /// The unique identifier of the nPod on which to run diagnostic /// </param> /// <param name="diagnosticName"> /// The name of the diagnostic to run /// </param> /// <param name="requestGuid"> /// The unique identifier of the custom diagnostic request to run /// </param> /// <returns></returns> public bool RunCustomDiagnostics( string spuSerial = null, Guid?npodGuid = null, string diagnosticName = null, Guid?requestGuid = null) { // prepare parameters GraphQLParameters parameters = new GraphQLParameters(); parameters.Add("spuSerial", spuSerial, true); parameters.Add("podUID", npodGuid, true); parameters.Add("diagnosticName", diagnosticName, true); parameters.Add("requestUID", requestGuid, true); TokenResponse tokenResponse = RunMutation <TokenResponse>( @"runCustomDiagnostic", parameters ); return(DeliverToken(tokenResponse)); }
/// <summary> /// Allows deletion of SPU information in nebulon ON /// </summary> /// <param name="spuSerial"> /// The serial number of the SPU /// </param> /// <returns></returns> public bool DeleteSpuInformation(string spuSerial) { // prepare parameters GraphQLParameters parameters = new GraphQLParameters(); parameters.Add("serial", spuSerial, true); return(RunMutation <bool>( @"delSPUInfo", parameters )); }
/// <summary> /// Retrieves a list of custom diagnostic command requests /// /// <para> /// Custom diagnostic command requests are used by customer satisfaction /// teams to run arbitrary troubleshooting commands on SPUs. These /// require user confirmation. /// </para> /// /// </summary> /// <param name="spuSerial"> /// The serial number for which to query for custom diagnostic command /// requests /// </param> /// <returns></returns> public SpuCustomDiagnostic[] GetSpuCustomDiagnostics(string spuSerial) { // prepare parameters GraphQLParameters parameters = new GraphQLParameters(); parameters.Add("spuSerial", spuSerial, true); return(RunQueryMany <SpuCustomDiagnostic>( @"spuCustomDiagnostics", parameters )); }
/// <summary> /// Allows updating properties of an existing datacenter room object /// /// <para>At least one property must be specified</para> /// </summary> /// <param name="roomGuid"> /// The unique identifier of the datacenter room to update /// </param> /// <param name="name"> /// New name for the datacenter room /// </param> /// <param name="note"> /// The new note for the datacenter room. For removing the /// note, provide an empty str /// </param> /// <param name="location"> /// A new optional location for the new datacenter room /// </param> /// <returns></returns> public Room UpdateRoom( Guid roomGuid, string name, string note, string location) { // setup room update input UpdateRoomInput input = new UpdateRoomInput { Name = name, Note = note, Location = location }; // setup parameters GraphQLParameters parameters = new GraphQLParameters(); parameters.Add("uuid", roomGuid, false); parameters.Add("input", input, false); return(RunMutation <Room>(@"updateLab", parameters)); }
/// <summary> /// Allows deletion of a volume /// </summary> /// <param name="guid"> /// The unique identifier of the volume or snapshot to delete /// </param> /// <returns>If the request was successful</returns> public bool DeleteVolume(Guid guid) { GraphQLParameters parameters = new GraphQLParameters(); parameters.Add("uuid", guid); TokenResponse tokenResponse = RunMutation <TokenResponse>( @"deleteVolume", parameters ); return(DeliverToken(tokenResponse)); }
/// <summary> /// Allows updating properties of an existing datacenter room object. /// /// <para> /// At least one property must be specified. /// </para> /// </summary> /// <param name="guid"> /// The unique identifier of the row to update /// </param> /// <param name="name"> /// New name for the row /// </param> /// <param name="roomGuid"> /// New parent room for the row /// </param> /// <param name="note"> /// The new note for the row. For removing the note, provide an empty str. /// </param> /// <param name="location"> /// A new optional location for the row /// </param> /// <returns>The updated datacenter row object</returns> public Row Update( Guid guid, string name = null, Guid?roomGuid = null, string note = null, string location = null) { // create input UpdateRowInput input = new UpdateRowInput(); input.RoomGuid = roomGuid; input.Name = name; input.Note = note; input.Location = location; // prepare parameters GraphQLParameters parameters = new GraphQLParameters(); parameters.Add("uuid", guid, false); parameters.Add("input", input, false); return(RunMutation <Row>(@"updateRow", parameters)); }
/// <summary> /// Allows creating a read/writeable clone of a volume or snapshot /// <para> /// Allows the creation of a volume clone from a base volume or /// snapshot. Clones are read and writeable copies of another volume. /// Clones can be used to quickly instantiate copies of data and data /// for recovery purposes when applications require read/write access /// for copy operations. /// </para> /// </summary> /// <param name="name"> /// The human readable name for the volume clone /// </param> /// <param name="volumeGuid"> /// The unique identifier for the volume or snapshot from which to /// create the clone. /// </param> /// <returns></returns> public Volume CreateClone(string name, Guid volumeGuid) { CreateCloneInput input = new CreateCloneInput(); input.Name = name; input.VolumeGuid = volumeGuid; // prepare parameters GraphQLParameters parameters = new GraphQLParameters(); parameters.Add("input", input, false); TokenResponse tokenResponse = RunMutation <TokenResponse>( @"createClone", parameters); bool deliverySuccess = DeliverToken(tokenResponse); if (!deliverySuccess) { throw new Exception("Clone creation failed"); } // query for the clone VolumeFilter filter = new VolumeFilter(); filter.Name = new StringFilter(); filter.Name.MustEqual = name; DateTime start = DateTime.UtcNow; while (true) { Thread.Sleep(2000); VolumeList list = GetVolumes(null, filter, null); if (list.FilteredCount > 0) { return(list.Items[0]); } // check if we should time out. double duration = (DateTime.UtcNow - start).TotalSeconds; double remaining = SNAPSHOT_CREATE_WAITTIME_SEC - duration; if (remaining <= 0) { throw new Exception("Clone creation timed out"); } } }
/// <summary> /// Removes an SPU from an organization /// </summary> /// <param name="spuSerial"> /// The serial number of the SPU /// </param> /// <returns></returns> public bool ReleaseSpu(string spuSerial) { // prepare parameters GraphQLParameters parameters = new GraphQLParameters(); parameters.Add("spuSerial", spuSerial, false); TokenResponse tokenResponse = RunMutation <TokenResponse>( @"releaseSPU", parameters ); return(DeliverToken(tokenResponse)); }
/// <summary> /// Adds an unregistered SPU to the organization /// /// <para> /// SPUs need to be claimed by an organization before they can be used /// for nPod creation.While the nPod creation command will perform an /// implicit claim, this method allows registering SPUs with an /// organization without creating an nPod. /// </para> /// <para> /// Once an SPU was claimed, it will become visible in the <c>GetSpus</c> /// query and in the nebulon ON web user interface. /// </para> /// </summary> /// <param name="spuSerial"> /// The serial number of the SPU to register with an organization. /// </param> /// <returns>If the claim process was successful</returns> public bool ClaimSpu(string spuSerial) { // prepare parameters GraphQLParameters parameters = new GraphQLParameters(); parameters.Add("serial", spuSerial, true); TokenResponse tokenResponse = RunMutation <TokenResponse>( @"claimSPU", parameters ); return(DeliverToken(tokenResponse)); }
/// <summary> /// Allows updating properties of an existing datacenter object /// </summary> /// <param name="dataCenterGuid"> /// The unique identifier of the datacenter to update /// </param> /// <param name="name"> /// New name for the datacenter /// </param> /// <param name="contacts"> /// New list of contacts for the new datacenter. At least one /// contact must be provided and exactly one contact must have the /// <c>Primary</c> property set to <c>true</c>. /// </param> /// <param name="address"> /// New postal address for the datacenter /// </param> /// <param name="note"> /// A new note for the datacenter. For removing the note, provide an empty str /// </param> /// <returns>The updated datacenter</returns> public DataCenter UpdateDataCenter( Guid dataCenterGuid, string name = null, ContactInput[] contacts = null, AddressInput address = null, string note = null) { // setup input object UpdateDataCenterInput updateDataCenterInput = new UpdateDataCenterInput { Name = name, Contacts = contacts, Address = address, Note = note }; // setup parameters GraphQLParameters parameters = new GraphQLParameters(); parameters.Add("uuid", dataCenterGuid); parameters.Add("input", updateDataCenterInput); return(RunMutation <DataCenter>(@"updateDataCenter", parameters)); }