Get detailed information about a given snapshot

    CLI example:

    .. code-block:: bash

        salt '*' snapper.get_snapshot 1
343994
def get_snapshot(number=0, config='root'):
    '''
    
    '''
    try:
        snapshot = snapper.GetSnapshot(config, int(number))
        return _snapshot_to_data(snapshot)
    except dbus.DBusException as exc:
        raise CommandExecutionError(
            'Error encountered while retrieving snapshot: {0}'
            .format(_dbus_exception_to_reason(exc, locals()))
        )
389469
def describe_snapshots(self, *snapshot_ids):
        
        snapshot_set = {}
        for pos, snapshot_id in enumerate(snapshot_ids):
            snapshot_set["SnapshotId.%d" % (pos + 1)] = snapshot_id
        query = self.query_factory(
            action="DescribeSnapshots", creds=self.creds,
            endpoint=self.endpoint, other_params=snapshot_set)
        d = query.submit()
        return d.addCallback(self.parser.snapshots)
152054
def find_snapshot_timestamp
      last_snap = behavior(:find_snapshots).last
      last_snap.tags.detect { |t| t["name"] =~ /timestamp=(\d+)$/ }
      timestamp = $1
    end
133803
def cli(env, snapshot_id):
    """"""
    block_manager = SoftLayer.BlockStorageManager(env.client)
    deleted = block_manager.delete_snapshot(snapshot_id)

    if deleted:
        click.echo('Snapshot %s deleted' % snapshot_id)
1170483
def process_details():
        
        results = {"argv": sys.argv, "working.directory": os.getcwd()}

        # Process ID and execution IDs (UID, GID, Login, ...)
        for key, method in {
            "pid": "getpid",
            "ppid": "getppid",
            "login": "getlogin",
            "uid": "getuid",
            "euid": "geteuid",
            "gid": "getgid",
            "egid": "getegid",
            "groups": "getgroups",
        }.items():
            try:
                results[key] = getattr(os, method)()
            except (AttributeError, OSError):
                results[key] = None
        return results
313736
def snapshots(self):
        
        j, _ = self.datacenter.request('GET', self.path + '/snapshots')
        return [Snapshot(machine=self, data=s) for s in j]
786207
def get_details(self, obj):
        
        args = {
            'slug': obj.node.slug,
            'pk': obj.pk
        }
        return reverse('api_node_image_detail',
                       kwargs=args,
                       request=self.context.get('request', None))
1262158
def RestoreSnapshot(self,name=None):
		

		if not len(self.data['details']['snapshots']):  raise(clc.CLCException("No snapshots exist"))
		if name is None:  name = self.GetSnapshots()[0]

		name_links = [obj['links'] for obj in self.data['details']['snapshots'] if obj['name']==name][0]
		return(clc.v2.Requests(clc.v2.API.Call('POST',
											   [obj['href'] for obj in name_links if obj['rel']=='restore'][0],
											   session=self.session),
							   alias=self.alias,
							   session=self.session))
617251
def file_get_details(object_id, input_params={}, always_retry=True, **kwargs):
    
    return DXHTTPRequest('/%s/getDetails' % object_id, input_params, always_retry=always_retry, **kwargs)
1168581
def get_info(self, apply_tag=None, info_dicts=False):
        
        raw_infos = self.fetcher.fetch(*self.info_files)
        raw_info = parse.merge_infos(*raw_infos, info_dicts=info_dicts)
        info = parse.parse_info(raw_info, apply_tag=apply_tag)
        return info
445588
def gather_details():
    """"""
    try:
        data = {
            'kernel': platform.uname(),
            'distribution': platform.linux_distribution(),
            'libc': platform.libc_ver(),
            'arch': platform.machine(),
            'python_version': platform.python_version(),
            'os_name': platform.system(),
            'static_hostname': platform.node(),
            'cpu': platform.processor(),
            'fqdn': socket.getfqdn(),
        }
    except AttributeError:
        return {}

    return data
