/*
* Copyright 2012 Splunk, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"): you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
namespace Splunk
{
using System;
///
/// The DeploymentClient class represents a Splunk deployment client,
/// providing access to deployment client configuration and status.
///
public class DeploymentClient : Entity
{
///
/// Initializes a new instance of the
/// class.
///
/// The connected service
public DeploymentClient(Service service)
: base(service, "deployment/client")
{
}
///
/// Sets a value indicating whether to disable the deployment client.
/// Note: One must restart splunk in order for this to take effect.
///
public bool Disabled
{
set
{
this.SetCacheValue("disabled", value);
}
}
///
/// Gets the list of server classes.
///
public string[] ServerClasses
{
get
{
return this.GetStringArray("serverClasses", null);
}
}
///
/// Gets or sets he deployment server's target URI for this deployment
/// client. The form of this URI is "deployment_server_uri:port".
///
public string TargetUri
{
get
{
return this.GetString("targetUri", null);
}
set
{
this.SetCacheValue("targetUri", value);
}
}
///
/// Returns the action path. Only edit is overriden, all others are
/// generated through the base Entity class.
///
/// The action requested
/// The action path
public new string ActionPath(string action)
{
if (action.Equals("edit"))
{
return this.Path + "/deployment-client";
}
return base.ActionPath(action);
}
///
/// Disables the deployment client. Note: this is unsupported.
///
public new void Disable()
{
throw new Exception("Disable unsupported");
}
///
/// Enables the deployment client. Note: this is unsupported.
///
public new void Enable()
{
throw new Exception("Enable unsupported");
}
///
/// Relodes the deployment client. Note: this is unsupported.
///
public new void Reload()
{
Service.Get(this.Path + "/deployment-client/Reload");
this.Invalidate();
}
}
}