// NewJobState returns a new Jobstate, given a path
NewJobState returns a new Jobstate, given a path
// NewJobState returns a new Jobstate given a path
func NewJobState(path string) (JobState, error) {
	conn, err := NewLocation(path)
	if err != nil {
		return JobState{}, err
	}
	if strings.HasSuffix(conn.Class, "_ConcreteJob") == false {
		return JobState{}, fmt.Errorf("Path is not a valid ConcreteJob. Got: %s", conn.Class)
	}
	jobData, err := conn.GetResult()
	if err != nil {
		return JobState{}, err
	}
	j := JobState{}
	err = PopulateStruct(jobData, &j)
	if err != nil {
		return JobState{}, err
	}
	return j, nil
}
func NewJobState ( path string ) ( JobState , error ) { conn , err := NewLocation ( path ) if err != nil { return JobState { } , err } if strings . HasSuffix ( conn . Class , " " ) == false { return JobState { } , fmt . Errorf ( " " , conn . Class ) } jobData , err := conn . GetResult ( ) if err != nil { return JobState { } , err } j := JobState { } err = PopulateStruct ( jobData , & j ) if err != nil { return JobState { } , err } return j , nil }
NewJobState returns a new Jobstate, given a path
NewJobState returns a new Jobstate given a path
// This may blow up. In theory, both CIM_ConcreteJob and Msvm_Concrete job will // work with this. Also, anything that inherits CIM_ConctreteJob will also work. // TODO: Make this more robust