420838
def get_details(self):
        
        data = []
        
        if self.deployment == 'vCenter Clone VM From VM':
            data.append(VmDetailsProperty(key='Cloned VM Name',value= self.dep_attributes.get('vCenter VM','')))

        if self.deployment == 'VCenter Deploy VM From Linked Clone':
            template = self.dep_attributes.get('vCenter VM','')
            snapshot = self.dep_attributes.get('vCenter VM Snapshot','')
            data.append(VmDetailsProperty(key='Cloned VM Name',value= '{0} (snapshot: {1})'.format(template, snapshot)))

        if self.deployment == 'vCenter VM From Image':
            data.append(VmDetailsProperty(key='Base Image Name',value= self.dep_attributes.get('vCenter Image','').split('/')[-1]))

        if self.deployment == 'vCenter VM From Template':
            data.append(VmDetailsProperty(key='Template Name',value= self.dep_attributes.get('vCenter Template','')))

        return data
222471
private Map<File, File> getDataMap(int vcode, String[] dataDirs, String snapshotName) {
		Map<File, File> map = new HashMap<File, File>();

		Map<File, File[]> src = vcode==0 ? getDataMap_1_0(dataDirs) : getDataMap_1_1(dataDirs);
		for (File ks : src.keySet()) {
			File[] sn = src.get(ks);

			if (sn != null) {
				for (int i = 0; i < sn.length; i++) {
					if (snapshotName.equals(sn[i].getName())) {
						map.put(ks, sn[i]);
						break;
					}
				}
			}
		}

		return map;
	}
796626
def detail(device='/dev/md0'):
    '''
    
    '''
    ret = {}
    ret['members'] = {}

    # Lets make sure the device exists before running mdadm
    if not os.path.exists(device):
        msg = "Device {0} doesn't exist!"
        raise CommandExecutionError(msg.format(device))

    cmd = ['mdadm', '--detail', device]
    for line in __salt__['cmd.run_stdout'](cmd, python_shell=False).splitlines():
        if line.startswith(device):
            continue
        if ' ' not in line:
            continue
        if ':' not in line:
            if '/dev/' in line:
                comps = line.split()
                state = comps[4:-1]
                ret['members'][comps[0]] = {
                    'device': comps[-1],
                    'major': comps[1],
                    'minor': comps[2],
                    'number': comps[0],
                    'raiddevice': comps[3],
                    'state': ' '.join(state),
                }
            continue
        comps = line.split(' : ')
        comps[0] = comps[0].lower()
        comps[0] = comps[0].strip()
        comps[0] = comps[0].replace(' ', '_')
        ret[comps[0]] = comps[1].strip()
    return ret
1353270
def info(cls, resource):
        """"""
        snps = cls.list({'id': cls.usable_id(resource)})
        if len(snps) == 1:
            return snps[0]
        elif not snps:
            return

        raise DuplicateResults('snapshot profile %s is ambiguous.' % resource)
730725
def request_snapshot(self, mode, priority=19, **kwargs):
        '''
        
        '''
        if mode not in self.MODE:
            raise InspectorSnapshotException("Unknown mode: '{0}'".format(mode))

        if is_alive(self.pidfile):
            raise CommandExecutionError('Inspection already in progress.')

        self._prepare_full_scan(**kwargs)

        os.system("nice -{0} python {1} {2} {3} {4} & > /dev/null".format(
            priority, __file__, os.path.dirname(self.pidfile), os.path.dirname(self.dbfile), mode))
941677
def repository_get(name, local=False, hosts=None, profile=None):
    '''
    
    '''
    es = _get_instance(hosts, profile)

    try:
        return es.snapshot.get_repository(repository=name, local=local)
    except elasticsearch.NotFoundError:
        return None
    except elasticsearch.TransportError as e:
        raise CommandExecutionError("Cannot obtain repository {0}, server returned code {1} with message {2}".format(name, e.status_code, e.error))